diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4b96db04e7c..5b89347b626 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,3 +13,4 @@ /handwritten/firestore @googleapis/firestore-team /handwritten/spanner @googleapis/spanner-team /handwritten/bigquery-storage @googleapis/bigquery-team +/handwritten/pubsub @googleapis/pubsub-team diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f6e2fa37c3e..b501df6111e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -10,6 +10,7 @@ "handwritten/logging": "11.2.1", "handwritten/logging-bunyan": "5.1.1", "handwritten/logging-winston": "6.0.1", + "handwritten/pubsub": "5.3.0", "handwritten/spanner": "8.6.0", "handwritten/storage": "7.19.0", "packages/gapic-node-processing": "0.1.7", diff --git a/handwritten/pubsub/.OwlBot.yaml b/handwritten/pubsub/.OwlBot.yaml new file mode 100644 index 00000000000..30b4b11de79 --- /dev/null +++ b/handwritten/pubsub/.OwlBot.yaml @@ -0,0 +1,24 @@ +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/pubsub/(v.*)/.*-nodejs + dest: /owl-bot-staging/pubsub/$1 + +begin-after-commit-hash: 94496fa21b40a7f4d0c4881e8ed8b2bf4117e280 + diff --git a/handwritten/pubsub/.eslintignore b/handwritten/pubsub/.eslintignore new file mode 100644 index 00000000000..12728ecfce2 --- /dev/null +++ b/handwritten/pubsub/.eslintignore @@ -0,0 +1,9 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ +samples/typescript/ +owl-bot-staging/ diff --git a/handwritten/pubsub/.eslintrc.json b/handwritten/pubsub/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/handwritten/pubsub/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/handwritten/pubsub/.gitattributes b/handwritten/pubsub/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/handwritten/pubsub/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/handwritten/pubsub/.gitignore b/handwritten/pubsub/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/handwritten/pubsub/.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/handwritten/pubsub/.jsdoc.js b/handwritten/pubsub/.jsdoc.js new file mode 100644 index 00000000000..c7aff047479 --- /dev/null +++ b/handwritten/pubsub/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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 2025 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/pubsub', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/handwritten/pubsub/.kokoro/.gitattributes b/handwritten/pubsub/.kokoro/.gitattributes new file mode 100644 index 00000000000..87acd4f484e --- /dev/null +++ b/handwritten/pubsub/.kokoro/.gitattributes @@ -0,0 +1 @@ +* linguist-generated=true diff --git a/handwritten/pubsub/.kokoro/common.cfg b/handwritten/pubsub/.kokoro/common.cfg new file mode 100644 index 00000000000..7daf577ef56 --- /dev/null +++ b/handwritten/pubsub/.kokoro/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/test.sh" +} diff --git a/handwritten/pubsub/.kokoro/continuous/node18/common.cfg b/handwritten/pubsub/.kokoro/continuous/node18/common.cfg new file mode 100644 index 00000000000..7daf577ef56 --- /dev/null +++ b/handwritten/pubsub/.kokoro/continuous/node18/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/test.sh" +} diff --git a/handwritten/pubsub/.kokoro/continuous/node18/lint.cfg b/handwritten/pubsub/.kokoro/continuous/node18/lint.cfg new file mode 100644 index 00000000000..e5a4c9758f9 --- /dev/null +++ b/handwritten/pubsub/.kokoro/continuous/node18/lint.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/lint.sh" +} diff --git a/handwritten/pubsub/.kokoro/continuous/node18/samples-test.cfg b/handwritten/pubsub/.kokoro/continuous/node18/samples-test.cfg new file mode 100644 index 00000000000..dddcd761946 --- /dev/null +++ b/handwritten/pubsub/.kokoro/continuous/node18/samples-test.cfg @@ -0,0 +1,12 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/samples-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/pubsub/.kokoro/continuous/node18/system-test.cfg b/handwritten/pubsub/.kokoro/continuous/node18/system-test.cfg new file mode 100644 index 00000000000..3da815140ff --- /dev/null +++ b/handwritten/pubsub/.kokoro/continuous/node18/system-test.cfg @@ -0,0 +1,12 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/system-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/pubsub/.kokoro/continuous/node18/test.cfg b/handwritten/pubsub/.kokoro/continuous/node18/test.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/handwritten/pubsub/.kokoro/docs.sh b/handwritten/pubsub/.kokoro/docs.sh new file mode 100755 index 00000000000..85901242b5e --- /dev/null +++ b/handwritten/pubsub/.kokoro/docs.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +cd $(dirname $0)/.. + +npm install + +npm run docs-test diff --git a/handwritten/pubsub/.kokoro/lint.sh b/handwritten/pubsub/.kokoro/lint.sh new file mode 100755 index 00000000000..c7ffa6438b0 --- /dev/null +++ b/handwritten/pubsub/.kokoro/lint.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global +export PATH="${NPM_CONFIG_PREFIX}/bin:${PATH}" + +# Ensure the npm global directory is writable, otherwise rebuild `npm` +mkdir -p ${NPM_CONFIG_PREFIX}/lib +npm config -g ls || npm i -g npm@`npm --version` + +cd $(dirname $0)/.. + +npm install + +# Install and link samples +if [ -f samples/package.json ]; then + cd samples/ + npm link ../ + npm install + cd .. +fi + +npm run lint diff --git a/handwritten/pubsub/.kokoro/populate-secrets.sh b/handwritten/pubsub/.kokoro/populate-secrets.sh new file mode 100755 index 00000000000..deb2b199eb4 --- /dev/null +++ b/handwritten/pubsub/.kokoro/populate-secrets.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Copyright 2020 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is called in the early stage of `trampoline_v2.sh` to +# populate secrets needed for the CI builds. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + +# Populates requested secrets set in SECRET_MANAGER_KEYS + +# In Kokoro CI builds, we use the service account attached to the +# Kokoro VM. This means we need to setup auth on other CI systems. +# For local run, we just use the gcloud command for retrieving the +# secrets. + +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + GCLOUD_COMMANDS=( + "docker" + "run" + "--entrypoint=gcloud" + "--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR}" + "gcr.io/google.com/cloudsdktool/cloud-sdk" + ) + if [[ "${TRAMPOLINE_CI:-}" == "kokoro" ]]; then + SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" + else + echo "Authentication for this CI system is not implemented yet." + exit 2 + # TODO: Determine appropriate SECRET_LOCATION and the GCLOUD_COMMANDS. + fi +else + # For local run, use /dev/shm or temporary directory for + # KOKORO_GFILE_DIR. + if [[ -d "/dev/shm" ]]; then + export KOKORO_GFILE_DIR=/dev/shm + else + export KOKORO_GFILE_DIR=$(mktemp -d -t ci-XXXXXXXX) + fi + SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" + GCLOUD_COMMANDS=("gcloud") +fi + +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} + +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + "${GCLOUD_COMMANDS[@]}" \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret $key > \ + "$SECRET_LOCATION/$key" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + exit 2 + fi +done diff --git a/handwritten/pubsub/.kokoro/presubmit/node18/common.cfg b/handwritten/pubsub/.kokoro/presubmit/node18/common.cfg new file mode 100644 index 00000000000..7daf577ef56 --- /dev/null +++ b/handwritten/pubsub/.kokoro/presubmit/node18/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/test.sh" +} diff --git a/handwritten/pubsub/.kokoro/presubmit/node18/samples-test.cfg b/handwritten/pubsub/.kokoro/presubmit/node18/samples-test.cfg new file mode 100644 index 00000000000..dddcd761946 --- /dev/null +++ b/handwritten/pubsub/.kokoro/presubmit/node18/samples-test.cfg @@ -0,0 +1,12 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/samples-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/pubsub/.kokoro/presubmit/node18/system-test.cfg b/handwritten/pubsub/.kokoro/presubmit/node18/system-test.cfg new file mode 100644 index 00000000000..3da815140ff --- /dev/null +++ b/handwritten/pubsub/.kokoro/presubmit/node18/system-test.cfg @@ -0,0 +1,12 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/system-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/handwritten/pubsub/.kokoro/presubmit/node18/test.cfg b/handwritten/pubsub/.kokoro/presubmit/node18/test.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/handwritten/pubsub/.kokoro/presubmit/windows/common.cfg b/handwritten/pubsub/.kokoro/presubmit/windows/common.cfg new file mode 100644 index 00000000000..d6e25e0b1b8 --- /dev/null +++ b/handwritten/pubsub/.kokoro/presubmit/windows/common.cfg @@ -0,0 +1,2 @@ +# Format: //devtools/kokoro/config/proto/build.proto + diff --git a/handwritten/pubsub/.kokoro/presubmit/windows/test.cfg b/handwritten/pubsub/.kokoro/presubmit/windows/test.cfg new file mode 100644 index 00000000000..8b865a1df0f --- /dev/null +++ b/handwritten/pubsub/.kokoro/presubmit/windows/test.cfg @@ -0,0 +1,2 @@ +# Use the test file directly +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/test.bat" diff --git a/handwritten/pubsub/.kokoro/publish.sh b/handwritten/pubsub/.kokoro/publish.sh new file mode 100755 index 00000000000..ca1d47af347 --- /dev/null +++ b/handwritten/pubsub/.kokoro/publish.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +# Start the releasetool reporter +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +cd $(dirname $0)/.. + +NPM_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_google-cloud-npm-token-1) +echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc + +npm install +npm pack . +# npm provides no way to specify, observe, or predict the name of the tarball +# file it generates. We have to look in the current directory for the freshest +# .tgz file. +TARBALL=$(ls -1 -t *.tgz | head -1) + +npm publish --access=public --registry=https://wombat-dressing-room.appspot.com "$TARBALL" + +# Kokoro collects *.tgz and package-lock.json files and stores them in Placer +# so we can generate SBOMs and attestations. +# However, we *don't* want Kokoro to collect package-lock.json and *.tgz files +# that happened to be installed with dependencies. +find node_modules -name package-lock.json -o -name "*.tgz" | xargs rm -f \ No newline at end of file diff --git a/handwritten/pubsub/.kokoro/release/common.cfg b/handwritten/pubsub/.kokoro/release/common.cfg new file mode 100644 index 00000000000..3ba2eb095fe --- /dev/null +++ b/handwritten/pubsub/.kokoro/release/common.cfg @@ -0,0 +1,8 @@ +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} diff --git a/handwritten/pubsub/.kokoro/release/docs-devsite.cfg b/handwritten/pubsub/.kokoro/release/docs-devsite.cfg new file mode 100644 index 00000000000..0d8c43d3bcc --- /dev/null +++ b/handwritten/pubsub/.kokoro/release/docs-devsite.cfg @@ -0,0 +1,26 @@ +# service account used to publish up-to-date docs. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# doc publications use a Python image. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/trampoline_v2.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/release/docs-devsite.sh" +} diff --git a/handwritten/pubsub/.kokoro/release/docs-devsite.sh b/handwritten/pubsub/.kokoro/release/docs-devsite.sh new file mode 100755 index 00000000000..81a89f6c172 --- /dev/null +++ b/handwritten/pubsub/.kokoro/release/docs-devsite.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# 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. + +set -eo pipefail + +if [[ -z "$CREDENTIALS" ]]; then + # if CREDENTIALS are explicitly set, assume we're testing locally + # and don't set NPM_CONFIG_PREFIX. + export NPM_CONFIG_PREFIX=${HOME}/.npm-global + export PATH="$PATH:${NPM_CONFIG_PREFIX}/bin" + cd $(dirname $0)/../.. +fi + +npm install +npm install --no-save @google-cloud/cloud-rad@^0.4.0 +# publish docs to devsite +npx @google-cloud/cloud-rad . cloud-rad diff --git a/handwritten/pubsub/.kokoro/release/docs.cfg b/handwritten/pubsub/.kokoro/release/docs.cfg new file mode 100644 index 00000000000..97deb73f38c --- /dev/null +++ b/handwritten/pubsub/.kokoro/release/docs.cfg @@ -0,0 +1,26 @@ +# service account used to publish up-to-date docs. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# doc publications use a Python image. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/trampoline_v2.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/release/docs.sh" +} diff --git a/handwritten/pubsub/.kokoro/release/docs.sh b/handwritten/pubsub/.kokoro/release/docs.sh new file mode 100755 index 00000000000..e9079a60530 --- /dev/null +++ b/handwritten/pubsub/.kokoro/release/docs.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# build jsdocs (Python is installed on the Node 18 docker image). +if [[ -z "$CREDENTIALS" ]]; then + # if CREDENTIALS are explicitly set, assume we're testing locally + # and don't set NPM_CONFIG_PREFIX. + export NPM_CONFIG_PREFIX=${HOME}/.npm-global + export PATH="$PATH:${NPM_CONFIG_PREFIX}/bin" + cd $(dirname $0)/../.. +fi +npm install +npm run docs + +# create docs.metadata, based on package.json and .repo-metadata.json. +npm i json@9.0.6 -g +python3 -m docuploader create-metadata \ + --name=$(cat .repo-metadata.json | json name) \ + --version=$(cat package.json | json version) \ + --language=$(cat .repo-metadata.json | json language) \ + --distribution-name=$(cat .repo-metadata.json | json distribution_name) \ + --product-page=$(cat .repo-metadata.json | json product_documentation) \ + --github-repository=$(cat .repo-metadata.json | json repo) \ + --issue-tracker=$(cat .repo-metadata.json | json issue_tracker) +cp docs.metadata ./docs/docs.metadata + +# deploy the docs. +if [[ -z "$CREDENTIALS" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi +if [[ -z "$BUCKET" ]]; then + BUCKET=docs-staging +fi +python3 -m docuploader upload ./docs --credentials $CREDENTIALS --staging-bucket $BUCKET diff --git a/handwritten/pubsub/.kokoro/release/publish.cfg b/handwritten/pubsub/.kokoro/release/publish.cfg new file mode 100644 index 00000000000..fc23dd72145 --- /dev/null +++ b/handwritten/pubsub/.kokoro/release/publish.cfg @@ -0,0 +1,51 @@ +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-npm-token-1" + } + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-pubsub/handwritten/pubsub/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:18-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-pubsub/handwritten/pubsub/.kokoro/publish.sh" +} + +# Store the packages we uploaded to npmjs.com and their corresponding +# package-lock.jsons in Placer. That way, we have a record of exactly +# what we published, and which version of which tools we used to publish +# it, which we can use to generate SBOMs and attestations. +action { + define_artifacts { + regex: "github/**/*.tgz" + regex: "github/**/package-lock.json" + strip_prefix: "github" + } +} diff --git a/handwritten/pubsub/.kokoro/samples-test.sh b/handwritten/pubsub/.kokoro/samples-test.sh new file mode 100755 index 00000000000..528775394e0 --- /dev/null +++ b/handwritten/pubsub/.kokoro/samples-test.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Ensure the npm global directory is writable, otherwise rebuild `npm` +mkdir -p $NPM_CONFIG_PREFIX +npm config -g ls || npm i -g npm@`npm --version` + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secret_manager/long-door-651-kokoro-system-test-service-account +export GCLOUD_PROJECT=long-door-651 + +cd $(dirname $0)/.. + +# Run a pre-test hook, if a pre-samples-test.sh is in the project +if [ -f .kokoro/pre-samples-test.sh ]; then + set +x + . .kokoro/pre-samples-test.sh + set -x +fi + +if [ -f samples/package.json ]; then + npm install + + # Install and link samples + cd samples/ + npm link ../ + npm install + cd .. + # If tests are running against main branch, configure flakybot + # to open issues on failures: + if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"nightly"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + $KOKORO_GFILE_DIR/linux_amd64/flakybot + } + trap cleanup EXIT HUP + fi + + npm run samples-test +fi + +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=18 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report || true + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/handwritten/pubsub/.kokoro/system-test.sh b/handwritten/pubsub/.kokoro/system-test.sh new file mode 100755 index 00000000000..a90d5cfec89 --- /dev/null +++ b/handwritten/pubsub/.kokoro/system-test.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secret_manager/long-door-651-kokoro-system-test-service-account +export GCLOUD_PROJECT=long-door-651 + +cd $(dirname $0)/.. + +# Run a pre-test hook, if a pre-system-test.sh is in the project +if [ -f .kokoro/pre-system-test.sh ]; then + set +x + . .kokoro/pre-system-test.sh + set -x +fi + +npm install + +# If tests are running against main branch, configure flakybot +# to open issues on failures: +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"nightly"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + $KOKORO_GFILE_DIR/linux_amd64/flakybot + } + trap cleanup EXIT HUP +fi + +npm run system-test + +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=18 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report || true + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/handwritten/pubsub/.kokoro/test.bat b/handwritten/pubsub/.kokoro/test.bat new file mode 100644 index 00000000000..caf825656c2 --- /dev/null +++ b/handwritten/pubsub/.kokoro/test.bat @@ -0,0 +1,33 @@ +@rem Copyright 2018 Google LLC. All rights reserved. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo "Starting Windows build" + +cd /d %~dp0 +cd .. + +@rem npm path is not currently set in our image, we should fix this next time +@rem we upgrade Node.js in the image: +SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm + +call nvm use 18 +call which node + +call npm install || goto :error +call npm run test || goto :error + +goto :EOF + +:error +exit /b 1 diff --git a/handwritten/pubsub/.kokoro/test.sh b/handwritten/pubsub/.kokoro/test.sh new file mode 100755 index 00000000000..0d9f6392a75 --- /dev/null +++ b/handwritten/pubsub/.kokoro/test.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=${HOME}/.npm-global + +cd $(dirname $0)/.. + +npm install +# If tests are running against main branch, configure flakybot +# to open issues on failures: +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"nightly"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot + $KOKORO_GFILE_DIR/linux_amd64/flakybot + } + trap cleanup EXIT HUP +fi +# Unit tests exercise the entire API surface, which may include +# deprecation warnings: +export MOCHA_THROW_DEPRECATION=false +npm test + +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=18 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report || true + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/handwritten/pubsub/.kokoro/trampoline.sh b/handwritten/pubsub/.kokoro/trampoline.sh new file mode 100755 index 00000000000..f693a1ce7aa --- /dev/null +++ b/handwritten/pubsub/.kokoro/trampoline.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is not used any more, but we keep this file for making it +# easy to roll back. +# TODO: Remove this file from the template. + +set -eo pipefail + +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/handwritten/pubsub/.kokoro/trampoline_v2.sh b/handwritten/pubsub/.kokoro/trampoline_v2.sh new file mode 100755 index 00000000000..682bdefdb06 --- /dev/null +++ b/handwritten/pubsub/.kokoro/trampoline_v2.sh @@ -0,0 +1,510 @@ +#!/usr/bin/env bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# trampoline_v2.sh +# +# If you want to make a change to this file, consider doing so at: +# https://github.com/googlecloudplatform/docker-ci-helper +# +# This script is for running CI builds. For Kokoro builds, we +# set this script to `build_file` field in the Kokoro configuration. + +# This script does 3 things. +# +# 1. Prepare the Docker image for the test +# 2. Run the Docker with appropriate flags to run the test +# 3. Upload the newly built Docker image +# +# in a way that is somewhat compatible with trampoline_v1. +# +# These environment variables are required: +# TRAMPOLINE_IMAGE: The docker image to use. +# TRAMPOLINE_DOCKERFILE: The location of the Dockerfile. +# +# You can optionally change these environment variables: +# TRAMPOLINE_IMAGE_UPLOAD: +# (true|false): Whether to upload the Docker image after the +# successful builds. +# TRAMPOLINE_BUILD_FILE: The script to run in the docker container. +# TRAMPOLINE_WORKSPACE: The workspace path in the docker container. +# Defaults to /workspace. +# Potentially there are some repo specific envvars in .trampolinerc in +# the project root. +# +# Here is an example for running this script. +# TRAMPOLINE_IMAGE=gcr.io/cloud-devrel-kokoro-resources/node:18-user \ +# TRAMPOLINE_BUILD_FILE=.kokoro/system-test.sh \ +# .kokoro/trampoline_v2.sh + +set -euo pipefail + +TRAMPOLINE_VERSION="2.0.7" + +if command -v tput >/dev/null && [[ -n "${TERM:-}" ]]; then + readonly IO_COLOR_RED="$(tput setaf 1)" + readonly IO_COLOR_GREEN="$(tput setaf 2)" + readonly IO_COLOR_YELLOW="$(tput setaf 3)" + readonly IO_COLOR_RESET="$(tput sgr0)" +else + readonly IO_COLOR_RED="" + readonly IO_COLOR_GREEN="" + readonly IO_COLOR_YELLOW="" + readonly IO_COLOR_RESET="" +fi + +function function_exists { + [ $(LC_ALL=C type -t $1)"" == "function" ] +} + +# Logs a message using the given color. The first argument must be one +# of the IO_COLOR_* variables defined above, such as +# "${IO_COLOR_YELLOW}". The remaining arguments will be logged in the +# given color. The log message will also have an RFC-3339 timestamp +# prepended (in UTC). You can disable the color output by setting +# TERM=vt100. +function log_impl() { + local color="$1" + shift + local timestamp="$(date -u "+%Y-%m-%dT%H:%M:%SZ")" + echo "================================================================" + echo "${color}${timestamp}:" "$@" "${IO_COLOR_RESET}" + echo "================================================================" +} + +# Logs the given message with normal coloring and a timestamp. +function log() { + log_impl "${IO_COLOR_RESET}" "$@" +} + +# Logs the given message in green with a timestamp. +function log_green() { + log_impl "${IO_COLOR_GREEN}" "$@" +} + +# Logs the given message in yellow with a timestamp. +function log_yellow() { + log_impl "${IO_COLOR_YELLOW}" "$@" +} + +# Logs the given message in red with a timestamp. +function log_red() { + log_impl "${IO_COLOR_RED}" "$@" +} + +readonly tmpdir=$(mktemp -d -t ci-XXXXXXXX) +readonly tmphome="${tmpdir}/h" +mkdir -p "${tmphome}" + +function cleanup() { + rm -rf "${tmpdir}" +} +trap cleanup EXIT + +RUNNING_IN_CI="${RUNNING_IN_CI:-false}" + +# The workspace in the container, defaults to /workspace. +TRAMPOLINE_WORKSPACE="${TRAMPOLINE_WORKSPACE:-/workspace}" + +pass_down_envvars=( + # TRAMPOLINE_V2 variables. + # Tells scripts whether they are running as part of CI or not. + "RUNNING_IN_CI" + # Indicates which CI system we're in. + "TRAMPOLINE_CI" + # Indicates the version of the script. + "TRAMPOLINE_VERSION" + # Contains path to build artifacts being executed. + "KOKORO_BUILD_ARTIFACTS_SUBDIR" +) + +log_yellow "Building with Trampoline ${TRAMPOLINE_VERSION}" + +# Detect which CI systems we're in. If we're in any of the CI systems +# we support, `RUNNING_IN_CI` will be true and `TRAMPOLINE_CI` will be +# the name of the CI system. Both envvars will be passing down to the +# container for telling which CI system we're in. +if [[ -n "${KOKORO_BUILD_ID:-}" ]]; then + # descriptive env var for indicating it's on CI. + RUNNING_IN_CI="true" + TRAMPOLINE_CI="kokoro" + if [[ "${TRAMPOLINE_USE_LEGACY_SERVICE_ACCOUNT:-}" == "true" ]]; then + if [[ ! -f "${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json" ]]; then + log_red "${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json does not exist. Did you forget to mount cloud-devrel-kokoro-resources/trampoline? Aborting." + exit 1 + fi + # This service account will be activated later. + TRAMPOLINE_SERVICE_ACCOUNT="${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json" + else + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + gcloud auth list + fi + log_yellow "Configuring Container Registry access" + gcloud auth configure-docker --quiet + fi + pass_down_envvars+=( + # KOKORO dynamic variables. + "KOKORO_BUILD_NUMBER" + "KOKORO_BUILD_ID" + "KOKORO_JOB_NAME" + "KOKORO_GIT_COMMIT" + "KOKORO_GITHUB_COMMIT" + "KOKORO_GITHUB_PULL_REQUEST_NUMBER" + "KOKORO_GITHUB_PULL_REQUEST_COMMIT" + # For flakybot + "KOKORO_GITHUB_COMMIT_URL" + "KOKORO_GITHUB_PULL_REQUEST_URL" + ) +elif [[ "${TRAVIS:-}" == "true" ]]; then + RUNNING_IN_CI="true" + TRAMPOLINE_CI="travis" + pass_down_envvars+=( + "TRAVIS_BRANCH" + "TRAVIS_BUILD_ID" + "TRAVIS_BUILD_NUMBER" + "TRAVIS_BUILD_WEB_URL" + "TRAVIS_COMMIT" + "TRAVIS_COMMIT_MESSAGE" + "TRAVIS_COMMIT_RANGE" + "TRAVIS_JOB_NAME" + "TRAVIS_JOB_NUMBER" + "TRAVIS_JOB_WEB_URL" + "TRAVIS_PULL_REQUEST" + "TRAVIS_PULL_REQUEST_BRANCH" + "TRAVIS_PULL_REQUEST_SHA" + "TRAVIS_PULL_REQUEST_SLUG" + "TRAVIS_REPO_SLUG" + "TRAVIS_SECURE_ENV_VARS" + "TRAVIS_TAG" + ) +elif [[ -n "${GITHUB_RUN_ID:-}" ]]; then + RUNNING_IN_CI="true" + TRAMPOLINE_CI="github-workflow" + pass_down_envvars+=( + "GITHUB_WORKFLOW" + "GITHUB_RUN_ID" + "GITHUB_RUN_NUMBER" + "GITHUB_ACTION" + "GITHUB_ACTIONS" + "GITHUB_ACTOR" + "GITHUB_REPOSITORY" + "GITHUB_EVENT_NAME" + "GITHUB_EVENT_PATH" + "GITHUB_SHA" + "GITHUB_REF" + "GITHUB_HEAD_REF" + "GITHUB_BASE_REF" + ) +elif [[ "${CIRCLECI:-}" == "true" ]]; then + RUNNING_IN_CI="true" + TRAMPOLINE_CI="circleci" + pass_down_envvars+=( + "CIRCLE_BRANCH" + "CIRCLE_BUILD_NUM" + "CIRCLE_BUILD_URL" + "CIRCLE_COMPARE_URL" + "CIRCLE_JOB" + "CIRCLE_NODE_INDEX" + "CIRCLE_NODE_TOTAL" + "CIRCLE_PREVIOUS_BUILD_NUM" + "CIRCLE_PROJECT_REPONAME" + "CIRCLE_PROJECT_USERNAME" + "CIRCLE_REPOSITORY_URL" + "CIRCLE_SHA1" + "CIRCLE_STAGE" + "CIRCLE_USERNAME" + "CIRCLE_WORKFLOW_ID" + "CIRCLE_WORKFLOW_JOB_ID" + "CIRCLE_WORKFLOW_UPSTREAM_JOB_IDS" + "CIRCLE_WORKFLOW_WORKSPACE_ID" + ) +fi + +# Configure the service account for pulling the docker image. +function repo_root() { + local dir="$1" + while [[ ! -d "${dir}/.git" ]]; do + dir="$(dirname "$dir")" + done + echo "${dir}" +} + +# Detect the project root. In CI builds, we assume the script is in +# the git tree and traverse from there, otherwise, traverse from `pwd` +# to find `.git` directory. +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + PROGRAM_PATH="$(realpath "$0")" + PROGRAM_DIR="$(dirname "${PROGRAM_PATH}")" + PROJECT_ROOT="$(repo_root "${PROGRAM_DIR}")/handwritten/pubsub" +else + PROJECT_ROOT="$(repo_root $(pwd))/handwritten/pubsub" +fi + +log_yellow "Changing to the project root: ${PROJECT_ROOT}." +cd "${PROJECT_ROOT}" + +# Auto-injected conditional check +# Check if the package directory has changes. If not, skip tests. +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + # The package path is hardcoded during migration + RELATIVE_PKG_PATH="handwritten/pubsub" + + echo "Checking for changes in ${RELATIVE_PKG_PATH}..." + + # Determine the diff range based on the CI system/event + # Safe default: HEAD~1..HEAD + DIFF_RANGE="HEAD~1..HEAD" + + if git diff --quiet "${DIFF_RANGE}" -- "${RELATIVE_PKG_PATH}"; then + echo "No changes detected in ${RELATIVE_PKG_PATH}. Skipping tests." + exit 0 + else + echo "Changes detected in ${RELATIVE_PKG_PATH}. Proceeding with tests." + fi +fi + +# To support relative path for `TRAMPOLINE_SERVICE_ACCOUNT`, we need +# to use this environment variable in `PROJECT_ROOT`. +if [[ -n "${TRAMPOLINE_SERVICE_ACCOUNT:-}" ]]; then + + mkdir -p "${tmpdir}/gcloud" + gcloud_config_dir="${tmpdir}/gcloud" + + log_yellow "Using isolated gcloud config: ${gcloud_config_dir}." + export CLOUDSDK_CONFIG="${gcloud_config_dir}" + + log_yellow "Using ${TRAMPOLINE_SERVICE_ACCOUNT} for authentication." + gcloud auth activate-service-account \ + --key-file "${TRAMPOLINE_SERVICE_ACCOUNT}" + log_yellow "Configuring Container Registry access" + gcloud auth configure-docker --quiet +fi + +required_envvars=( + # The basic trampoline configurations. + "TRAMPOLINE_IMAGE" + "TRAMPOLINE_BUILD_FILE" +) + +if [[ -f "${PROJECT_ROOT}/.trampolinerc" ]]; then + source "${PROJECT_ROOT}/.trampolinerc" +fi + +log_yellow "Checking environment variables." +for e in "${required_envvars[@]}" +do + if [[ -z "${!e:-}" ]]; then + log "Missing ${e} env var. Aborting." + exit 1 + fi +done + +# We want to support legacy style TRAMPOLINE_BUILD_FILE used with V1 +# script: e.g. "github/repo-name/.kokoro/run_tests.sh" +TRAMPOLINE_BUILD_FILE="${TRAMPOLINE_BUILD_FILE#github/*/}" +log_yellow "Using TRAMPOLINE_BUILD_FILE: ${TRAMPOLINE_BUILD_FILE}" + +# ignore error on docker operations and test execution +set +e + +log_yellow "Preparing Docker image." +# We only download the docker image in CI builds. +if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + # Download the docker image specified by `TRAMPOLINE_IMAGE` + + # We may want to add --max-concurrent-downloads flag. + + log_yellow "Start pulling the Docker image: ${TRAMPOLINE_IMAGE}." + if docker pull "${TRAMPOLINE_IMAGE}"; then + log_green "Finished pulling the Docker image: ${TRAMPOLINE_IMAGE}." + has_image="true" + else + log_red "Failed pulling the Docker image: ${TRAMPOLINE_IMAGE}." + has_image="false" + fi +else + # For local run, check if we have the image. + if docker images "${TRAMPOLINE_IMAGE}" | grep "${TRAMPOLINE_IMAGE%:*}"; then + has_image="true" + else + has_image="false" + fi +fi + + +# The default user for a Docker container has uid 0 (root). To avoid +# creating root-owned files in the build directory we tell docker to +# use the current user ID. +user_uid="$(id -u)" +user_gid="$(id -g)" +user_name="$(id -un)" + +# To allow docker in docker, we add the user to the docker group in +# the host os. +docker_gid=$(cut -d: -f3 < <(getent group docker)) + +update_cache="false" +if [[ "${TRAMPOLINE_DOCKERFILE:-none}" != "none" ]]; then + # Build the Docker image from the source. + context_dir=$(dirname "${TRAMPOLINE_DOCKERFILE}") + docker_build_flags=( + "-f" "${TRAMPOLINE_DOCKERFILE}" + "-t" "${TRAMPOLINE_IMAGE}" + "--build-arg" "UID=${user_uid}" + "--build-arg" "USERNAME=${user_name}" + ) + if [[ "${has_image}" == "true" ]]; then + docker_build_flags+=("--cache-from" "${TRAMPOLINE_IMAGE}") + fi + + log_yellow "Start building the docker image." + if [[ "${TRAMPOLINE_VERBOSE:-false}" == "true" ]]; then + echo "docker build" "${docker_build_flags[@]}" "${context_dir}" + fi + + # ON CI systems, we want to suppress docker build logs, only + # output the logs when it fails. + if [[ "${RUNNING_IN_CI:-}" == "true" ]]; then + if docker build "${docker_build_flags[@]}" "${context_dir}" \ + > "${tmpdir}/docker_build.log" 2>&1; then + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + cat "${tmpdir}/docker_build.log" + fi + + log_green "Finished building the docker image." + update_cache="true" + else + log_red "Failed to build the Docker image, aborting." + log_yellow "Dumping the build logs:" + cat "${tmpdir}/docker_build.log" + exit 1 + fi + else + if docker build "${docker_build_flags[@]}" "${context_dir}"; then + log_green "Finished building the docker image." + update_cache="true" + else + log_red "Failed to build the Docker image, aborting." + exit 1 + fi + fi +else + if [[ "${has_image}" != "true" ]]; then + log_red "We do not have ${TRAMPOLINE_IMAGE} locally, aborting." + exit 1 + fi +fi + +# We use an array for the flags so they are easier to document. +docker_flags=( + # Remove the container after it exists. + "--rm" + + # Use the host network. + "--network=host" + + # Run in priviledged mode. We are not using docker for sandboxing or + # isolation, just for packaging our dev tools. + "--privileged" + + # Run the docker script with the user id. Because the docker image gets to + # write in ${PWD} you typically want this to be your user id. + # To allow docker in docker, we need to use docker gid on the host. + "--user" "${user_uid}:${docker_gid}" + + # Pass down the USER. + "--env" "USER=${user_name}" + + # Mount the project directory inside the Docker container. + "--volume" "${PROJECT_ROOT}:${TRAMPOLINE_WORKSPACE}" + "--workdir" "${TRAMPOLINE_WORKSPACE}" + "--env" "PROJECT_ROOT=${TRAMPOLINE_WORKSPACE}" + + # Mount the temporary home directory. + "--volume" "${tmphome}:/h" + "--env" "HOME=/h" + + # Allow docker in docker. + "--volume" "/var/run/docker.sock:/var/run/docker.sock" + + # Mount the /tmp so that docker in docker can mount the files + # there correctly. + "--volume" "/tmp:/tmp" + # Pass down the KOKORO_GFILE_DIR and KOKORO_KEYSTORE_DIR + # TODO(tmatsuo): This part is not portable. + "--env" "TRAMPOLINE_SECRET_DIR=/secrets" + "--volume" "${KOKORO_GFILE_DIR:-/dev/shm}:/secrets/gfile" + "--env" "KOKORO_GFILE_DIR=/secrets/gfile" + "--volume" "${KOKORO_KEYSTORE_DIR:-/dev/shm}:/secrets/keystore" + "--env" "KOKORO_KEYSTORE_DIR=/secrets/keystore" +) + +# Add an option for nicer output if the build gets a tty. +if [[ -t 0 ]]; then + docker_flags+=("-it") +fi + +# Passing down env vars +for e in "${pass_down_envvars[@]}" +do + if [[ -n "${!e:-}" ]]; then + docker_flags+=("--env" "${e}=${!e}") + fi +done + +# If arguments are given, all arguments will become the commands run +# in the container, otherwise run TRAMPOLINE_BUILD_FILE. +if [[ $# -ge 1 ]]; then + log_yellow "Running the given commands '" "${@:1}" "' in the container." + readonly commands=("${@:1}") + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + echo docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" "${commands[@]}" + fi + docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" "${commands[@]}" +else + log_yellow "Running the tests in a Docker container." + docker_flags+=("--entrypoint=${TRAMPOLINE_BUILD_FILE}") + if [[ "${TRAMPOLINE_VERBOSE:-}" == "true" ]]; then + echo docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" + fi + docker run "${docker_flags[@]}" "${TRAMPOLINE_IMAGE}" +fi + + +test_retval=$? + +if [[ ${test_retval} -eq 0 ]]; then + log_green "Build finished with ${test_retval}" +else + log_red "Build finished with ${test_retval}" +fi + +# Only upload it when the test passes. +if [[ "${update_cache}" == "true" ]] && \ + [[ $test_retval == 0 ]] && \ + [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]]; then + log_yellow "Uploading the Docker image." + if docker push "${TRAMPOLINE_IMAGE}"; then + log_green "Finished uploading the Docker image." + else + log_red "Failed uploading the Docker image." + fi + # Call trampoline_after_upload_hook if it's defined. + if function_exists trampoline_after_upload_hook; then + trampoline_after_upload_hook + fi + +fi + +exit "${test_retval}" diff --git a/handwritten/pubsub/.mocharc.js b/handwritten/pubsub/.mocharc.js new file mode 100644 index 00000000000..2431859019f --- /dev/null +++ b/handwritten/pubsub/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/handwritten/pubsub/.mocharc.json b/handwritten/pubsub/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/handwritten/pubsub/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/handwritten/pubsub/.nycrc b/handwritten/pubsub/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/handwritten/pubsub/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/handwritten/pubsub/.prettierignore b/handwritten/pubsub/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/handwritten/pubsub/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/handwritten/pubsub/.prettierrc.js b/handwritten/pubsub/.prettierrc.js new file mode 100644 index 00000000000..d2eddc2ed89 --- /dev/null +++ b/handwritten/pubsub/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/handwritten/pubsub/.readme-partials.yml b/handwritten/pubsub/.readme-partials.yml new file mode 100644 index 00000000000..9f3488ec984 --- /dev/null +++ b/handwritten/pubsub/.readme-partials.yml @@ -0,0 +1,26 @@ +introduction: |- + [Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows + you to send and receive messages between independent applications. + + This document contains links to an [API reference](https://cloud.google.com/nodejs/docs/reference/pubsub/latest/overview), samples, + and other resources useful to developing Node.js applications. + For additional help developing Pub/Sub applications, in Node.js and other languages, see our + [Pub/Sub quickstart](https://cloud.google.com/pubsub/docs/quickstart-client-libraries), + [publisher](https://cloud.google.com/pubsub/docs/publisher), and [subscriber](https://cloud.google.com/pubsub/docs/subscriber) + guides. +body: |- + ## Running gRPC C++ bindings + + For some workflows and environments it might make sense to use the C++ gRPC implementation, + instead of the default one (see: [#770](https://github.com/googleapis/nodejs-pubsub/issues/770)): + + To configure `@google-cloud/pubsub` to use an alternative `grpc` transport: + + 1. `npm install grpc`, adding `grpc` as a dependency. + 1. instantiate `@google-cloud/pubsub` with `grpc`: + + ```js + const {PubSub} = require('@google-cloud/pubsub'); + const grpc = require('grpc'); + const pubsub = new PubSub({grpc}); + ``` diff --git a/handwritten/pubsub/.repo-metadata.json b/handwritten/pubsub/.repo-metadata.json new file mode 100644 index 00000000000..c2522eb0d8d --- /dev/null +++ b/handwritten/pubsub/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "distribution_name": "@google-cloud/pubsub", + "release_level": "stable", + "product_documentation": "https://cloud.google.com/pubsub/docs/", + "repo": "googleapis/google-cloud-node", + "default_version": "v1", + "language": "nodejs", + "requires_billing": true, + "issue_tracker": "https://issuetracker.google.com/savedsearches/559741", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/pubsub/latest", + "name": "pubsub", + "name_pretty": "Google Cloud Pub/Sub", + "api_id": "pubsub.googleapis.com", + "codeowner_team": "@googleapis/pubsub-team @googleapis/cloud-sdk-nodejs-team", + "api_shortname": "pubsub", + "library_type": "GAPIC_COMBO" +} diff --git a/handwritten/pubsub/.trampolinerc b/handwritten/pubsub/.trampolinerc new file mode 100644 index 00000000000..a04ed00bb26 --- /dev/null +++ b/handwritten/pubsub/.trampolinerc @@ -0,0 +1,52 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Template for .trampolinerc + +# Add required env vars here. +required_envvars+=( +) + +# Add env vars which are passed down into the container here. +pass_down_envvars+=( + "AUTORELEASE_PR" + "VERSION" +) + +# Prevent unintentional override on the default image. +if [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]] && \ + [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then + echo "Please set TRAMPOLINE_IMAGE if you want to upload the Docker image." + exit 1 +fi + +# Define the default value if it makes sense. +if [[ -z "${TRAMPOLINE_IMAGE_UPLOAD:-}" ]]; then + TRAMPOLINE_IMAGE_UPLOAD="" +fi + +if [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then + TRAMPOLINE_IMAGE="" +fi + +if [[ -z "${TRAMPOLINE_DOCKERFILE:-}" ]]; then + TRAMPOLINE_DOCKERFILE="" +fi + +if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then + TRAMPOLINE_BUILD_FILE="" +fi + +# Secret Manager secrets. +source ${PROJECT_ROOT}/handwritten/pubsub/.kokoro/populate-secrets.sh diff --git a/handwritten/pubsub/CHANGELOG.md b/handwritten/pubsub/CHANGELOG.md new file mode 100644 index 00000000000..55636e53161 --- /dev/null +++ b/handwritten/pubsub/CHANGELOG.md @@ -0,0 +1,1682 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/pubsub?activeTab=versions + +## [5.3.0](https://github.com/googleapis/nodejs-pubsub/compare/v5.2.4...v5.3.0) (2026-02-19) + + +### Features + +* Manual proto pushing ([#2134](https://github.com/googleapis/nodejs-pubsub/issues/2134)) ([2f1e8d1](https://github.com/googleapis/nodejs-pubsub/commit/2f1e8d198ffbc14795f9f0d0a88095d69ac437a3)) + +## [5.2.4](https://github.com/googleapis/nodejs-pubsub/compare/v5.2.3...v5.2.4) (2026-02-11) + + +### Bug Fixes + +* **deps:** Update all dependencies ([#2105](https://github.com/googleapis/nodejs-pubsub/issues/2105)) ([c7d42e3](https://github.com/googleapis/nodejs-pubsub/commit/c7d42e391eac92137abd8aeb2ac25bc89856aa15)) + +## [5.2.3](https://github.com/googleapis/nodejs-pubsub/compare/v5.2.2...v5.2.3) (2026-02-11) + + +### Bug Fixes + +* Clean up earlier refactor issues with maxExtensionTime ([#2127](https://github.com/googleapis/nodejs-pubsub/issues/2127)) ([c22471d](https://github.com/googleapis/nodejs-pubsub/commit/c22471de60c63d9420c037ca3269af8b7dbf9d92)) + +## [5.2.2](https://github.com/googleapis/nodejs-pubsub/compare/v5.2.1...v5.2.2) (2026-01-14) + + +### Bug Fixes + +* **WaitForProcessing:** Shutdown option `WaitForProcessing` never entered on subscription close ([#2118](https://github.com/googleapis/nodejs-pubsub/issues/2118)) ([e99b37e](https://github.com/googleapis/nodejs-pubsub/commit/e99b37e28ce551ad24325ac951ac33a60f8faa99)) + +## [5.2.1](https://github.com/googleapis/nodejs-pubsub/compare/v5.2.0...v5.2.1) (2025-12-19) + + +### Bug Fixes + +* Check batch size before re-queueing retried messages ([#2027](https://github.com/googleapis/nodejs-pubsub/issues/2027)) ([6c1613f](https://github.com/googleapis/nodejs-pubsub/commit/6c1613fdc6258ccb85427fc371e7bac8082f4a96)) +* Move off the remaining rc versions ([#2112](https://github.com/googleapis/nodejs-pubsub/issues/2112)) ([a9eb883](https://github.com/googleapis/nodejs-pubsub/commit/a9eb88335df62606ab3e6cbe11c1d760d1ddbc96)) +* Only close the rpcSpan once ([#2121](https://github.com/googleapis/nodejs-pubsub/issues/2121)) ([118a960](https://github.com/googleapis/nodejs-pubsub/commit/118a960b8cfca6203ad1843453c3692b07a94952)) +* Updated span kind to CLIENT for ack and modack rpc spans ([#2029](https://github.com/googleapis/nodejs-pubsub/issues/2029)) ([801c1c8](https://github.com/googleapis/nodejs-pubsub/commit/801c1c862a986eefe1eddd2e014be4612cd394d8)) + +## [5.2.0](https://github.com/googleapis/nodejs-pubsub/compare/v5.1.0...v5.2.0) (2025-08-07) + + +### Features + +* Ad-hoc, targeted debug logging ([#2062](https://github.com/googleapis/nodejs-pubsub/issues/2062)) ([dce83c7](https://github.com/googleapis/nodejs-pubsub/commit/dce83c71bba54388334f4f73115e7b8da6fbdb67)) +* Add timeout option and graceful shutdown to Subscription.close() ([#2068](https://github.com/googleapis/nodejs-pubsub/issues/2068)) ([8dee024](https://github.com/googleapis/nodejs-pubsub/commit/8dee0248081f7156e42d79c6067902583586faf2)) + +## [5.1.0](https://github.com/googleapis/nodejs-pubsub/compare/v5.0.0...v5.1.0) (2025-06-04) + + +### Features + +* Add SchemaViolationReason to IngestionFailureEvent ([#2045](https://github.com/googleapis/nodejs-pubsub/issues/2045)) ([3348e3e](https://github.com/googleapis/nodejs-pubsub/commit/3348e3e6195405608e380e5291e6107bcba855cb)) +* Use specific W3CTraceContextPropagator for OTel ([#2036](https://github.com/googleapis/nodejs-pubsub/issues/2036)) ([c9a9656](https://github.com/googleapis/nodejs-pubsub/commit/c9a9656b8ae4b6e26c0a90c6ea53f5387e1bb846)) + + +### Bug Fixes + +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.33.0 ([#2038](https://github.com/googleapis/nodejs-pubsub/issues/2038)) ([4eb46c5](https://github.com/googleapis/nodejs-pubsub/commit/4eb46c56a941cfb4616785269cc97d9eeca7f174)) +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.34.0 ([#2048](https://github.com/googleapis/nodejs-pubsub/issues/2048)) ([1072c2d](https://github.com/googleapis/nodejs-pubsub/commit/1072c2ddbe2445bac92328e58fbf76e45b464e50)) +* **deps:** Update dependency protobufjs to ~7.5.0 ([#2041](https://github.com/googleapis/nodejs-pubsub/issues/2041)) ([b65eaeb](https://github.com/googleapis/nodejs-pubsub/commit/b65eaebdc54974a81f60f1901e2bd68c2bfd9b92)) +* Set messaging.operation in createAttributes ([#2030](https://github.com/googleapis/nodejs-pubsub/issues/2030)) ([b8d513a](https://github.com/googleapis/nodejs-pubsub/commit/b8d513a3901ae6c160c3f797ed0a41fc0d697fac)) + +## [5.0.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.11.0...v5.0.0) (2025-04-28) + + +### ⚠ BREAKING CHANGES + +* migrate to Node 18 ([#2024](https://github.com/googleapis/nodejs-pubsub/issues/2024)) +* remove (broken) legacy OTel support +* remove legacy ack deadline options +* move maxExtension into subscriber options + +### Miscellaneous Chores + +* Migrate to Node 18 ([#2024](https://github.com/googleapis/nodejs-pubsub/issues/2024)) ([9ad808a](https://github.com/googleapis/nodejs-pubsub/commit/9ad808adb99b6e64c2c4431991721deae14b6400)) + +## [4.11.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.10.0...v4.11.0) (2025-03-27) + + +### Features + +* Add required messaging.operation span attrs for OTel sem convs 1.24 ([#2019](https://github.com/googleapis/nodejs-pubsub/issues/2019)) ([70ed2d7](https://github.com/googleapis/nodejs-pubsub/commit/70ed2d73588290834dd25bfffb201272433e5614)) + + +### Bug Fixes + +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.29.0 ([#2012](https://github.com/googleapis/nodejs-pubsub/issues/2012)) ([bfe8243](https://github.com/googleapis/nodejs-pubsub/commit/bfe82434492a95fc24ee54ff947d0e52d5e93195)) +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.30.0 ([#2014](https://github.com/googleapis/nodejs-pubsub/issues/2014)) ([7f8366a](https://github.com/googleapis/nodejs-pubsub/commit/7f8366a636398d758aec5b2f933607f5021043a7)) +* Type widening to match gapic, and two typing fixes ([#2020](https://github.com/googleapis/nodejs-pubsub/issues/2020)) ([9cd73b3](https://github.com/googleapis/nodejs-pubsub/commit/9cd73b33980b7f02fe507a3a52042112690ab62c)) + +## [4.10.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.9.0...v4.10.0) (2025-01-13) + + +### Features + +* Add Kafka-based sources to IngestionDataSourceSettings proto and IngestionFailureEvent proto ([#2007](https://github.com/googleapis/nodejs-pubsub/issues/2007)) ([08d00a1](https://github.com/googleapis/nodejs-pubsub/commit/08d00a1e7d30e2ab47f7582ff61b1eb73ad9d25e)) + + +### Bug Fixes + +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.28.0 ([#2001](https://github.com/googleapis/nodejs-pubsub/issues/2001)) ([c8e5811](https://github.com/googleapis/nodejs-pubsub/commit/c8e581124523edcac13d6d6c48d67342482959f3)) + +## [4.9.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.8.0...v4.9.0) (2024-11-12) + + +### Features + +* Add IngestionFailureEvent to the external proto ([#1984](https://github.com/googleapis/nodejs-pubsub/issues/1984)) ([7075430](https://github.com/googleapis/nodejs-pubsub/commit/70754309fb600c54d0a573f2d49ad4c419577550)) + + +### Bug Fixes + +* KiB, not MiB for ack size limits ([#1999](https://github.com/googleapis/nodejs-pubsub/issues/1999)) ([798270d](https://github.com/googleapis/nodejs-pubsub/commit/798270db9c5ef71f75c3e24e70d9592bbd068212)) + +## [4.8.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.7.2...v4.8.0) (2024-10-15) + + +### Features + +* Add ingestion Cloud Storage fields and Platform Logging fields to Topic ([#1974](https://github.com/googleapis/nodejs-pubsub/issues/1974)) ([afec9a1](https://github.com/googleapis/nodejs-pubsub/commit/afec9a1ad3f665a71f08e748623f0fdaa332d17b)) +* Return listing information for subscriptions created via Analytics Hub ([afec9a1](https://github.com/googleapis/nodejs-pubsub/commit/afec9a1ad3f665a71f08e748623f0fdaa332d17b)) + +## [4.7.2](https://github.com/googleapis/nodejs-pubsub/compare/v4.7.1...v4.7.2) (2024-09-13) + + +### Bug Fixes + +* Set MaxBytes for AckQueue ([#1963](https://github.com/googleapis/nodejs-pubsub/issues/1963)) ([5945563](https://github.com/googleapis/nodejs-pubsub/commit/594556315f159f4197ffc0e7249ce1b0339c12ec)) + +## [4.7.1](https://github.com/googleapis/nodejs-pubsub/compare/v4.7.0...v4.7.1) (2024-08-26) + + +### Bug Fixes + +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.26.0 ([#1945](https://github.com/googleapis/nodejs-pubsub/issues/1945)) ([f082869](https://github.com/googleapis/nodejs-pubsub/commit/f082869a185c059463654c76c744e44e7b28415e)) +* **deps:** Update dependency protobufjs to ~7.4.0 ([#1959](https://github.com/googleapis/nodejs-pubsub/issues/1959)) ([25946e0](https://github.com/googleapis/nodejs-pubsub/commit/25946e0d4fe794202984cdad6cf48121f72063cf)) +* Propagate set options to LeaseManager (from https://github.com/googleapis/nodejs-pubsub/pull/1880) ([#1954](https://github.com/googleapis/nodejs-pubsub/issues/1954)) ([cdb0916](https://github.com/googleapis/nodejs-pubsub/commit/cdb0916bd30da67f5153c9aead09e7f505954253)) + +## [4.7.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.6.0...v4.7.0) (2024-08-24) + + +### Features + +* Add support for OTel context propagation and harmonized spans ([#1833](https://github.com/googleapis/nodejs-pubsub/issues/1833)) ([4b5c90d](https://github.com/googleapis/nodejs-pubsub/commit/4b5c90dc334e90cefb4da3c6fe9ce027b50aacb8)) + +## [4.6.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.5.0...v4.6.0) (2024-07-12) + + +### Features + +* Add max messages batching for Cloud Storage subscriptions ([#1956](https://github.com/googleapis/nodejs-pubsub/issues/1956)) ([90546f6](https://github.com/googleapis/nodejs-pubsub/commit/90546f634cc4e510185e20a4d1ba1c74ebc59b85)) +* Add use_topic_schema for Cloud Storage Subscriptions ([#1948](https://github.com/googleapis/nodejs-pubsub/issues/1948)) ([120fa1b](https://github.com/googleapis/nodejs-pubsub/commit/120fa1bca0516185e109260c69ea91eb7ddeecd0)) + + +### Bug Fixes + +* **docs samples:** Update missing argv in sample metadata for push subscription ([#1946](https://github.com/googleapis/nodejs-pubsub/issues/1946)) ([34b8c03](https://github.com/googleapis/nodejs-pubsub/commit/34b8c03f90618ba6ae506764b9d97d9db84dcada)) + +## [4.5.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.4.1...v4.5.0) (2024-06-11) + + +### Features + +* Add service_account_email for export subscriptions ([#1927](https://github.com/googleapis/nodejs-pubsub/issues/1927)) ([c532854](https://github.com/googleapis/nodejs-pubsub/commit/c53285473c2c0973baf5932e52d2d135958c6948)) + +## [4.4.1](https://github.com/googleapis/nodejs-pubsub/compare/v4.4.0...v4.4.1) (2024-05-30) + + +### Bug Fixes + +* An existing message `UpdateVehicleLocationRequest` is removed ([5451d15](https://github.com/googleapis/nodejs-pubsub/commit/5451d150e77d46a475e7a8e150a7f6b5d04d6448)) +* An existing method `SearchFuzzedVehicles` is removed from service `VehicleService` ([5451d15](https://github.com/googleapis/nodejs-pubsub/commit/5451d150e77d46a475e7a8e150a7f6b5d04d6448)) +* An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([5451d15](https://github.com/googleapis/nodejs-pubsub/commit/5451d150e77d46a475e7a8e150a7f6b5d04d6448)) +* **deps:** Update dependency protobufjs to ~7.3.0 ([#1921](https://github.com/googleapis/nodejs-pubsub/issues/1921)) ([c5afd34](https://github.com/googleapis/nodejs-pubsub/commit/c5afd3400cc8ff9f920b4b232c4e4a5fb41eb07b)) +* Pull in new gax for protobufjs vuln fix ([#1925](https://github.com/googleapis/nodejs-pubsub/issues/1925)) ([8024c6d](https://github.com/googleapis/nodejs-pubsub/commit/8024c6d2e4ce69f97fd8b64bb9f076e33d47c662)) + +## [4.4.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.3.3...v4.4.0) (2024-05-03) + + +### Features + +* Add several fields to manage state of database encryption update ([#1904](https://github.com/googleapis/nodejs-pubsub/issues/1904)) ([aba9aee](https://github.com/googleapis/nodejs-pubsub/commit/aba9aee0c8ecc840c150aa077892b7bb88f18eca)) + + +### Bug Fixes + +* **deps:** Update dependency @types/long to v5 ([#1901](https://github.com/googleapis/nodejs-pubsub/issues/1901)) ([d13d395](https://github.com/googleapis/nodejs-pubsub/commit/d13d395341efacf926a126bf756873922f6bbab7)) + +## [4.3.3](https://github.com/googleapis/nodejs-pubsub/compare/v4.3.2...v4.3.3) (2024-03-03) + + +### Bug Fixes + +* Add client library version to headers ([#1891](https://github.com/googleapis/nodejs-pubsub/issues/1891)) ([6b59195](https://github.com/googleapis/nodejs-pubsub/commit/6b59195aed8b6c6576e50512aeca9123ad0cc016)) + +## [4.3.2](https://github.com/googleapis/nodejs-pubsub/compare/v4.3.1...v4.3.2) (2024-02-13) + + +### Bug Fixes + +* Update minimum google-gax versions for auth fixes ([#1888](https://github.com/googleapis/nodejs-pubsub/issues/1888)) ([08acade](https://github.com/googleapis/nodejs-pubsub/commit/08acadee042c6a3b85344575d5d0be09ae6e4202)) + +## [4.3.1](https://github.com/googleapis/nodejs-pubsub/compare/v4.3.0...v4.3.1) (2024-02-08) + + +### Bug Fixes + +* Add option to manually control emulator auth handling, and fix heuristics for TPC ([#1861](https://github.com/googleapis/nodejs-pubsub/issues/1861)) ([761cdc8](https://github.com/googleapis/nodejs-pubsub/commit/761cdc898c69715e6775d2f5913ead1fca2def02)) + +## [4.3.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.2.0...v4.3.0) (2024-02-05) + + +### Features + +* Trusted Private Cloud support, use the universeDomain parameter ([#1878](https://github.com/googleapis/nodejs-pubsub/issues/1878)) ([d89fd1d](https://github.com/googleapis/nodejs-pubsub/commit/d89fd1d90b352f0cc7a50a72c5fec4aab6660f8f)) + + +### Bug Fixes + +* Updated google-gax required for TPC ([#1882](https://github.com/googleapis/nodejs-pubsub/issues/1882)) ([1445856](https://github.com/googleapis/nodejs-pubsub/commit/144585699595b97f1a4cc28551e45fe23305f480)) + +## [4.2.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.1.1...v4.2.0) (2024-02-01) + + +### Features + +* Add enforce_in_transit fields and optional annotations ([#1873](https://github.com/googleapis/nodejs-pubsub/issues/1873)) ([09fc424](https://github.com/googleapis/nodejs-pubsub/commit/09fc4241c8782d2f60c1a78dda316628eca5f751)) +* Add schema revision samples ([#1870](https://github.com/googleapis/nodejs-pubsub/issues/1870)) ([044e149](https://github.com/googleapis/nodejs-pubsub/commit/044e1494d82fd64010f7c6f872982d659e753499)) + + +### Bug Fixes + +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.20.0 ([#1871](https://github.com/googleapis/nodejs-pubsub/issues/1871)) ([2ee0dba](https://github.com/googleapis/nodejs-pubsub/commit/2ee0dba67e6d66d9a678796de6172bcafd28796b)) +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.21.0 ([#1876](https://github.com/googleapis/nodejs-pubsub/issues/1876)) ([0fe61a9](https://github.com/googleapis/nodejs-pubsub/commit/0fe61a95b3bfc21bd1a5176c7fbd7f822ece5a5c)) + +## [4.1.1](https://github.com/googleapis/nodejs-pubsub/compare/v4.1.0...v4.1.1) (2024-01-05) + + +### Bug Fixes + +* Correct long audio synthesis HTTP binding ([#1867](https://github.com/googleapis/nodejs-pubsub/issues/1867)) ([65940a4](https://github.com/googleapis/nodejs-pubsub/commit/65940a40fe8f2301690d26f769571a198f747dd3)) +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.19.0 ([#1862](https://github.com/googleapis/nodejs-pubsub/issues/1862)) ([92259f5](https://github.com/googleapis/nodejs-pubsub/commit/92259f5bffee05036f1746990b021299ea3ea4e7)) + +## [4.1.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.7...v4.1.0) (2023-12-04) + + +### Features + +* Add `use_table_schema` field to BigQueryConfig ([#1858](https://github.com/googleapis/nodejs-pubsub/issues/1858)) ([2875d83](https://github.com/googleapis/nodejs-pubsub/commit/2875d8383831563e5b748e96094faa94bf25fc15)) + +## [4.0.7](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.6...v4.0.7) (2023-11-09) + + +### Bug Fixes + +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.18.0 ([#1852](https://github.com/googleapis/nodejs-pubsub/issues/1852)) ([d9a0432](https://github.com/googleapis/nodejs-pubsub/commit/d9a0432a37c6d741c9694a5bcff047f4c85b2feb)) +* Set x-goog-request-params for streaming pull request ([#1849](https://github.com/googleapis/nodejs-pubsub/issues/1849)) ([7b82ff0](https://github.com/googleapis/nodejs-pubsub/commit/7b82ff01e5c654b3e339dfdec5b3da8bf45da049)) + +## [4.0.6](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.5...v4.0.6) (2023-09-15) + + +### Bug Fixes + +* Bump the minimum gax up to 4.0.4 to get grpc-js fixes ([#1829](https://github.com/googleapis/nodejs-pubsub/issues/1829)) ([cc86e2b](https://github.com/googleapis/nodejs-pubsub/commit/cc86e2b4f3593d3d6046dc5baee76e1431832acb)) +* **deps:** Update dependency @opentelemetry/semantic-conventions to ~1.17.0 ([#1824](https://github.com/googleapis/nodejs-pubsub/issues/1824)) ([679c6b8](https://github.com/googleapis/nodejs-pubsub/commit/679c6b82bdb6fe28c3bc8c31db2e10de1ee7e089)) + +## [4.0.5](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.4...v4.0.5) (2023-09-07) + + +### Bug Fixes + +* Always fill the topic and sub names when creating from a PubSub object ([#1816](https://github.com/googleapis/nodejs-pubsub/issues/1816)) ([be8ed53](https://github.com/googleapis/nodejs-pubsub/commit/be8ed530e327e2bd08a49200492f0a163b3b91d7)) + +## [4.0.4](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.3...v4.0.4) (2023-09-05) + + +### Bug Fixes + +* Set grpc keepalive time|outs by default ([#1814](https://github.com/googleapis/nodejs-pubsub/issues/1814)) ([13d89a2](https://github.com/googleapis/nodejs-pubsub/commit/13d89a2b4e25f340ef492d586bfa8cc3a9a6d6cf)) + +## [4.0.3](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.2...v4.0.3) (2023-08-31) + + +### Bug Fixes + +* Simplify logic for HTTP/1.1 REST fallback option ([#1809](https://github.com/googleapis/nodejs-pubsub/issues/1809)) ([f26008d](https://github.com/googleapis/nodejs-pubsub/commit/f26008de84f201ec6e0180582d8a4bebc3d5ced0)) + +## [4.0.2](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.1...v4.0.2) (2023-08-24) + + +### Bug Fixes + +* Make retry policy back off more aggressively for RPCs that retry RESOURCE_EXHAUSTD ([#1806](https://github.com/googleapis/nodejs-pubsub/issues/1806)) ([e9969ba](https://github.com/googleapis/nodejs-pubsub/commit/e9969bab92c38f1509b157034fcdbe5d5ec63903)) + +## [4.0.1](https://github.com/googleapis/nodejs-pubsub/compare/v4.0.0...v4.0.1) (2023-08-11) + + +### Bug Fixes + +* **deps:** Update dependency @google-cloud/paginator to v5 ([#1799](https://github.com/googleapis/nodejs-pubsub/issues/1799)) ([3195d21](https://github.com/googleapis/nodejs-pubsub/commit/3195d21bf817cf10daa86b019532c9405dc42405)) +* **deps:** Update dependency @google-cloud/precise-date to v4 ([#1803](https://github.com/googleapis/nodejs-pubsub/issues/1803)) ([2c22d67](https://github.com/googleapis/nodejs-pubsub/commit/2c22d67b0fbaf3409101a830ee0c5be002ed6c7b)) +* **deps:** Update dependency @google-cloud/projectify to v4 ([#1800](https://github.com/googleapis/nodejs-pubsub/issues/1800)) ([5787d56](https://github.com/googleapis/nodejs-pubsub/commit/5787d56b95d46544bf8c59fe4bc4cb374bc53d0a)) +* **deps:** Update dependency @google-cloud/promisify to v4 ([#1798](https://github.com/googleapis/nodejs-pubsub/issues/1798)) ([093c46b](https://github.com/googleapis/nodejs-pubsub/commit/093c46bd0a4713ad9702bde03eaa5e8b0acedb28)) + +## [4.0.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.7.3...v4.0.0) (2023-08-03) + + +### ⚠ BREAKING CHANGES + +* node 12 eos ([#1774](https://github.com/googleapis/nodejs-pubsub/issues/1774)) (#1784) + +### Features + +* Node 12 eos ([#1774](https://github.com/googleapis/nodejs-pubsub/issues/1774)) ([#1784](https://github.com/googleapis/nodejs-pubsub/issues/1784)) ([47b83c1](https://github.com/googleapis/nodejs-pubsub/commit/47b83c18c543a7c8763256f79927a7340db56568)) + + +### Bug Fixes + +* Fix typings for IAM methods ([#1785](https://github.com/googleapis/nodejs-pubsub/issues/1785)) ([9a6bdbc](https://github.com/googleapis/nodejs-pubsub/commit/9a6bdbce952c81cb1a43fecbce16a3e3ab0f1420)) + +## [3.7.3](https://github.com/googleapis/nodejs-pubsub/compare/v3.7.2...v3.7.3) (2023-07-26) + + +### Bug Fixes + +* Update masks for topic should be snake case ([#1778](https://github.com/googleapis/nodejs-pubsub/issues/1778)) ([ba72638](https://github.com/googleapis/nodejs-pubsub/commit/ba7263836e6951454f77f631c9d2eb0a4df98da5)) + +## [3.7.2](https://github.com/googleapis/nodejs-pubsub/compare/v3.7.1...v3.7.2) (2023-07-24) + + +### Bug Fixes + +* Update to gax 3.6.1 for vuln fix ([#1775](https://github.com/googleapis/nodejs-pubsub/issues/1775)) ([98460db](https://github.com/googleapis/nodejs-pubsub/commit/98460dbd1f31e4ee06356e88fec676a04a68ac88)) + +## [3.7.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.7.0...v3.7.1) (2023-06-08) + + +### Bug Fixes + +* Don't crash if an already-drained/removed queue gets flushed again ([#1747](https://github.com/googleapis/nodejs-pubsub/issues/1747)) ([52ea441](https://github.com/googleapis/nodejs-pubsub/commit/52ea441fee302aa6c400b58d4ecebbc96a2ea5ea)) + +## [3.7.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.6.0...v3.7.0) (2023-05-26) + + +### Features + +* Add push config wrapper fields ([#1730](https://github.com/googleapis/nodejs-pubsub/issues/1730)) ([a552719](https://github.com/googleapis/nodejs-pubsub/commit/a552719dfebda4c1263c352ea99bf8f9570290b7)) + +## [3.6.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.5.2...v3.6.0) (2023-05-12) + + +### Features + +* Add cloud storage subscription fields ([#1724](https://github.com/googleapis/nodejs-pubsub/issues/1724)) ([f61a64a](https://github.com/googleapis/nodejs-pubsub/commit/f61a64a2daffdfbf4c7b18d50434899c572d108c)) + +## [3.5.2](https://github.com/googleapis/nodejs-pubsub/compare/v3.5.1...v3.5.2) (2023-04-26) + + +### Bug Fixes + +* Avoid zalgo when calling down to publish messages ([#1710](https://github.com/googleapis/nodejs-pubsub/issues/1710)) ([dedae1e](https://github.com/googleapis/nodejs-pubsub/commit/dedae1e46cb3214abc33578a878a2298cdae6cac)) + +## [3.5.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.5.0...v3.5.1) (2023-04-20) + + +### Bug Fixes + +* Handle receipt modAck and lease extensions with exactly-once delivery correctly ([#1709](https://github.com/googleapis/nodejs-pubsub/issues/1709)) ([d786d22](https://github.com/googleapis/nodejs-pubsub/commit/d786d22bfec61b91891e5049f1b5ae2d9a81d788)) + +## [3.5.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.4.1...v3.5.0) (2023-04-16) + + +### Features + +* Rework low level message stream retries, add debugging ([#1713](https://github.com/googleapis/nodejs-pubsub/issues/1713)) ([c1cc6e0](https://github.com/googleapis/nodejs-pubsub/commit/c1cc6e043ab2e532f9c8c9f9158c46e9a424d3dd)) + +## [3.4.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.4.0...v3.4.1) (2023-03-08) + + +### Bug Fixes + +* Update minimum google-gax to avoid taffydb vulnerabilities ([#1695](https://github.com/googleapis/nodejs-pubsub/issues/1695)) ([11372e6](https://github.com/googleapis/nodejs-pubsub/commit/11372e6d40577704a8a22b6c010623be7e36b34a)) + +## [3.4.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.3.0...v3.4.0) (2023-03-06) + + +### Features + +* Add google.api.method.signature to update methods ([1e28405](https://github.com/googleapis/nodejs-pubsub/commit/1e2840529a8451c94d5d845062da84729b7843db)) +* Add temporary_failed_ack_ids to ModifyAckDeadlineConfirmation ([1e28405](https://github.com/googleapis/nodejs-pubsub/commit/1e2840529a8451c94d5d845062da84729b7843db)) +* Make INTERNAL a retryable error for Pull ([#1681](https://github.com/googleapis/nodejs-pubsub/issues/1681)) ([1e28405](https://github.com/googleapis/nodejs-pubsub/commit/1e2840529a8451c94d5d845062da84729b7843db)) + + +### Bug Fixes + +* Don't do multiple drains per publish() in message queues unless requested ([#1691](https://github.com/googleapis/nodejs-pubsub/issues/1691)) ([d9b3a63](https://github.com/googleapis/nodejs-pubsub/commit/d9b3a63ddbfec0581a0e05fdbfcf9e9326b3dcf9)) + +## [3.3.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.2.1...v3.3.0) (2023-01-23) + + +### Features + +* Add schema evolution methods and fields ([#1672](https://github.com/googleapis/nodejs-pubsub/issues/1672)) ([7a5bc29](https://github.com/googleapis/nodejs-pubsub/commit/7a5bc29e8a39e5c1991a5eae4200a5045f21997d)) + + +### Bug Fixes + +* Remove redundant .then() ([#1671](https://github.com/googleapis/nodejs-pubsub/issues/1671)) ([108edc3](https://github.com/googleapis/nodejs-pubsub/commit/108edc3cd2d3d512e2a9777a68541dae1f6aba23)) + +## [3.2.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.2.0...v3.2.1) (2022-11-04) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#1652](https://github.com/googleapis/nodejs-pubsub/issues/1652)) ([ee308b5](https://github.com/googleapis/nodejs-pubsub/commit/ee308b596802ad5537a89804a95429d630595eb4)) + +## [3.2.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.1.1...v3.2.0) (2022-09-22) + + +### Features + +* Add support for exactly once subscriptions ([#1572](https://github.com/googleapis/nodejs-pubsub/issues/1572)) ([998de35](https://github.com/googleapis/nodejs-pubsub/commit/998de35d4bffde4fcffd217347307c04031df3e2)) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#1622](https://github.com/googleapis/nodejs-pubsub/issues/1622)) ([76c0ab5](https://github.com/googleapis/nodejs-pubsub/commit/76c0ab55ecfcf0cee5fad1314ecf2317d471c13a)) +* Wait for 'drain' as well ([#1636](https://github.com/googleapis/nodejs-pubsub/issues/1636)) ([d72db50](https://github.com/googleapis/nodejs-pubsub/commit/d72db503bfa3b9b6d7481ce44eb161a031f76715)) + +## [3.1.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.1.0...v3.1.1) (2022-09-01) + + +### Bug Fixes + +* Add hashes to requirements.txt ([#1544](https://github.com/googleapis/nodejs-pubsub/issues/1544)) ([#1614](https://github.com/googleapis/nodejs-pubsub/issues/1614)) ([359d098](https://github.com/googleapis/nodejs-pubsub/commit/359d098b60422b37230024128ed10f04018670a0)) +* Allow passing gax instance to client constructor ([#1617](https://github.com/googleapis/nodejs-pubsub/issues/1617)) ([8eabe38](https://github.com/googleapis/nodejs-pubsub/commit/8eabe3802bbc50309f3d6a0b9997752ab7f367e1)) +* Better support for fallback mode ([#1610](https://github.com/googleapis/nodejs-pubsub/issues/1610)) ([d9e7311](https://github.com/googleapis/nodejs-pubsub/commit/d9e7311d6f6bb78bb3f06454a7ce3cf02fff314c)) +* Change import long to require ([#1611](https://github.com/googleapis/nodejs-pubsub/issues/1611)) ([5553af2](https://github.com/googleapis/nodejs-pubsub/commit/5553af2684ba87ed361d9d79bf2e2a6d7cd3763c)) +* **deps:** Update dependency protobufjs to v7 ([#1602](https://github.com/googleapis/nodejs-pubsub/issues/1602)) ([6e0ec60](https://github.com/googleapis/nodejs-pubsub/commit/6e0ec60a8f6efc7d8e7b67c431dddd7073895ae6)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-pubsub/issues/1553)) ([#1616](https://github.com/googleapis/nodejs-pubsub/issues/1616)) ([31c7fa2](https://github.com/googleapis/nodejs-pubsub/commit/31c7fa234ca3d0455979065199d0da1599ed216b)) + +## [3.1.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.0.3...v3.1.0) (2022-07-15) + + +### Features + +* add minExtension setting and plug it into EOS and ackDeadline settings ([#1582](https://github.com/googleapis/nodejs-pubsub/issues/1582)) ([8709979](https://github.com/googleapis/nodejs-pubsub/commit/87099799960b9f299d3fad609c48bd13e03c9097)) + +## [3.0.3](https://github.com/googleapis/nodejs-pubsub/compare/v3.0.2...v3.0.3) (2022-07-08) + + +### Bug Fixes + +* pin @opentelemetry/semantic-conventions for Node 12 support ([#1596](https://github.com/googleapis/nodejs-pubsub/issues/1596)) ([f594061](https://github.com/googleapis/nodejs-pubsub/commit/f5940613f53c3647ab9941adfd8442f2bc0bb857)) + +## [3.0.2](https://github.com/googleapis/nodejs-pubsub/compare/v3.0.1...v3.0.2) (2022-06-30) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/precise-date to v3 ([#1576](https://github.com/googleapis/nodejs-pubsub/issues/1576)) ([69a5461](https://github.com/googleapis/nodejs-pubsub/commit/69a546160284c290e7025bfe6a307d7309b828c9)) +* **deps:** update dependency @google-cloud/projectify to v3 ([#1584](https://github.com/googleapis/nodejs-pubsub/issues/1584)) ([af4b13e](https://github.com/googleapis/nodejs-pubsub/commit/af4b13e162a8ad9a1c0d5c117afe784ea5824753)) +* **docs:** describe fallback rest option ([#1591](https://github.com/googleapis/nodejs-pubsub/issues/1591)) ([7c08686](https://github.com/googleapis/nodejs-pubsub/commit/7c08686b4ad5a44f4b4a294c96b06e3901dd7368)) + +## [3.0.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.0.0...v3.0.1) (2022-05-30) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v4 ([#1565](https://github.com/googleapis/nodejs-pubsub/issues/1565)) ([461b58b](https://github.com/googleapis/nodejs-pubsub/commit/461b58b0f4e436bf771be9655c12dd094cde60cc)) +* detect subscription properties and warn for exactly-once ([#1561](https://github.com/googleapis/nodejs-pubsub/issues/1561)) ([98cf540](https://github.com/googleapis/nodejs-pubsub/commit/98cf5400ca2e67894d7cf3ed37bcdd72869e691e)) + +## [3.0.0](https://github.com/googleapis/nodejs-pubsub/compare/v2.19.4...v3.0.0) (2022-05-26) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#1564) + +### Features + +* add BigQuery configuration for subscriptions ([#1563](https://github.com/googleapis/nodejs-pubsub/issues/1563)) ([29d38a1](https://github.com/googleapis/nodejs-pubsub/commit/29d38a17663adcd02252a5b6c778d053208de12f)) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v2.30.4 ([#1555](https://github.com/googleapis/nodejs-pubsub/issues/1555)) ([518fce1](https://github.com/googleapis/nodejs-pubsub/commit/518fce1adbdaae492a1d6db38daadb2be9c0a505)) +* fixes for dynamic routing and streaming descriptors ([#1566](https://github.com/googleapis/nodejs-pubsub/issues/1566)) ([158c606](https://github.com/googleapis/nodejs-pubsub/commit/158c606a88077a59ac04d4abcce7c732120c4ebb)) + + +### Build System + +* update library to use Node 12 ([#1564](https://github.com/googleapis/nodejs-pubsub/issues/1564)) ([adb4319](https://github.com/googleapis/nodejs-pubsub/commit/adb43190247a6282fc2abdcf75d7b07fe3fdc1dc)) + +### [2.19.4](https://github.com/googleapis/nodejs-pubsub/compare/v2.19.3...v2.19.4) (2022-05-05) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v2.30.3 ([#1549](https://github.com/googleapis/nodejs-pubsub/issues/1549)) ([5810331](https://github.com/googleapis/nodejs-pubsub/commit/581033199dfe2a80a83b472bc77b1d7eab53b62d)) + +### [2.19.3](https://github.com/googleapis/nodejs-pubsub/compare/v2.19.2...v2.19.3) (2022-04-26) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v2.30.2 ([#1502](https://github.com/googleapis/nodejs-pubsub/issues/1502)) ([37d075e](https://github.com/googleapis/nodejs-pubsub/commit/37d075e6ae4e588155a9f0c0506b9a497be6bf06)) + +### [2.19.2](https://github.com/googleapis/nodejs-pubsub/compare/v2.19.1...v2.19.2) (2022-04-21) + + +### Bug Fixes + +* fix flaky schema and subscription tests ([#1518](https://github.com/googleapis/nodejs-pubsub/issues/1518)) ([5ff0105](https://github.com/googleapis/nodejs-pubsub/commit/5ff0105cf84751beb6f06343aaf5228157faae4d)) + +### [2.19.1](https://github.com/googleapis/nodejs-pubsub/compare/v2.19.0...v2.19.1) (2022-04-06) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v2.29.7 ([#1493](https://github.com/googleapis/nodejs-pubsub/issues/1493)) ([c8921a7](https://github.com/googleapis/nodejs-pubsub/commit/c8921a7af9205c15c5485f3a3d1c607483a69de4)) +* **deps:** update dependency google-gax to v2.30.0 ([#1496](https://github.com/googleapis/nodejs-pubsub/issues/1496)) ([073a1b8](https://github.com/googleapis/nodejs-pubsub/commit/073a1b86ab516ad78985ce3d09ff16cbdf56151e)) +* update grpc.max_metadata_size to 4MiB for exactly-once, and shift ack/modack errors to 'debug' stream channel ([#1505](https://github.com/googleapis/nodejs-pubsub/issues/1505)) ([abd10cc](https://github.com/googleapis/nodejs-pubsub/commit/abd10cc0c9956256bd06e5b48a412ec0af6dd086)) + +## [2.19.0](https://github.com/googleapis/nodejs-pubsub/compare/v2.18.5...v2.19.0) (2022-02-16) + + +### Features + +* add exactly once delivery flag ([#1487](https://github.com/googleapis/nodejs-pubsub/issues/1487)) ([330061c](https://github.com/googleapis/nodejs-pubsub/commit/330061c71e26753b86c637a525742b4f5cb3f02c)) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v2.29.5 ([#1474](https://github.com/googleapis/nodejs-pubsub/issues/1474)) ([f855db3](https://github.com/googleapis/nodejs-pubsub/commit/f855db312bcc0e9e885fa391f42b2509ceffc13f)) +* **deps:** update dependency google-gax to v2.29.6 ([#1489](https://github.com/googleapis/nodejs-pubsub/issues/1489)) ([62aba28](https://github.com/googleapis/nodejs-pubsub/commit/62aba28ddb191091bc80e9a244b561cedc92f4fe)) +* removing misspelled field, add correctly spelled field 🦉 Updates from OwlBot ([#1490](https://github.com/googleapis/nodejs-pubsub/issues/1490)) ([afb9cfe](https://github.com/googleapis/nodejs-pubsub/commit/afb9cfec83524c84d8e207e2b6298996df282a66)) + +### [2.18.5](https://github.com/googleapis/nodejs-pubsub/compare/v2.18.4...v2.18.5) (2022-01-21) + + +### Bug Fixes + +* **deps:** update dependency @opentelemetry/semantic-conventions to v1 ([#1407](https://github.com/googleapis/nodejs-pubsub/issues/1407)) ([740d78c](https://github.com/googleapis/nodejs-pubsub/commit/740d78cb285a136a39d7324c9f0e2e0d7fc1f06d)) +* **deps:** update dependency google-gax to v2.29.0 ([#1452](https://github.com/googleapis/nodejs-pubsub/issues/1452)) ([f419137](https://github.com/googleapis/nodejs-pubsub/commit/f4191372eabc134454db7d24cb38a29597b153dd)) +* **deps:** update dependency google-gax to v2.29.4 ([#1469](https://github.com/googleapis/nodejs-pubsub/issues/1469)) ([8abbfa7](https://github.com/googleapis/nodejs-pubsub/commit/8abbfa77ce9c6e6decbd79c29bcaad8e5e3e1ed6)) +* update to work with latest node types (changed the return type of Stream.destroy()) ([#1464](https://github.com/googleapis/nodejs-pubsub/issues/1464)) ([fddc2e7](https://github.com/googleapis/nodejs-pubsub/commit/fddc2e77ed54c1762afb533965da2e0658b58de6)) + +### [2.18.4](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.3...v2.18.4) (2021-12-09) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v2.28.1 ([#1432](https://www.github.com/googleapis/nodejs-pubsub/issues/1432)) ([98840fc](https://www.github.com/googleapis/nodejs-pubsub/commit/98840fcc38a05be07de6e7dc97d8a79616940df9)) + +### [2.18.3](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.2...v2.18.3) (2021-11-18) + + +### Bug Fixes + +* set only Publish to 5000ms ([#1416](https://www.github.com/googleapis/nodejs-pubsub/issues/1416)) ([1e11001](https://www.github.com/googleapis/nodejs-pubsub/commit/1e110016ea04fc41d2fa80d64a54a11fd4078c60)) +* temporary hold-back on google-gax to avoid timeout issues caused by https://github.com/googleapis/gax-nodejs/pull/1100 ([#1431](https://www.github.com/googleapis/nodejs-pubsub/issues/1431)) ([18c6b18](https://www.github.com/googleapis/nodejs-pubsub/commit/18c6b18f621c410aca968a6bfc850e7a6ea404f4)) + +### [2.18.2](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.1...v2.18.2) (2021-11-08) + + +### Bug Fixes + +* **cloud-rad:** move comments for TSDoc ([#1423](https://www.github.com/googleapis/nodejs-pubsub/issues/1423)) ([a40a23e](https://www.github.com/googleapis/nodejs-pubsub/commit/a40a23ee43c6697000996e0ff7070f41610397f5)) + +### [2.18.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.0...v2.18.1) (2021-09-27) + + +### Bug Fixes + +* deprecate maxExtension in favour of maxExtensionMinutes ([#1402](https://www.github.com/googleapis/nodejs-pubsub/issues/1402)) ([46b83ba](https://www.github.com/googleapis/nodejs-pubsub/commit/46b83ba14e954cc6bec3f03ca7c3e0bcdfb7597c)) + +## [2.18.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.17.0...v2.18.0) (2021-09-23) + + +### Features + +* add publisher side flow control ([#1359](https://www.github.com/googleapis/nodejs-pubsub/issues/1359)) ([cc0f61b](https://www.github.com/googleapis/nodejs-pubsub/commit/cc0f61b18258bae0be1a5962a93970cc15dcd304)) + + +### Bug Fixes + +* update default RPC retry timeouts to match other languages ([#1399](https://www.github.com/googleapis/nodejs-pubsub/issues/1399)) ([8c1afee](https://www.github.com/googleapis/nodejs-pubsub/commit/8c1afeee26fbff84448b1a9576e4c4ef5c67f9cc)) + +## [2.17.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.6...v2.17.0) (2021-08-25) + + +### Features + +* turns on self-signed JWT feature flag ([#1382](https://www.github.com/googleapis/nodejs-pubsub/issues/1382)) ([e8b4922](https://www.github.com/googleapis/nodejs-pubsub/commit/e8b49228cffd8016be12ab607363136c2f27c593)) + + +### Bug Fixes + +* **build:** move branch references to main ([#1174](https://www.github.com/googleapis/nodejs-pubsub/issues/1174)) ([#1386](https://www.github.com/googleapis/nodejs-pubsub/issues/1386)) ([16b710a](https://www.github.com/googleapis/nodejs-pubsub/commit/16b710aae29575b9108215479080a8d6c3dad654)) + +### [2.16.6](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.5...v2.16.6) (2021-08-19) + + +### Bug Fixes + +* don't require a `data` attribute to be passed when sending a message ([#1370](https://www.github.com/googleapis/nodejs-pubsub/issues/1370)) ([97fd4f0](https://www.github.com/googleapis/nodejs-pubsub/commit/97fd4f041c195e0388b0613b2cf9710b89ab4e15)) + +### [2.16.5](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.4...v2.16.5) (2021-08-18) + + +### Bug Fixes + +* export publish and subscribe options ([#1371](https://www.github.com/googleapis/nodejs-pubsub/issues/1371)) ([c37e0fd](https://www.github.com/googleapis/nodejs-pubsub/commit/c37e0fd5ee8864597241623e19ec495b5b99d5c3)) + +### [2.16.4](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.3...v2.16.4) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#1377](https://www.github.com/googleapis/nodejs-pubsub/issues/1377)) ([16a1eff](https://www.github.com/googleapis/nodejs-pubsub/commit/16a1eff34897567efa5f2116562e36325edce019)) + +### [2.16.3](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.2...v2.16.3) (2021-08-11) + + +### Bug Fixes + +* **pubsub:** replace IAMPolicy in API config ([#1373](https://www.github.com/googleapis/nodejs-pubsub/issues/1373)) ([435a181](https://www.github.com/googleapis/nodejs-pubsub/commit/435a18110fdefb6964b331047a9ac536d758d1d3)) + +### [2.16.2](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.1...v2.16.2) (2021-08-11) + + +### Bug Fixes + +* **deps:** update opentelemetry monorepo to ^0.24.0 ([#1349](https://www.github.com/googleapis/nodejs-pubsub/issues/1349)) ([cf0d24a](https://www.github.com/googleapis/nodejs-pubsub/commit/cf0d24a9ff090f6f3f235d8d474d75cd9599c49e)) + +### [2.16.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.0...v2.16.1) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#1354](https://www.github.com/googleapis/nodejs-pubsub/issues/1354)) ([7288e2e](https://www.github.com/googleapis/nodejs-pubsub/commit/7288e2e06b15bede3e06002a8a3dec2699312aa2)) + +## [2.16.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.15.1...v2.16.0) (2021-07-12) + + +### Features + +* Add method signature for Subscriber.Pull without the deprecated return_immediately field. ([#1350](https://www.github.com/googleapis/nodejs-pubsub/issues/1350)) ([a7922fb](https://www.github.com/googleapis/nodejs-pubsub/commit/a7922fb345337d750789d1b672521c8440472cea)) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#1344](https://www.github.com/googleapis/nodejs-pubsub/issues/1344)) ([0cd0a8c](https://www.github.com/googleapis/nodejs-pubsub/commit/0cd0a8c8c79e3ca7dfe1e2d1bf2a2f8894ba4680)) +* **deps:** google-gax v2.17.1 ([#1353](https://www.github.com/googleapis/nodejs-pubsub/issues/1353)) ([d5bf563](https://www.github.com/googleapis/nodejs-pubsub/commit/d5bf56325374c5509c6b65c953b41c15533a2a0a)) + +### [2.15.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.15.0...v2.15.1) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#1328](https://www.github.com/googleapis/nodejs-pubsub/issues/1328)) ([fa74fa1](https://www.github.com/googleapis/nodejs-pubsub/commit/fa74fa16c76f6b25ee1648ee51c397ccf01f71a4)) + +## [2.15.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.14.0...v2.15.0) (2021-06-22) + + +### Features + +* upgrade the opentelemetry api to 1.0.0 ([#1329](https://www.github.com/googleapis/nodejs-pubsub/issues/1329)) ([6896ad9](https://www.github.com/googleapis/nodejs-pubsub/commit/6896ad9d73c6d481c02af503b0e9e5a211bdbdf1)) + + +### Bug Fixes + +* **deps:** update opentelemetry monorepo to ^0.21.0 ([#1324](https://www.github.com/googleapis/nodejs-pubsub/issues/1324)) ([c6d1750](https://www.github.com/googleapis/nodejs-pubsub/commit/c6d1750de45bbad0f599d328c37085f1f4246f9b)) + +## [2.14.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.13.0...v2.14.0) (2021-06-11) + + +### Features + +* upgrade @opentelemetry/api to version 0.20.0 ([#1305](https://www.github.com/googleapis/nodejs-pubsub/issues/1305)) ([ed32369](https://www.github.com/googleapis/nodejs-pubsub/commit/ed32369ab4ccee5a8919f7353ed9eed7f3c1f6d8)) + +## [2.13.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.12.0...v2.13.0) (2021-06-10) + + +### Features + +* expose list/get options for full/basic on schema methods ([#1291](https://www.github.com/googleapis/nodejs-pubsub/issues/1291)) ([11f9612](https://www.github.com/googleapis/nodejs-pubsub/commit/11f961268429bb691be226aaffae6a88eeb9c600)) +* schema library support ([#1289](https://www.github.com/googleapis/nodejs-pubsub/issues/1289)) ([fd275e2](https://www.github.com/googleapis/nodejs-pubsub/commit/fd275e23fec89e6368a47caa1fdc194cbfc5d32b)) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#1299](https://www.github.com/googleapis/nodejs-pubsub/issues/1299)) ([43a8fdb](https://www.github.com/googleapis/nodejs-pubsub/commit/43a8fdbbe2db24556101fb4e0bb29b3d95112ba0)) + +## [2.12.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.11.0...v2.12.0) (2021-05-11) + + +### Features + +* update publisher options all the way through the topic object tree ([#1279](https://www.github.com/googleapis/nodejs-pubsub/issues/1279)) ([70402ac](https://www.github.com/googleapis/nodejs-pubsub/commit/70402ac0f6dc905febecae8f4d3dfa8cc93e7c08)) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#1282](https://www.github.com/googleapis/nodejs-pubsub/issues/1282)) ([3dee854](https://www.github.com/googleapis/nodejs-pubsub/commit/3dee8548c2111f512b3afc2ffa3041934fee76ff)) +* use require to load proto JSON ([#1283](https://www.github.com/googleapis/nodejs-pubsub/issues/1283)) ([201a56c](https://www.github.com/googleapis/nodejs-pubsub/commit/201a56c4c7c7115cd3a7c8cff864d83223082d12)) + +## [2.11.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.10.0...v2.11.0) (2021-04-14) + + +### ⚠ BREAKING CHANGES + +* `fix: added support for Opentelemetry 0.18` - makes significant changes to OpenTelemetry support in order to unblock its usage again; the main user-visible change is that you will need to use 0.18+ versions of OpenTelemetry, and different items are passed to the server in spans. + +### Bug Fixes + +* added support for Opentelemetry 0.18 ([#1234](https://www.github.com/googleapis/nodejs-pubsub/issues/1234)) ([aedc36c](https://www.github.com/googleapis/nodejs-pubsub/commit/aedc36c3f8736eff1cb781b9e05457463481b3d6)) +* follow-on proto updates from the removal of the common protos ([#1229](https://www.github.com/googleapis/nodejs-pubsub/issues/1229)) ([cb627d5](https://www.github.com/googleapis/nodejs-pubsub/commit/cb627d5555c617eb025181c9f9aaf1d2c9621a86)) +* prevent attempt to publish 0 messages ([#1218](https://www.github.com/googleapis/nodejs-pubsub/issues/1218)) ([96e6535](https://www.github.com/googleapis/nodejs-pubsub/commit/96e653514b35d61f74ba2d5d6fa96e19bc45bf8c)) +* remove common protos ([#1232](https://www.github.com/googleapis/nodejs-pubsub/issues/1232)) ([8838288](https://www.github.com/googleapis/nodejs-pubsub/commit/883828800c94f7ea21c8306d272b70b4576c664c)) +* reverting the major from the OpenTelemetry change (it was already broken) ([#1257](https://www.github.com/googleapis/nodejs-pubsub/issues/1257)) ([09c428a](https://www.github.com/googleapis/nodejs-pubsub/commit/09c428a17eb20fcd0fc45301addb48d2bebc56a3)) +* temporarily pin sinon at 10.0.0 ([#1252](https://www.github.com/googleapis/nodejs-pubsub/issues/1252)) ([0922164](https://www.github.com/googleapis/nodejs-pubsub/commit/09221643be0693463ed4e5d56efd0f1ebfbe78b7)) + +## [2.10.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.9.0...v2.10.0) (2021-02-22) + + +### Features + +* export PublishError ([#1216](https://www.github.com/googleapis/nodejs-pubsub/issues/1216)) ([7c75d70](https://www.github.com/googleapis/nodejs-pubsub/commit/7c75d70e12545859d011c289b251d2ef746de589)), closes [#1215](https://www.github.com/googleapis/nodejs-pubsub/issues/1215) + +## [2.9.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.8.0...v2.9.0) (2021-02-10) + + +### Features + +* update protos from upstream ([#1206](https://www.github.com/googleapis/nodejs-pubsub/issues/1206)) ([33526b0](https://www.github.com/googleapis/nodejs-pubsub/commit/33526b04373bd1ea40930d14b6fc6a344a814eff)) + + +### Bug Fixes + +* bind promisify calls for flush() so they have a 'this' value ([#1184](https://www.github.com/googleapis/nodejs-pubsub/issues/1184)) ([e494fb7](https://www.github.com/googleapis/nodejs-pubsub/commit/e494fb7303ae58b08f3f75aa87ea1f10c86f648e)) +* **deps:** update dependency google-auth-library to v7 ([#1207](https://www.github.com/googleapis/nodejs-pubsub/issues/1207)) ([fce2af1](https://www.github.com/googleapis/nodejs-pubsub/commit/fce2af18ef932b722dcaa9e1132ee145318bd81e)) +* openTelemetry doc fails to generate for [#1185](https://www.github.com/googleapis/nodejs-pubsub/issues/1185) ([#1200](https://www.github.com/googleapis/nodejs-pubsub/issues/1200)) ([0600bde](https://www.github.com/googleapis/nodejs-pubsub/commit/0600bdef9447440605d129396c1915e7640f80ea)) +* update synchronousPull example to avoid INVALID_ARGUMENT error ([#1194](https://www.github.com/googleapis/nodejs-pubsub/issues/1194)) ([1f85345](https://www.github.com/googleapis/nodejs-pubsub/commit/1f853450e0822ebbaeab5892f5d76f5bc0e29537)) + +## [2.8.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.7.0...v2.8.0) (2021-01-08) + + +### Features + +* schema proto support ([#1176](https://www.github.com/googleapis/nodejs-pubsub/issues/1176)) ([ac29561](https://www.github.com/googleapis/nodejs-pubsub/commit/ac2956123b361892290ece66ab9a9dfaa7f61d2d)) + + +### Bug Fixes + +* **deps:** update opentelemetry monorepo to ^0.12.0 ([#1162](https://www.github.com/googleapis/nodejs-pubsub/issues/1162)) ([f459a91](https://www.github.com/googleapis/nodejs-pubsub/commit/f459a91949fca1fbd573ecc1442bc3e5f54e8ee8)) + +## [2.7.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.6.0...v2.7.0) (2020-11-30) + + +### Features + +* Enable server side flow control by default with the option to turn it off ([#1147](https://www.github.com/googleapis/nodejs-pubsub/issues/1147)) ([a9c7e0b](https://www.github.com/googleapis/nodejs-pubsub/commit/a9c7e0b216a0c228793eeead150cc21b16bd2dcb)) +* update generator to a new version ([#1157](https://www.github.com/googleapis/nodejs-pubsub/issues/1157)) ([3b1e99e](https://www.github.com/googleapis/nodejs-pubsub/commit/3b1e99ebde72653a1fa0317820d1218e1c04eb8f)) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#1148](https://www.github.com/googleapis/nodejs-pubsub/issues/1148)) ([4745c10](https://www.github.com/googleapis/nodejs-pubsub/commit/4745c10eb062b1816516ce79cec496b388e48b2b)) +* node 14+ changes how multiple destroy() calls work ([#1153](https://www.github.com/googleapis/nodejs-pubsub/issues/1153)) ([e421749](https://www.github.com/googleapis/nodejs-pubsub/commit/e42174987ec4669b31882943606c871c9b6c08d7)) + +## [2.6.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.5.0...v2.6.0) (2020-10-20) + + +### Features + +* update synthtool generation for latest changes ([#1128](https://www.github.com/googleapis/nodejs-pubsub/issues/1128)) ([bdbe80f](https://www.github.com/googleapis/nodejs-pubsub/commit/bdbe80f9183fae77dd8ac3e7ffa4bbc5282b030c)) + + +### Bug Fixes + +* **deps:** update google-auth-library for security fix ([#1122](https://www.github.com/googleapis/nodejs-pubsub/issues/1122)) ([1eaf850](https://github.com/googleapis/nodejs-pubsub/commit/1eaf850bf4ea44ae3269d4f33d5aa6574af76705)) +* add CANCELLED back to the auto-retry codes for pull subscriptions, for now ([#1132](https://www.github.com/googleapis/nodejs-pubsub/issues/1132)) ([47cd89c](https://www.github.com/googleapis/nodejs-pubsub/commit/47cd89c99cad62e603f4c5345ce2857c6abf6f47)) +* **deps:** update opentelemetry monorepo to ^0.11.0 ([#1102](https://www.github.com/googleapis/nodejs-pubsub/issues/1102)) ([c9d5638](https://www.github.com/googleapis/nodejs-pubsub/commit/c9d5638031d047b80df82bc4afed1aecdd708406)) +* **deps:** upgrade google-auth-library ([#1122](https://www.github.com/googleapis/nodejs-pubsub/issues/1122)) ([54310a7](https://www.github.com/googleapis/nodejs-pubsub/commit/54310a771b4b39c896f62fc18aea040cc42bfcd7)) +* move system and samples test from Node 10 to Node 12 ([#1094](https://www.github.com/googleapis/nodejs-pubsub/issues/1094)) ([693116a](https://www.github.com/googleapis/nodejs-pubsub/commit/693116afb3776a8696c52d890edf9a57423896dc)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.4.0...v2.5.0) (2020-08-17) + + +### Features + +* Opentelemetry integration ([#1078](https://www.github.com/googleapis/nodejs-pubsub/issues/1078)) ([76db007](https://www.github.com/googleapis/nodejs-pubsub/commit/76db007f270a646e8570768fa827ea2a97b62cbc)), closes [#1066](https://www.github.com/googleapis/nodejs-pubsub/issues/1066) [#1070](https://www.github.com/googleapis/nodejs-pubsub/issues/1070) + + +### Bug Fixes + +* make request batching work again ([#1087](https://www.github.com/googleapis/nodejs-pubsub/issues/1087)) ([80e0ee3](https://www.github.com/googleapis/nodejs-pubsub/commit/80e0ee3a4ef0da325e61ce2b869f4c0f9829b136)) +* properly handle non-emulator alternate endpoints for pub/sub ([#1060](https://www.github.com/googleapis/nodejs-pubsub/issues/1060)) ([195ebf6](https://www.github.com/googleapis/nodejs-pubsub/commit/195ebf648e00ba35f567cef06a06c31f3f9c57d9)) +* **deps:** update opentelemetry monorepo to ^0.10.0 ([#1090](https://www.github.com/googleapis/nodejs-pubsub/issues/1090)) ([78a45ff](https://www.github.com/googleapis/nodejs-pubsub/commit/78a45ff1cb8fb921e5ca05e435554d684a777185)) +* update minimum gax version to 2.7.0 to fix recent protobuf errors ([#1085](https://www.github.com/googleapis/nodejs-pubsub/issues/1085)) ([904348c](https://www.github.com/googleapis/nodejs-pubsub/commit/904348cd6471f267a54635fcd65fe4191896308e)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.3.0...v2.4.0) (2020-08-08) + + +### Features + +* update to TypeScript 3.8+ to match gax/protobufjs (to allow things to compile again) ([#1079](https://www.github.com/googleapis/nodejs-pubsub/issues/1079)) ([cd39d38](https://www.github.com/googleapis/nodejs-pubsub/commit/cd39d38c525b3ed0383c63eb379c96aed6f53d94)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.2.0...v2.3.0) (2020-07-20) + + +### Features + +* Add support for server-side flow control ([#1041](https://www.github.com/googleapis/nodejs-pubsub/issues/1041)) ([a53f6c7](https://www.github.com/googleapis/nodejs-pubsub/commit/a53f6c755317f2fdcb107989321a78fa05e0c455)) +* support for detaching subscriptions ([#1032](https://www.github.com/googleapis/nodejs-pubsub/issues/1032)) ([c5af3a9](https://www.github.com/googleapis/nodejs-pubsub/commit/c5af3a9988e318c3d884aed1777010faa8545ab1)) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#1049](https://www.github.com/googleapis/nodejs-pubsub/issues/1049)) ([b4c6dc0](https://www.github.com/googleapis/nodejs-pubsub/commit/b4c6dc0264a4f62283ceb3b5e1e2ae58e06c56c1)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.1.0...v2.2.0) (2020-07-09) + + +### Features + +* add flow control settings for StreamingPullRequest to pubsub.proto ([#1035](https://www.github.com/googleapis/nodejs-pubsub/issues/1035)) ([a7dff65](https://www.github.com/googleapis/nodejs-pubsub/commit/a7dff65c1a4115e75251b775f679e6beb092928e)) +* move ts target to es2018 from es2016 ([#1022](https://www.github.com/googleapis/nodejs-pubsub/issues/1022)) ([016568d](https://www.github.com/googleapis/nodejs-pubsub/commit/016568df466c2a543762ab4f194b785a426ad880)) +* Re-export ClientConfig from pubsub.ts in package index.ts ([#1038](https://www.github.com/googleapis/nodejs-pubsub/issues/1038)) ([c2ac083](https://www.github.com/googleapis/nodejs-pubsub/commit/c2ac083fdb5f3b71dcb3be482b8ee5c9d527342d)), closes [#972](https://www.github.com/googleapis/nodejs-pubsub/issues/972) + + +### Bug Fixes + +* handle fallback option properly ([#1028](https://www.github.com/googleapis/nodejs-pubsub/issues/1028)) ([5dc1827](https://www.github.com/googleapis/nodejs-pubsub/commit/5dc18270220dbf39f5a871716b4dd9d002d0c536)) +* update node issue template ([#1033](https://www.github.com/googleapis/nodejs-pubsub/issues/1033)) ([52ba0ae](https://www.github.com/googleapis/nodejs-pubsub/commit/52ba0ae0218c0859a03d8ad9e4f27130ceb4cc61)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.0.0...v2.1.0) (2020-06-02) + + +### Features + +* re-generated to pick up changes from googleapis ([#1014](https://www.github.com/googleapis/nodejs-pubsub/issues/1014)) ([1ad3552](https://www.github.com/googleapis/nodejs-pubsub/commit/1ad35528f0d8b5420f9fbe122db2ff1962e32acb)) + + +### Bug Fixes + +* use any to unblock typescript compilation bug ([#1012](https://www.github.com/googleapis/nodejs-pubsub/issues/1012)) ([1e8ced3](https://www.github.com/googleapis/nodejs-pubsub/commit/1e8ced3f06d12487fdf00b443bb447e1ec1a911b)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-pubsub/compare/vv1.7.1...v2.0.0) (2020-05-20) + +Please note that Node 8 is no longer supported, and Node 10 is the new minimum version of the runtime. + +### ⚠ BREAKING CHANGES + +* Please note that Node 8 is no longer supported, and Node 10 is the new minimum version of the runtime. +* drop support for custom promises (#970) +* convert to typescript (#923) +* **deps:** update dependency @google-cloud/projectify to v2 (#929) + +### Bug Fixes + +* **docs:** link to correct gaxOptions docs ([#999](https://www.github.com/googleapis/nodejs-pubsub/issues/999)) ([312e318](https://www.github.com/googleapis/nodejs-pubsub/commit/312e318ceb36eafbeb487ede7e5dbf9ccd5dfb81)) +* regen protos and tests, formatting ([#991](https://www.github.com/googleapis/nodejs-pubsub/issues/991)) ([e350b97](https://www.github.com/googleapis/nodejs-pubsub/commit/e350b97ad19e49e5fe52d5eeb1ad67c8bb6ddf33)) +* remove eslint, update gax, fix generated protos, run the generator ([#955](https://www.github.com/googleapis/nodejs-pubsub/issues/955)) ([544a061](https://www.github.com/googleapis/nodejs-pubsub/commit/544a061b1b6d7fdc4051486c2b8ae5d14e1ec141)) +* remove unused dependencies ([#998](https://www.github.com/googleapis/nodejs-pubsub/issues/998)) ([7b242a3](https://www.github.com/googleapis/nodejs-pubsub/commit/7b242a36212e0871b3918621fe9a5f51d1e6b733)) +* **close:** ensure in-flight messages are drained ([#952](https://www.github.com/googleapis/nodejs-pubsub/issues/952)) ([93a2bd7](https://www.github.com/googleapis/nodejs-pubsub/commit/93a2bd726660b134fbd3e12335bfde29d13a2b78)) +* **deps:** update dependency @google-cloud/paginator to v3 ([#931](https://www.github.com/googleapis/nodejs-pubsub/issues/931)) ([b621854](https://www.github.com/googleapis/nodejs-pubsub/commit/b62185426b7f958ee41a1cff429bc5fb70635b4a)) +* **deps:** update dependency @google-cloud/precise-date to v2 ([#934](https://www.github.com/googleapis/nodejs-pubsub/issues/934)) ([72b8d78](https://www.github.com/googleapis/nodejs-pubsub/commit/72b8d781ed3cbf9049101b9c2675f211fb3924ba)) +* **deps:** update dependency @google-cloud/projectify to v2 ([#929](https://www.github.com/googleapis/nodejs-pubsub/issues/929)) ([45d9880](https://www.github.com/googleapis/nodejs-pubsub/commit/45d988077d2db2fddbb4d22aac43c7f8a77e4dcc)) +* **deps:** update dependency @google-cloud/promisify to v2 ([#928](https://www.github.com/googleapis/nodejs-pubsub/issues/928)) ([3819877](https://www.github.com/googleapis/nodejs-pubsub/commit/3819877752d39cd042364bdd9ed01ff230aeed0b)) +* **deps:** update dependency google-auth-library to v6 ([#935](https://www.github.com/googleapis/nodejs-pubsub/issues/935)) ([73fc887](https://www.github.com/googleapis/nodejs-pubsub/commit/73fc887c662b526690167286d2d5afda0cccad1b)) + + +### Build System + +* convert to typescript ([#923](https://www.github.com/googleapis/nodejs-pubsub/issues/923)) ([2fc68ba](https://www.github.com/googleapis/nodejs-pubsub/commit/2fc68baff0cc2013468da7ef3dc8d547d4745989)) + + +### Miscellaneous Chores + +* drop support for custom promises ([#970](https://www.github.com/googleapis/nodejs-pubsub/issues/970)) ([df462d3](https://www.github.com/googleapis/nodejs-pubsub/commit/df462d3dec4f733cb309eb6413aad382424e2125)) + +### [1.7.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.7.0...v1.7.1) (2020-04-06) + + +### Bug Fixes + +* provide missing close() method in the generated gapic client ([#941](https://www.github.com/googleapis/nodejs-pubsub/issues/941)) ([6bf8f14](https://www.github.com/googleapis/nodejs-pubsub/commit/6bf8f1481a1dea051c47697488e13b6facf20a26)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.6.0...v1.7.0) (2020-03-29) + + +### Features + +* add a close() method to PubSub, and a flush() method to Topic/Publisher ([#916](https://www.github.com/googleapis/nodejs-pubsub/issues/916)) ([4097995](https://www.github.com/googleapis/nodejs-pubsub/commit/4097995a85a8ca3fb73c2c2a8cb0649cdd4274be)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.5.0...v1.6.0) (2020-03-04) + + +### Features + +* **subscription:** support oidcToken ([#865](https://www.github.com/googleapis/nodejs-pubsub/issues/865)) ([a786ca0](https://www.github.com/googleapis/nodejs-pubsub/commit/a786ca00bd27a6e098125d6b7b87edb11ea6ea0f)) +* export protos in src/index.ts ([f32910c](https://www.github.com/googleapis/nodejs-pubsub/commit/f32910c3a7da5ce268084d7294094912ab696034)) + + +### Bug Fixes + +* **deps:** update to the latest google-gax to pull in grpc-js 0.6.18 ([#903](https://www.github.com/googleapis/nodejs-pubsub/issues/903)) ([78bd9e9](https://www.github.com/googleapis/nodejs-pubsub/commit/78bd9e97a913b5e2aa457c2a28fd849f67bf225e)) +* send the ITimestamp protobuf to Pub/Sub for seeking, not JavaScript Date() ([#908](https://www.github.com/googleapis/nodejs-pubsub/issues/908)) ([0c1d711](https://www.github.com/googleapis/nodejs-pubsub/commit/0c1d711854d7397a0fc4d6e84ed090984a6e05dc)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.4.1...v1.5.0) (2020-02-03) + + +### Features + +* added clientId to StreamingPullRequest ([b566ab3](https://www.github.com/googleapis/nodejs-pubsub/commit/b566ab3187efe08d19c29afc8a506a94ed2760b3)) +* update defaults for batch settings also, and update which result codes will cause a retry ([#877](https://www.github.com/googleapis/nodejs-pubsub/issues/877)) ([32ae411](https://www.github.com/googleapis/nodejs-pubsub/commit/32ae4114fb7b42722a6c5100e9d494e470a5cae2)) + +### [1.4.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.4.0...v1.4.1) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([186778f](https://www.github.com/googleapis/nodejs-pubsub/commit/186778f627e0252f25508a80165f253b9dedcb83)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.3.0...v1.4.0) (2020-01-24) + + +### Features + +* **defaults:** update defaults for the node client library to match other pub/sub libraries ([#859](https://www.github.com/googleapis/nodejs-pubsub/issues/859)) ([8d6c3f7](https://www.github.com/googleapis/nodejs-pubsub/commit/8d6c3f778cbe00cde8b273b25bc50b491687396b)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.2.0...v1.3.0) (2020-01-14) + + +### Features + +* **subscription:** dead letter policy support ([#799](https://www.github.com/googleapis/nodejs-pubsub/issues/799)) ([b5a4195](https://www.github.com/googleapis/nodejs-pubsub/commit/b5a4195238cf8ceed0b066a93066765820dc0488)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.6...v1.2.0) (2019-12-13) + + +### Features + +* ordered messaging ([#716](https://www.github.com/googleapis/nodejs-pubsub/issues/716)) ([b2f96ff](https://www.github.com/googleapis/nodejs-pubsub/commit/b2f96ffe6c1db93741f40804786f8c294717676b)) + +### [1.1.6](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.5...v1.1.6) (2019-11-25) + + +### Bug Fixes + +* **deps:** update dependency yargs to v15 ([#820](https://www.github.com/googleapis/nodejs-pubsub/issues/820)) ([3615211](https://www.github.com/googleapis/nodejs-pubsub/commit/36152114829c384a97b4f19b9006704a0f216878)) +* **docs:** snippets are now replaced in jsdoc comments ([#815](https://www.github.com/googleapis/nodejs-pubsub/issues/815)) ([b0b26ad](https://www.github.com/googleapis/nodejs-pubsub/commit/b0b26ade6096aa39fbc36a5c270982f3b6f9192e)) +* adds streaming pull retry, and increases request thresholds ([a7d4d04](https://www.github.com/googleapis/nodejs-pubsub/commit/a7d4d04c1b728e3d29626656889da0dd747b94ce)) +* include long import in proto typescript declaration file ([#816](https://www.github.com/googleapis/nodejs-pubsub/issues/816)) ([4b3b813](https://www.github.com/googleapis/nodejs-pubsub/commit/4b3b81384ad4e46f75ee23f3b174842ada212bfe)) + +### [1.1.5](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.4...v1.1.5) (2019-10-22) + + +### Bug Fixes + +* pull emulator creds from local grpc instance ([#795](https://www.github.com/googleapis/nodejs-pubsub/issues/795)) ([1749b62](https://www.github.com/googleapis/nodejs-pubsub/commit/1749b626e6bff5fefd1b1b8c673c480a10be9cf9)) + +### [1.1.4](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.3...v1.1.4) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#792](https://www.github.com/googleapis/nodejs-pubsub/issues/792)) ([d584d07](https://www.github.com/googleapis/nodejs-pubsub/commit/d584d07c8a8291444487eef947e01a832dfde372)) + +### [1.1.3](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.2...v1.1.3) (2019-10-18) + + +### Bug Fixes + +* **deps:** explicit update to google-auth-library with various fixes ([#785](https://www.github.com/googleapis/nodejs-pubsub/issues/785)) ([c7b0069](https://www.github.com/googleapis/nodejs-pubsub/commit/c7b006995fb8fe432e8561d189cddbd20c8e0dce)) +* **docs:** add documentation about running C++ gRPC bindings ([#782](https://www.github.com/googleapis/nodejs-pubsub/issues/782)) ([bdc690e](https://www.github.com/googleapis/nodejs-pubsub/commit/bdc690e6d102862f11a5ea4901c98effe1d3c427)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.1...v1.1.2) (2019-10-09) + + +### Bug Fixes + +* **deps:** remove direct dependency on @grpc/grpc-js ([#773](https://www.github.com/googleapis/nodejs-pubsub/issues/773)) ([0bebf9b](https://www.github.com/googleapis/nodejs-pubsub/commit/0bebf9b)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.1.0...v1.1.1) (2019-10-08) + + +### Bug Fixes + +* update messaging retry timeout durations ([#761](https://www.github.com/googleapis/nodejs-pubsub/issues/761)) ([922fe92](https://www.github.com/googleapis/nodejs-pubsub/commit/922fe92)) +* use compatible version of google-gax ([060207a](https://www.github.com/googleapis/nodejs-pubsub/commit/060207a)) +* **deps:** pin @grpc/grpc-js to ^0.6.6 ([#772](https://www.github.com/googleapis/nodejs-pubsub/issues/772)) ([3c5199d](https://www.github.com/googleapis/nodejs-pubsub/commit/3c5199d)) +* **docs:** explain PubSub.v1 property ([#766](https://www.github.com/googleapis/nodejs-pubsub/issues/766)) ([157a86d](https://www.github.com/googleapis/nodejs-pubsub/commit/157a86d)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.0.0...v1.1.0) (2019-09-25) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/pubsub to v1 ([#750](https://www.github.com/googleapis/nodejs-pubsub/issues/750)) ([82305de](https://www.github.com/googleapis/nodejs-pubsub/commit/82305de)) +* **deps:** update dependency @grpc/grpc-js to ^0.6.0 ([#759](https://www.github.com/googleapis/nodejs-pubsub/issues/759)) ([fda95c7](https://www.github.com/googleapis/nodejs-pubsub/commit/fda95c7)) + + +### Features + +* .d.ts for protos ([#755](https://www.github.com/googleapis/nodejs-pubsub/issues/755)) ([32aab9f](https://www.github.com/googleapis/nodejs-pubsub/commit/32aab9f)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.32.1...v1.0.0) (2019-09-18) + + +### ⚠ BREAKING CHANGES + +* set release level to GA (#745) + +### Miscellaneous Chores + +* set release level to GA ([#745](https://www.github.com/googleapis/nodejs-pubsub/issues/745)) ([2e90c5b](https://www.github.com/googleapis/nodejs-pubsub/commit/2e90c5b)) + +### [0.32.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.32.0...v0.32.1) (2019-09-13) + +### Updates + +* dependency `google-gax` updated to `^1.5.2` to make sure the new version is pulled. + +## [0.32.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.31.1...v0.32.0) (2019-09-11) + + +### Bug Fixes + +* pull projectId from auth client with emulator ([#731](https://www.github.com/googleapis/nodejs-pubsub/issues/731)) ([3840cad](https://www.github.com/googleapis/nodejs-pubsub/commit/3840cad)) +* update IAM protos ([#736](https://www.github.com/googleapis/nodejs-pubsub/issues/736)) ([055fa33](https://www.github.com/googleapis/nodejs-pubsub/commit/055fa33)) + + +### Features + +* introduces DeadLetterPolicy ([e24c545](https://www.github.com/googleapis/nodejs-pubsub/commit/e24c545)) +* load protos from JSON, grpc-fallback support ([#730](https://www.github.com/googleapis/nodejs-pubsub/issues/730)) ([2071954](https://www.github.com/googleapis/nodejs-pubsub/commit/2071954)) +* update IAM protos ([#734](https://www.github.com/googleapis/nodejs-pubsub/issues/734)) ([91fa2ef](https://www.github.com/googleapis/nodejs-pubsub/commit/91fa2ef)) + +### [0.31.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.31.0...v0.31.1) (2019-08-27) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([b0ceb5e](https://www.github.com/googleapis/nodejs-pubsub/commit/b0ceb5e)) +* use process versions object for client header ([#722](https://www.github.com/googleapis/nodejs-pubsub/issues/722)) ([e65185b](https://www.github.com/googleapis/nodejs-pubsub/commit/e65185b)) + +## [0.31.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.30.3...v0.31.0) (2019-08-15) + + +### Features + +* **debug:** capture stack trace in errors rather than message ([#718](https://www.github.com/googleapis/nodejs-pubsub/issues/718)) ([bfed3f1](https://www.github.com/googleapis/nodejs-pubsub/commit/bfed3f1)) + +### [0.30.3](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.30.2...v0.30.3) (2019-08-03) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([1e73a69](https://www.github.com/googleapis/nodejs-pubsub/commit/1e73a69)) + +### [0.30.2](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.30.1...v0.30.2) (2019-07-30) + + +### ⚠ BREAKING CHANGES + +* **message:** remove nack delay parameter (#668) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v2 ([#700](https://www.github.com/googleapis/nodejs-pubsub/issues/700)) ([a5c0160](https://www.github.com/googleapis/nodejs-pubsub/commit/a5c0160)) +* **deps:** update dependency @grpc/grpc-js to ^0.5.0 ([#698](https://www.github.com/googleapis/nodejs-pubsub/issues/698)) ([d48e578](https://www.github.com/googleapis/nodejs-pubsub/commit/d48e578)) +* **deps:** update dependency @sindresorhus/is to v1 ([#701](https://www.github.com/googleapis/nodejs-pubsub/issues/701)) ([e715172](https://www.github.com/googleapis/nodejs-pubsub/commit/e715172)) +* **deps:** update dependency google-auth-library to v5 ([#702](https://www.github.com/googleapis/nodejs-pubsub/issues/702)) ([3a15956](https://www.github.com/googleapis/nodejs-pubsub/commit/3a15956)) +* **docs:** reference docs should link to section of googleapis.dev with API reference ([#670](https://www.github.com/googleapis/nodejs-pubsub/issues/670)) ([c92a09a](https://www.github.com/googleapis/nodejs-pubsub/commit/c92a09a)) + + +### Reverts + +* **message:** remove nack delay parameter ([#668](https://www.github.com/googleapis/nodejs-pubsub/issues/668)) ([ca8fe65](https://www.github.com/googleapis/nodejs-pubsub/commit/ca8fe65)) + +### [0.30.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.30.0...v0.30.1) (2019-06-21) + + +### Bug Fixes + +* **deps:** include missing @grpc/grpc-js dependency ([#665](https://www.github.com/googleapis/nodejs-pubsub/issues/665)) ([5f42f60](https://www.github.com/googleapis/nodejs-pubsub/commit/5f42f60)) + +## [0.30.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.29.1...v0.30.0) (2019-06-17) + + +### ⚠ BREAKING CHANGES + +* **deps:** use grpc-js instead of grpc extension (#658) +* **subscription:** decouple retainAckedMessages from messageRetentionDuration (#625) +* remove pullTimeout subscriber option (#618) + +### Bug Fixes + +* **deps:** update dependency @sindresorhus/is to ^0.17.0 ([#591](https://www.github.com/googleapis/nodejs-pubsub/issues/591)) ([06fae6e](https://www.github.com/googleapis/nodejs-pubsub/commit/06fae6e)) +* **deps:** update dependency grpc to v1.21.1 ([#629](https://www.github.com/googleapis/nodejs-pubsub/issues/629)) ([fcf75a2](https://www.github.com/googleapis/nodejs-pubsub/commit/fcf75a2)) +* **deps:** update dependency p-defer to v3 ([#650](https://www.github.com/googleapis/nodejs-pubsub/issues/650)) ([50f9d4e](https://www.github.com/googleapis/nodejs-pubsub/commit/50f9d4e)) +* **deps:** upgrade module extend to fix CVE-2018-16492 ([#644](https://www.github.com/googleapis/nodejs-pubsub/issues/644)) ([cd54630](https://www.github.com/googleapis/nodejs-pubsub/commit/cd54630)) +* **deps:** use grpc-js instead of grpc extension ([#658](https://www.github.com/googleapis/nodejs-pubsub/issues/658)) ([535a917](https://www.github.com/googleapis/nodejs-pubsub/commit/535a917)) +* **docs:** move to new client docs URL ([#657](https://www.github.com/googleapis/nodejs-pubsub/issues/657)) ([a9972ea](https://www.github.com/googleapis/nodejs-pubsub/commit/a9972ea)) +* update regex to target correct comment ([#646](https://www.github.com/googleapis/nodejs-pubsub/issues/646)) ([9e8f245](https://www.github.com/googleapis/nodejs-pubsub/commit/9e8f245)) +* update rpc timeout settings ([#628](https://www.github.com/googleapis/nodejs-pubsub/issues/628)) ([2a1a430](https://www.github.com/googleapis/nodejs-pubsub/commit/2a1a430)) +* **subscription:** decouple retainAckedMessages from messageRetentionDuration ([#625](https://www.github.com/googleapis/nodejs-pubsub/issues/625)) ([3431e7c](https://www.github.com/googleapis/nodejs-pubsub/commit/3431e7c)) +* **typescript:** pin grpc to previous working version ([#624](https://www.github.com/googleapis/nodejs-pubsub/issues/624)) ([2167536](https://www.github.com/googleapis/nodejs-pubsub/commit/2167536)) + + +### Features + +* add .repo-metadata.json, start generating README.md ([#636](https://www.github.com/googleapis/nodejs-pubsub/issues/636)) ([142f56c](https://www.github.com/googleapis/nodejs-pubsub/commit/142f56c)) +* support apiEndpoint override ([#647](https://www.github.com/googleapis/nodejs-pubsub/issues/647)) ([b44f566](https://www.github.com/googleapis/nodejs-pubsub/commit/b44f566)) + + +### Reverts + +* remove pullTimeout subscriber option ([#618](https://www.github.com/googleapis/nodejs-pubsub/issues/618)) ([4fc9724](https://www.github.com/googleapis/nodejs-pubsub/commit/4fc9724)) + +### [0.29.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.29.0...v0.29.1) (2019-05-18) + + +### Bug Fixes + +* use typescript import/export for gapics ([#611](https://www.github.com/googleapis/nodejs-pubsub/issues/611)) ([e882e1a](https://www.github.com/googleapis/nodejs-pubsub/commit/e882e1a)) + +## [0.29.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v0.28.1...v0.29.0) (2019-05-15) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v1 ([#592](https://www.github.com/googleapis/nodejs-pubsub/issues/592)) ([181553a](https://www.github.com/googleapis/nodejs-pubsub/commit/181553a)) +* **deps:** update dependency @google-cloud/precise-date to v1 ([#603](https://www.github.com/googleapis/nodejs-pubsub/issues/603)) ([2e669a1](https://www.github.com/googleapis/nodejs-pubsub/commit/2e669a1)) +* **deps:** update dependency @google-cloud/projectify to v1 ([#588](https://www.github.com/googleapis/nodejs-pubsub/issues/588)) ([d01d010](https://www.github.com/googleapis/nodejs-pubsub/commit/d01d010)) +* **deps:** update dependency @google-cloud/promisify to v1 ([#589](https://www.github.com/googleapis/nodejs-pubsub/issues/589)) ([dad7530](https://www.github.com/googleapis/nodejs-pubsub/commit/dad7530)) +* **deps:** update dependency arrify to v2 ([#565](https://www.github.com/googleapis/nodejs-pubsub/issues/565)) ([8e3b7b8](https://www.github.com/googleapis/nodejs-pubsub/commit/8e3b7b8)) +* **deps:** update dependency google-auth-library to v4 ([#601](https://www.github.com/googleapis/nodejs-pubsub/issues/601)) ([baf9d39](https://www.github.com/googleapis/nodejs-pubsub/commit/baf9d39)) +* **deps:** update dependency google-gax to v1 ([#604](https://www.github.com/googleapis/nodejs-pubsub/issues/604)) ([6415e7c](https://www.github.com/googleapis/nodejs-pubsub/commit/6415e7c)) +* DEADLINE_EXCEEDED no longer treated as idempotent and retried ([39b1dac](https://www.github.com/googleapis/nodejs-pubsub/commit/39b1dac)) +* DEADLINE_EXCEEDED retry code is idempotent ([#605](https://www.github.com/googleapis/nodejs-pubsub/issues/605)) ([1ae8db9](https://www.github.com/googleapis/nodejs-pubsub/commit/1ae8db9)) +* **deps:** update dependency google-gax to ^0.26.0 ([#583](https://www.github.com/googleapis/nodejs-pubsub/issues/583)) ([4214a4f](https://www.github.com/googleapis/nodejs-pubsub/commit/4214a4f)) +* include 'x-goog-request-params' header in requests ([#562](https://www.github.com/googleapis/nodejs-pubsub/issues/562)) ([482e745](https://www.github.com/googleapis/nodejs-pubsub/commit/482e745)) +* relax strictEqual to match RegExp ([#566](https://www.github.com/googleapis/nodejs-pubsub/issues/566)) ([3388fb7](https://www.github.com/googleapis/nodejs-pubsub/commit/3388fb7)) +* **deps:** update dependency p-defer to v2 ([#553](https://www.github.com/googleapis/nodejs-pubsub/issues/553)) ([fe33e40](https://www.github.com/googleapis/nodejs-pubsub/commit/fe33e40)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#584](https://www.github.com/googleapis/nodejs-pubsub/issues/584)) ([2116474](https://www.github.com/googleapis/nodejs-pubsub/commit/2116474)) + + +### Features + +* **subscriber:** ordered messages ([1ae4719](https://www.github.com/googleapis/nodejs-pubsub/commit/1ae4719)) +* **subscription:** accept pull timeout option ([#556](https://www.github.com/googleapis/nodejs-pubsub/issues/556)) ([468e1bf](https://www.github.com/googleapis/nodejs-pubsub/commit/468e1bf)) +* **subscription:** ordered messages ([#560](https://www.github.com/googleapis/nodejs-pubsub/issues/560)) ([38502ad](https://www.github.com/googleapis/nodejs-pubsub/commit/38502ad)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#584) + +## v0.28.1 + +03-11-2019 15:36 PDT + +### Bug Fixes +- fix(typescript): correctly import long ([#541](https://github.com/googleapis/nodejs-pubsub/pull/541)) + +### Internal / Testing Changes +- testing: set skipLibCheck to false for ts install test ([#543](https://github.com/googleapis/nodejs-pubsub/pull/543)) +- refactor: fix/simplify proto gen scripts ([#542](https://github.com/googleapis/nodejs-pubsub/pull/542)) + +## v0.28.0 + +03-11-2019 09:11 PDT + +### New Features +- feat(topic): create setMetadata method ([#537](https://github.com/googleapis/nodejs-pubsub/pull/537)) + +### Dependencies +- fix(deps): update dependency @google-cloud/paginator to ^0.2.0 + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#533](https://github.com/googleapis/nodejs-pubsub/pull/533)) +- test: add missing packages and install test ([#536](https://github.com/googleapis/nodejs-pubsub/pull/536)) +- refactor(typescript): noImplicitAny for Subscription test file ([#534](https://github.com/googleapis/nodejs-pubsub/pull/534)) + +## v0.27.1 + +03-06-2019 20:11 PST + +### Bug Fixes +- fix(typescript): correct response type of `Subscription.get` ([#525](https://github.com/googleapis/nodejs-pubsub/pull/525)) + +### Documentation +- fix(typo): correct typo: recieved => received ([#527](https://github.com/googleapis/nodejs-pubsub/pull/527)) + +### Internal / Testing Changes +- build: update release configuration +- refactor(typescript): noImplicitAny for message-stream test file ([#522](https://github.com/googleapis/nodejs-pubsub/pull/522)) +- build: use node10 to run samples-test, system-test etc ([#529](https://github.com/googleapis/nodejs-pubsub/pull/529)) +- refactor: type fixes and some light housekeeping ([#528](https://github.com/googleapis/nodejs-pubsub/pull/528)) + +## v0.27.0 + +03-04-2019 08:42 PST + + +### Bug Fixes +- refactor(typescript): various fixes/refactors to types ([#515](https://github.com/googleapis/nodejs-pubsub/pull/515)) +- fix(ts): fix getPolicy promise return signature ([#511](https://github.com/googleapis/nodejs-pubsub/pull/511)) +- fix(typescript): export all the types ([#516](https://github.com/googleapis/nodejs-pubsub/pull/516)) + +### Dependencies +- refactor: clean up unused packages ([#517](https://github.com/googleapis/nodejs-pubsub/pull/517)) + +### Documentation +- fix(docs): ensure docs are not removed by typescript ([#512](https://github.com/googleapis/nodejs-pubsub/pull/512)) +- docs: update comments on protos ([#509](https://github.com/googleapis/nodejs-pubsub/pull/509)) + +### Internal / Testing Changes +- refactor(typescript):noImplicitAny for index test file ([#502](https://github.com/googleapis/nodejs-pubsub/pull/502)) +- refactor(ts): enable noImplicitAny for IAM test file ([#501](https://github.com/googleapis/nodejs-pubsub/pull/501)) +- refactor(ts): enable noImplicitAny for lease-manager test file ([#508](https://github.com/googleapis/nodejs-pubsub/pull/508)) +- refactor(ts): enable noImplicitAny for Histogram and Message_queues test file ([#510](https://github.com/googleapis/nodejs-pubsub/pull/510)) +- refactor(ts): enable noImplicitAny for pubsub system test file ([#519](https://github.com/googleapis/nodejs-pubsub/pull/519)) +- refactor(ts): noImplicitAny for publisher test file ([#520](https://github.com/googleapis/nodejs-pubsub/pull/520)) + +## v0.26.0 + +02-28-2019 05:42 PST + +### BREAKING: `message.publishTime` is now represented by a [`PreciseDate`](https://github.com/googleapis/nodejs-precise-date) object. ([#503](https://github.com/googleapis/nodejs-pubsub/pull/503)) + +The `PreciseDate` class extends the native Date object, so most users should be unaffected by this change. The notable differences between PreciseDate and Date objects are: + +- `toISOString()` now returns as a RFC 3339 formatted string. +- Nano and microsecond data is available via `date.getNanoseconds()` and `date.getMicroseconds()` respectively. + +### New Features +- feat(typescript): ship typescript declaration files ([#498](https://github.com/googleapis/nodejs-pubsub/pull/498)) +- feat(subscription): support push config auth methods ([#504](https://github.com/googleapis/nodejs-pubsub/pull/504)) + +### Internal / Testing Changes +- refactor(typescript): noImplicitAny for snapshot and subscriber test file ([#490](https://github.com/googleapis/nodejs-pubsub/pull/490)) +- fix(messageStream): remove call to destroy grpc stream ([#499](https://github.com/googleapis/nodejs-pubsub/pull/499)) + +## v0.25.0 + +02-20-2019 10:35 PST + +### Implementation Changes +- fix: throw on invalid credentials and update retry config ([#476](https://github.com/googleapis/nodejs-pubsub/pull/476)) + +The retry logic for **all** methods has changed. It is possible that this could go unnoticed, however if you suddenly start seeing errors in places that were previously quiet, this might account for said errors. + +### New Features +- refactor(ts): improve TypeScript types ([#482](https://github.com/googleapis/nodejs-pubsub/pull/482)) +- refactor(typescript): noImplicityAny for snapshot.ts and publisher.ts ([#457](https://github.com/googleapis/nodejs-pubsub/pull/457)) + +### Bug Fixes +- fix: ignore messages that come in after close ([#485](https://github.com/googleapis/nodejs-pubsub/pull/485)) + +### Dependencies +- chore(deps): update dependency mocha to v6 ([#488](https://github.com/googleapis/nodejs-pubsub/pull/488)) +- fix(deps): update dependency @google-cloud/promisify to ^0.4.0 ([#478](https://github.com/googleapis/nodejs-pubsub/pull/478)) +- fix(deps): update dependency yargs to v13 ([#475](https://github.com/googleapis/nodejs-pubsub/pull/475)) +- fix(deps): update dependency duplexify to v4 ([#462](https://github.com/googleapis/nodejs-pubsub/pull/462)) +- fix(deps): update dependency google-gax to ^0.25.0 ([#456](https://github.com/googleapis/nodejs-pubsub/pull/456)) + +### Documentation +- docs: update links in contrib guide ([#479](https://github.com/googleapis/nodejs-pubsub/pull/479)) +- docs: update contributing path in README ([#471](https://github.com/googleapis/nodejs-pubsub/pull/471)) +- chore: move CONTRIBUTING.md to root ([#470](https://github.com/googleapis/nodejs-pubsub/pull/470)) +- docs: make mention of message change in changelog ([#469](https://github.com/googleapis/nodejs-pubsub/pull/469)) +- docs: add lint/fix example to contributing guide ([#464](https://github.com/googleapis/nodejs-pubsub/pull/464)) +- fix(sample): fix retry codes in retry sample code ([#458](https://github.com/googleapis/nodejs-pubsub/pull/458)) + +### Internal / Testing Changes +- test(samples): correctly handle publishTime value ([#495](https://github.com/googleapis/nodejs-pubsub/pull/495)) +- test: fix publishTime issues ([#494](https://github.com/googleapis/nodejs-pubsub/pull/494)) +- refactor(typescript): noImplicityAny for Topic test file ([#487](https://github.com/googleapis/nodejs-pubsub/pull/487)) +- refactor(ts): noImplicitAny for subscription test file ([#489](https://github.com/googleapis/nodejs-pubsub/pull/489)) +- build: use linkinator for docs test ([#477](https://github.com/googleapis/nodejs-pubsub/pull/477)) +- build: create docs test npm scripts ([#474](https://github.com/googleapis/nodejs-pubsub/pull/474)) +- build: test using @grpc/grpc-js in CI ([#472](https://github.com/googleapis/nodejs-pubsub/pull/472)) +- test: update code style of smoke test ([#463](https://github.com/googleapis/nodejs-pubsub/pull/463)) +- test: make smoke test spam less ([#459](https://github.com/googleapis/nodejs-pubsub/pull/459)) + +## v0.24.1 + +01-29-2019 13:17 PST + +### Bug Fixes + +- fix(publisher): unbound max send message size ([#454](https://github.com/googleapis/nodejs-pubsub/pull/454)) + +## v0.24.0 + +01-28-2019 09:54 PST + +### New Features +- fix(auth): pass project id to gax clients ([#447](https://github.com/googleapis/nodejs-pubsub/pull/447)) +- refactor(typescript): noImplicityAny for topic.ts and subscription.ts ([#420](https://github.com/googleapis/nodejs-pubsub/pull/420)) +- refactor: improve subscriber error handling ([#440](https://github.com/googleapis/nodejs-pubsub/pull/440)) +- feat(subscription): auto close sub on non-recoverable errors ([#441](https://github.com/googleapis/nodejs-pubsub/pull/441)) + +### Dependencies +- chore(deps): update dependency eslint-config-prettier to v4 ([#450](https://github.com/googleapis/nodejs-pubsub/pull/450)) +- fix(deps): update dependency google-gax to ^0.24.0 ([#444](https://github.com/googleapis/nodejs-pubsub/pull/444)) +- fix(deps): update dependency google-auth-library to v3 ([#433](https://github.com/googleapis/nodejs-pubsub/pull/433)) + +### Documentation +- build: ignore googleapis.com in doc link check ([#439](https://github.com/googleapis/nodejs-pubsub/pull/439)) +- chore: update year in the license headers. ([#434](https://github.com/googleapis/nodejs-pubsub/pull/434)) + +### Internal / Testing Changes +- chore: remove trailing whitespace in package.json +- fix(sample): factor setTimeout jitter into assertion ([#449](https://github.com/googleapis/nodejs-pubsub/pull/449)) +- fix(test): broken snapshot test hook ([#448](https://github.com/googleapis/nodejs-pubsub/pull/448)) + +## v0.23.0 + +01-16-2019 13:09 PST + +**This release has breaking changes.** + +#### BREAKING: `Topic#publisher()` has been removed in favor of `Topic#publish()` ([#426](https://github.com/googleapis/nodejs-pubsub/pull/426)) + +Before +```js +const publisher = topic.publisher(publishOptions); +await publisher.publish(Buffer.from('Hello, world!')); +``` + +After +```js +topic.setPublishOptions(publishOptions); +await topic.publish(Buffer.from('Hello, world!')); +``` + +#### BREAKING: `Subscription` options have changed. ([#388](https://github.com/googleapis/nodejs-pubsub/pull/388)) + +Before +```js +const subscription = topic.subscription('my-sub', { + batching: { + maxMilliseconds: 100, + }, + flowControl: { + maxBytes: os.freem() * 0.2, + maxMessages: 100, + }, + maxConnections: 5, +}); +``` + +After +```js +const subscription = topic.subscription('my-sub', { + ackDeadline: 10, + batching: { + callOptions: {}, // gax call options + maxMessages: 3000, + maxMilliseconds: 100, + }, + flowControl: { + allowExcessMessages: true, + maxBytes: os.freem() * 0.2, + maxExtension: Infinity, + maxMessages: 100 + }, + streamingOptions: { + highWaterMark: 0, + maxStreams: 5, // formerly known as maxConnections + timeout: 60000 * 5, // 5 minutes + } +}); +``` + +#### BREAKING: messages are no longer plain objects. ([#388](https://github.com/googleapis/nodejs-pubsub/pull/388)) + +Messages were refactored into a [class](https://github.com/googleapis/nodejs-pubsub/blob/52305c7ee5bbc9caba1369a45ae7fdcdeba1c89b/src/subscriber.ts#L59), +this will only affect (some) users who treat messages like plain old objects. + +The following example is something that would have worked previously, but will +now throw a `TypeError` since `ack` lives on the prototype chain. + +```js +const m = Object.assign({}, message, customData); +m.ack(); // TypeError: m.ack is not a function +``` + +### New Features +- feat(topic): create method for publishing json ([#430](https://github.com/googleapis/nodejs-pubsub/pull/430)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.23.0 ([#423](https://github.com/googleapis/nodejs-pubsub/pull/423)) +- chore(deps): update dependency @types/sinon to v7 ([#411](https://github.com/googleapis/nodejs-pubsub/pull/411)) +- chore: update nyc and eslint configs ([#409](https://github.com/googleapis/nodejs-pubsub/pull/409)) + +### Documentation +- docs(samples): correct publish retry settings ([#419](https://github.com/googleapis/nodejs-pubsub/pull/419)) +- docs: sync generated grpc message type docs +- fix(docs): remove unused long running operations and IAM types +- fix: modernize the sample tests ([#414](https://github.com/googleapis/nodejs-pubsub/pull/414)) + +### Internal / Testing Changes +- chore: update subscriber gapic +- fix: add getSubscriberStub to synth file ([#425](https://github.com/googleapis/nodejs-pubsub/pull/425)) +- build: check broken links in generated docs ([#416](https://github.com/googleapis/nodejs-pubsub/pull/416)) +- chore(build): inject yoshi automation key ([#410](https://github.com/googleapis/nodejs-pubsub/pull/410)) +- chore: fix publish.sh permission +x ([#406](https://github.com/googleapis/nodejs-pubsub/pull/406)) +- fix(build): fix Kokoro release script ([#404](https://github.com/googleapis/nodejs-pubsub/pull/404)) + +## v0.22.2 + +12-10-2018 09:37 PST + +### Implementation Changes +*TypeScript related changes:* +- fix(ts): copy gapic code properly ([#399](https://github.com/googleapis/nodejs-pubsub/pull/399)) + +### Documentation +- fix(docs): add subscription expiration policy docs ([#400](https://github.com/googleapis/nodejs-pubsub/pull/400)) +- Add migration for v0.20.0 from v0.19.0 ([#398](https://github.com/googleapis/nodejs-pubsub/pull/398)) + +## v0.22.1 + +12-06-2018 17:11 PST + +### Dependencies +- chore(deps): update dependency typescript to ~3.2.0 ([#380](https://github.com/googleapis/nodejs-pubsub/pull/380)) + +### Documentation +- fix(docs): place doc comment above the last overload ([#393](https://github.com/googleapis/nodejs-pubsub/pull/393)) +- docs: Update documentation for Subscription ([#387](https://github.com/googleapis/nodejs-pubsub/pull/387)) +- docs: Add documentation about defaults for publisher ([#384](https://github.com/googleapis/nodejs-pubsub/pull/384)) +- docs: update readme badges ([#383](https://github.com/googleapis/nodejs-pubsub/pull/383)) + +### Internal / Testing Changes +- chore: always nyc report before calling codecov ([#392](https://github.com/googleapis/nodejs-pubsub/pull/392)) +- chore: nyc ignore build/test by default ([#391](https://github.com/googleapis/nodejs-pubsub/pull/391)) +- chore: update license file ([#386](https://github.com/googleapis/nodejs-pubsub/pull/386)) + +## v0.22.0 + +### Implementation Changes +- fix(ts): do not ship types ([#377](https://github.com/googleapis/nodejs-pubsub/pull/377)) + +#### Road to TypeScript +- refactor(ts): improve types (2) ([#356](https://github.com/googleapis/nodejs-pubsub/pull/356)) +- refactor(ts): updated lint and fix command to cover gts ([#375](https://github.com/googleapis/nodejs-pubsub/pull/375)) +- refactor(ts): added ts style fix for src/iam.ts ([#352](https://github.com/googleapis/nodejs-pubsub/pull/352)) +- refactor(ts): Added ts style fix for test/topic.ts ([#373](https://github.com/googleapis/nodejs-pubsub/pull/373)) +- refactor(ts): Added ts style fix for test/subscription.ts ([#372](https://github.com/googleapis/nodejs-pubsub/pull/372)) +- refactor(ts): Added ts style fix for test/subscriber.ts ([#371](https://github.com/googleapis/nodejs-pubsub/pull/371)) +- refactor(ts): Added ts style fix for test/snapshot.ts ([#370](https://github.com/googleapis/nodejs-pubsub/pull/370)) +- refactor(ts): Added ts style fix for test/publisher.ts ([#369](https://github.com/googleapis/nodejs-pubsub/pull/369)) +- refactor(ts): added ts style fix for src/index.ts ([#351](https://github.com/googleapis/nodejs-pubsub/pull/351)) +- refactor(ts): added ts style fix for src/publisher.ts ([#357](https://github.com/googleapis/nodejs-pubsub/pull/357)) +- refactor(ts): added ts style fix for src/snapshot.ts ([#358](https://github.com/googleapis/nodejs-pubsub/pull/358)) +- refactor(ts): added ts style fix for src/subscriber.ts ([#359](https://github.com/googleapis/nodejs-pubsub/pull/359)) +- refactor(ts): added ts style fix for src/subscription.ts ([#360](https://github.com/googleapis/nodejs-pubsub/pull/360)) +- refactor(ts): added ts style fix for src/topic.ts ([#361](https://github.com/googleapis/nodejs-pubsub/pull/361)) +- refactor(ts): added ts style fix for src/util.ts ([#362](https://github.com/googleapis/nodejs-pubsub/pull/362)) +- refactor(ts): added ts style fix for test/connection-pool.ts ([#364](https://github.com/googleapis/nodejs-pubsub/pull/364)) +- refactor(ts): added ts style fix for test/histogram.ts ([#365](https://github.com/googleapis/nodejs-pubsub/pull/365)) +- refactor(ts): added ts style fix for test/iam.ts ([#366](https://github.com/googleapis/nodejs-pubsub/pull/366)) +- refactor(ts): added ts style fix for test/index.ts ([#368](https://github.com/googleapis/nodejs-pubsub/pull/368)) +- refactor(ts): added ts style fix for src/connection-pool.ts ([#353](https://github.com/googleapis/nodejs-pubsub/pull/353)) +- refactor(ts): added ts style fix for src/histogram.ts ([#354](https://github.com/googleapis/nodejs-pubsub/pull/354)) +- refactor(ts): enable noImplicitAny on src/iam.ts ([#348](https://github.com/googleapis/nodejs-pubsub/pull/348)) +- added ts style fix for system-test/pubsub.ts ([#374](https://github.com/googleapis/nodejs-pubsub/pull/374)) +- chore: ts-ignoring some stuff in tests ([#343](https://github.com/googleapis/nodejs-pubsub/pull/343)) + +### Dependencies +- fix: Pin @types/sinon to last compatible version ([#345](https://github.com/googleapis/nodejs-pubsub/pull/345)) +- chore(deps): update dependency @types/sinon to v5.0.7 ([#349](https://github.com/googleapis/nodejs-pubsub/pull/349)) + +### Documentation +- docs(samples): Publish with Retry Setting Example ([#355](https://github.com/googleapis/nodejs-pubsub/pull/355)) +- docs: remove outdated comments ([#342](https://github.com/googleapis/nodejs-pubsub/pull/342)) + +### Internal / Testing Changes +- chore: add a synth.metadata +- feat: Add optional delay when calling nack() ([#255](https://github.com/googleapis/nodejs-pubsub/pull/255)) ([#256](https://github.com/googleapis/nodejs-pubsub/pull/256)) + +## v0.21.1 + +### Bug fixes +- fix: include protos in the package ([#336](https://github.com/googleapis/nodejs-pubsub/pull/336)) + +## v0.21.0 + +11-12-2018 17:25 PST + +### Implementation Changes + +**BREAKING CHANGE** +`@google-cloud/pubsub` now uses ES6 import/export syntax since v0.21.0. + +Before: +```javascript +const pubsub = require('@google-cloud/pubsub')(); +// OR +const PubSub = require('@google-cloud/pubsub'); +const pubsub = new PubSub(); +``` +Now: +```javascript +const {PubSub} = require('@google-cloud/pubsub'); +const pubsub = new PubSub(); +``` + +- refactor: use Object.assign where possible ([#324](https://github.com/googleapis/nodejs-pubsub/pull/324)) +- fix(subscription): promisify Subscription#close ([#282](https://github.com/googleapis/nodejs-pubsub/pull/282)) +- fix: maxBytes batching sending empty messages ([#281](https://github.com/googleapis/nodejs-pubsub/pull/281)) +- (New) Synchronous Pull with Lease Management ([#272](https://github.com/googleapis/nodejs-pubsub/pull/272)) +- Switch to let/const ([#254](https://github.com/googleapis/nodejs-pubsub/pull/254)) + +#### Road to TypeScript +- refactor(ts): introduce a round of types ([#319](https://github.com/googleapis/nodejs-pubsub/pull/319)) +- refactor(ts): enable noImplicitThis ([#316](https://github.com/googleapis/nodejs-pubsub/pull/316)) +- refactor(ts): convert to typescript ([#310](https://github.com/googleapis/nodejs-pubsub/pull/310)) + +### New Features +- feat: add expiration policy ([#287](https://github.com/googleapis/nodejs-pubsub/pull/287)) + +### Dependencies +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#274](https://github.com/googleapis/nodejs-pubsub/pull/274)) +- fix(deps): update dependency google-proto-files to ^0.17.0 ([#284](https://github.com/googleapis/nodejs-pubsub/pull/284)) +- chore(deps): update dependency sinon to v7 ([#285](https://github.com/googleapis/nodejs-pubsub/pull/285)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#300](https://github.com/googleapis/nodejs-pubsub/pull/300)) +- fix(deps): update dependency through2 to v3 ([#320](https://github.com/googleapis/nodejs-pubsub/pull/320)) +- refactor: drop dependencies on google-proto-files and async ([#329](https://github.com/googleapis/nodejs-pubsub/pull/329)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#328](https://github.com/googleapis/nodejs-pubsub/pull/328)) +- chore(deps): update dependency @types/is to v0.0.21 ([#323](https://github.com/googleapis/nodejs-pubsub/pull/323)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#252](https://github.com/googleapis/nodejs-pubsub/pull/252)) + +### Documentation +- fix quickstart tag in v0.20 docs ([#271](https://github.com/googleapis/nodejs-pubsub/pull/271)) + +### Samples +- Pub/Sub Synchronous Pull Example ([#259](https://github.com/googleapis/nodejs-pubsub/pull/259)) +- Update sample topic and subscription names +- Add Pub/Sub ack deadline example ([#315](https://github.com/googleapis/nodejs-pubsub/pull/315)) +- docs(samples): update samples to use async/await ([#305](https://github.com/googleapis/nodejs-pubsub/pull/305)) +- chore: adjust samples timeout ([#283](https://github.com/googleapis/nodejs-pubsub/pull/283)) +- Fix the topic name in the samples ([#262](https://github.com/googleapis/nodejs-pubsub/pull/262)) + +### Internal / Testing Changes +- chore: update eslintignore config ([#332](https://github.com/googleapis/nodejs-pubsub/pull/332)) +- chore(build): eslint all js files, and use js for all generated files ([#331](https://github.com/googleapis/nodejs-pubsub/pull/331)) +- chore: drop contributors from multiple places ([#325](https://github.com/googleapis/nodejs-pubsub/pull/325)) +- chore: use latest npm on Windows ([#322](https://github.com/googleapis/nodejs-pubsub/pull/322)) +- chore: update CircleCI config ([#309](https://github.com/googleapis/nodejs-pubsub/pull/309)) +- chore: include build in eslintignore ([#304](https://github.com/googleapis/nodejs-pubsub/pull/304)) +- chore: update issue templates ([#299](https://github.com/googleapis/nodejs-pubsub/pull/299)) +- chore: remove old issue template ([#297](https://github.com/googleapis/nodejs-pubsub/pull/297)) +- build: run tests on node11 ([#296](https://github.com/googleapis/nodejs-pubsub/pull/296)) +- chores(build): do not collect sponge.xml from windows builds ([#295](https://github.com/googleapis/nodejs-pubsub/pull/295)) +- chores(build): run codecov on continuous builds ([#294](https://github.com/googleapis/nodejs-pubsub/pull/294)) +- chore: update new issue template ([#293](https://github.com/googleapis/nodejs-pubsub/pull/293)) +- build: fix codecov uploading on Kokoro ([#286](https://github.com/googleapis/nodejs-pubsub/pull/286)) +- Update kokoro config ([#275](https://github.com/googleapis/nodejs-pubsub/pull/275)) +- Update Kokoro configs ([#270](https://github.com/googleapis/nodejs-pubsub/pull/270)) +- Update kokoro config ([#269](https://github.com/googleapis/nodejs-pubsub/pull/269)) +- test: remove appveyor config ([#268](https://github.com/googleapis/nodejs-pubsub/pull/268)) +- Update CI config ([#266](https://github.com/googleapis/nodejs-pubsub/pull/266)) +- Run prettier on smoke tests ([#265](https://github.com/googleapis/nodejs-pubsub/pull/265)) +- Fix the linter ([#261](https://github.com/googleapis/nodejs-pubsub/pull/261)) +- Enable prefer-const in the eslint config ([#260](https://github.com/googleapis/nodejs-pubsub/pull/260)) +- Enable no-var in eslint ([#257](https://github.com/googleapis/nodejs-pubsub/pull/257)) + +## v0.20.1 + +### Documentation + - fix(docs): correct region tag for sample documentation (#272) + +## v0.20.0 + +### Implementation Changes + +*BREAKING CHANGE*: - fix: drop support for node.js 4.x and 9.x (#171) + + +**BREAKING CHANGE** +`@google-cloud/pubsub` now requires `new`. + +Before: +```javascript +const PubSub = require('@google-cloud/pubsub'); +const pubsub = PubSub(); +``` +Now: +```javascript +const PubSub = require('@google-cloud/pubsub'); +const pubsub = new PubSub(); +``` + +### New Features + +- Re-generate library using /synth.py (#227) + - some minor proto documentation changes + +### Dependencies + +- fix(deps): update dependency google-auth-library to v2 (#228) +- chore(deps): update dependency nyc to v13 (#225) +- fix(deps): update dependency google-gax to ^0.19.0 (#216) +- chore(deps): update dependency eslint-config-prettier to v3 (#213) +- chore: drop dependency on @google-cloud/common (#210) +- fix(deps): update dependency @google-cloud/common to ^0.21.0 (#206) +- chore(deps): lock file maintenance (#203) +- fix(deps): update dependency google-gax to ^0.18.0 (#197) +- chore(deps): lock file maintenance (#196) +- chore(deps): lock file maintenance (#188) +- chore(deps): update dependency eslint-plugin-node to v7 (#185) +- chore(deps): lock file maintenance (#182) +- chore(deps): lock file maintenance (#174) +- chore(deps): lock file maintenance (#173) +- chore(deps): lock file maintenance (#172) +- chore(deps): lock file maintenance (#168) +- chore(deps): lock file maintenance (#167) +- chore(deps): lock file maintenance (#166) +- fix(deps): update dependency delay to v3 (#165) +- fix(deps): update dependency @google-cloud/common to ^0.20.0 (#155) +- chore(deps): update dependency proxyquire to v2 (#160) +- chore(deps): update dependency nyc to v12 (#159) +- Update google-gax and add Synth.py (#158) +- chore(deps): update dependency sinon to v6 (#161) +- fix(deps): update dependency yargs to v12 (#164) +- fix(deps): update dependency yargs to v11 (#163) +- fix(deps): update dependency yargs to v10.1.2 (#157) +- chore(deps): update dependency ava to ^0.25.0 (#153) +- chore(deps): update dependency sinon to v4.5.0 (#154) + +### Documentation + +- fix docs (#229) +- test: fix import sample failures (#218) +- fix: correct the documentation (#117) +- fix: Fix sample region tag in JSDoc (#184) +- Fixes 179: Adds missing return statement in docs (#180) + +### Internal / Testing Changes + +- Update the CI config (#220) +- chore: make the CircleCI config consistent +- chore: use arrow functions (#215) +- chore: convert to es classes (#211) +- chore: do not use npm ci (#209) +- chore: use let and const (#204) +- chore: ignore package-lock.json (#207) +- chore: use split common modules (#200) +- chore: update renovate config (#199) +- chore: move mocha options to mocha.opts (#194) +- chore: require node 8 for samples (#195) +- chore: add node templates to synth.py (#191) +- chore: fix the eslint errors (#190) +- refactor: use google-auth-library (#189) +- Fixes 177: Prevents publishing attributes that have non-string values (#183) +- chore(build): use `npm ci` instead of `npm install` (#175) +- chore(package): update eslint to version 5.0.0 (#145) +- chore: update sample lockfiles (#149) +- test: use strictEqual in tests (#186) +- Configure Renovate (#144) +- refactor: drop repo-tool as an exec wrapper (#150) +- fix: update linking for samples (#146) diff --git a/handwritten/pubsub/CODE_OF_CONDUCT.md b/handwritten/pubsub/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/handwritten/pubsub/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/handwritten/pubsub/CONTRIBUTING.md b/handwritten/pubsub/CONTRIBUTING.md new file mode 100644 index 00000000000..ddc61938c5b --- /dev/null +++ b/handwritten/pubsub/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Pub/Sub API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/handwritten/pubsub/LICENSE b/handwritten/pubsub/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/handwritten/pubsub/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/handwritten/pubsub/README.md b/handwritten/pubsub/README.md new file mode 100644 index 00000000000..9c27ffdc040 --- /dev/null +++ b/handwritten/pubsub/README.md @@ -0,0 +1,268 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Pub/Sub: Node.js Client](https://github.com/googleapis/nodejs-pubsub) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/pubsub.svg)](https://www.npmjs.com/package/@google-cloud/pubsub) + + + + +[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows +you to send and receive messages between independent applications. + +This document contains links to an [API reference](https://cloud.google.com/nodejs/docs/reference/pubsub/latest/overview), samples, +and other resources useful to developing Node.js applications. +For additional help developing Pub/Sub applications, in Node.js and other languages, see our +[Pub/Sub quickstart](https://cloud.google.com/pubsub/docs/quickstart-client-libraries), +[publisher](https://cloud.google.com/pubsub/docs/publisher), and [subscriber](https://cloud.google.com/pubsub/docs/subscriber) +guides. + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-pubsub/blob/main/CHANGELOG.md). + +* [Google Cloud Pub/Sub Node.js Client API Reference][client-docs] +* [Google Cloud Pub/Sub Documentation][product-docs] +* [github.com/googleapis/nodejs-pubsub](https://github.com/googleapis/nodejs-pubsub) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Pub/Sub API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/pubsub +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {PubSub} = require('@google-cloud/pubsub'); + +async function quickstart( + projectId = 'your-project-id', // Your Google Cloud Platform project ID + topicNameOrId = 'my-topic', // Name for the new topic to create + subscriptionName = 'my-sub', // Name for the new subscription to create +) { + // Instantiates a client + const pubsub = new PubSub({projectId}); + + // Creates a new topic + const [topic] = await pubsub.createTopic(topicNameOrId); + console.log(`Topic ${topic.name} created.`); + + // Creates a subscription on that new topic + const [subscription] = await topic.createSubscription(subscriptionName); + + // Receive callbacks for new messages on the subscription + subscription.on('message', message => { + console.log('Received message:', message.data.toString()); + process.exit(0); + }); + + // Receive callbacks for errors on the subscription + subscription.on('error', error => { + console.error('Received error:', error); + process.exit(1); + }); + + // Send a message to the topic + await topic.publishMessage({data: Buffer.from('Test message!')}); +} + +``` +## Running gRPC C++ bindings + +For some workflows and environments it might make sense to use the C++ gRPC implementation, +instead of the default one (see: [#770](https://github.com/googleapis/nodejs-pubsub/issues/770)): + +To configure `@google-cloud/pubsub` to use an alternative `grpc` transport: + +1. `npm install grpc`, adding `grpc` as a dependency. +1. instantiate `@google-cloud/pubsub` with `grpc`: + + ```js + const {PubSub} = require('@google-cloud/pubsub'); + const grpc = require('grpc'); + const pubsub = new PubSub({grpc}); + ``` + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Close Subscription with Timeout | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/closeSubscriptionWithTimeout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/closeSubscriptionWithTimeout.js,samples/README.md) | +| Commit an Avro-Based Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/commitAvroSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/commitAvroSchema.js,samples/README.md) | +| Commit an Proto-Based Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/commitProtoSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/commitProtoSchema.js,samples/README.md) | +| Create an Avro based Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createAvroSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createAvroSchema.js,samples/README.md) | +| Create BigQuery Subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createBigQuerySubscription.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createBigQuerySubscription.js,samples/README.md) | +| Create a Proto based Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createProtoSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createProtoSchema.js,samples/README.md) | +| Create Push Subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createPushSubscription.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createPushSubscription.js,samples/README.md) | +| Create Push Subscription With No Wrapper | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createPushSubscriptionNoWrapper.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createPushSubscriptionNoWrapper.js,samples/README.md) | +| Create Subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscription.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscription.js,samples/README.md) | +| Create a Cloud Storage subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithCloudStorage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithCloudStorage.js,samples/README.md) | +| Create Subscription With Dead Letter Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithDeadLetterPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithDeadLetterPolicy.js,samples/README.md) | +| Create an exactly-once delivery subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithExactlyOnceDelivery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithExactlyOnceDelivery.js,samples/README.md) | +| Create Subscription With Filtering | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithFiltering.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithFiltering.js,samples/README.md) | +| Create Subscription with ordering enabled | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithOrdering.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithOrdering.js,samples/README.md) | +| Create Subscription With Retry Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithRetryPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithRetryPolicy.js,samples/README.md) | +| Create Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopic.js,samples/README.md) | +| Create Topic With AWS MSK Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithAwsMskIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithAwsMskIngestion.js,samples/README.md) | +| Create Topic With Azure Event Hubs Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithAzureEventHubsIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithAzureEventHubsIngestion.js,samples/README.md) | +| Create Topic With Cloud Storage Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithCloudStorageIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithCloudStorageIngestion.js,samples/README.md) | +| Create Topic With Confluent Cloud Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithConfluentCloudIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithConfluentCloudIngestion.js,samples/README.md) | +| Create Topic With Kinesis Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithKinesisIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithKinesisIngestion.js,samples/README.md) | +| Create Topic With Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithSchema.js,samples/README.md) | +| Create Topic With Schema Revisions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithSchemaRevisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithSchemaRevisions.js,samples/README.md) | +| Delete a previously created schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/deleteSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/deleteSchema.js,samples/README.md) | +| Delete a Schema Revision | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/deleteSchemaRevision.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/deleteSchemaRevision.js,samples/README.md) | +| Delete Subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/deleteSubscription.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/deleteSubscription.js,samples/README.md) | +| Delete Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/deleteTopic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/deleteTopic.js,samples/README.md) | +| Detach Subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/detachSubscription.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/detachSubscription.js,samples/README.md) | +| Get a previously created schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/getSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/getSchema.js,samples/README.md) | +| Get a previously created schema revision | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/getSchemaRevision.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/getSchemaRevision.js,samples/README.md) | +| Get Subscription | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/getSubscription.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/getSubscription.js,samples/README.md) | +| Get Subscription Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/getSubscriptionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/getSubscriptionPolicy.js,samples/README.md) | +| Get Topic Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/getTopicPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/getTopicPolicy.js,samples/README.md) | +| List All Topics | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listAllTopics.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listAllTopics.js,samples/README.md) | +| List Revisions on a Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listSchemaRevisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listSchemaRevisions.js,samples/README.md) | +| List schemas on a project | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listSchemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listSchemas.js,samples/README.md) | +| List Subscriptions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listSubscriptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listSubscriptions.js,samples/README.md) | +| List Subscriptions On a Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listTopicSubscriptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listTopicSubscriptions.js,samples/README.md) | +| Listen For Avro Records | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForAvroRecords.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenForAvroRecords.js,samples/README.md) | +| Listen For Avro Records With Revisions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForAvroRecordsWithRevisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenForAvroRecordsWithRevisions.js,samples/README.md) | +| Listen For Errors | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForErrors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenForErrors.js,samples/README.md) | +| Listen For Messages | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForMessages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenForMessages.js,samples/README.md) | +| Listen with exactly-once delivery | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForMessagesWithExactlyOnceDelivery.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenForMessagesWithExactlyOnceDelivery.js,samples/README.md) | +| Listen For Protobuf Messages | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForProtobufMessages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenForProtobufMessages.js,samples/README.md) | +| Listen For Messages With Custom Attributes | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenWithCustomAttributes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenWithCustomAttributes.js,samples/README.md) | +| Subscribe with OpenTelemetry Tracing | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenWithOpenTelemetryTracing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenWithOpenTelemetryTracing.js,samples/README.md) | +| Modify Push Configuration | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/modifyPushConfig.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/modifyPushConfig.js,samples/README.md) | +| Optimistic Subscribe | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/optimisticSubscribe.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/optimisticSubscribe.js,samples/README.md) | +| Publish Avro Records to a Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishAvroRecords.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishAvroRecords.js,samples/README.md) | +| Publish Batched Messages | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishBatchedMessages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishBatchedMessages.js,samples/README.md) | +| Publish Message | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishMessage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishMessage.js,samples/README.md) | +| Publish Message With Custom Attributes | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishMessageWithCustomAttributes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishMessageWithCustomAttributes.js,samples/README.md) | +| Publish Ordered Message | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishOrderedMessage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishOrderedMessage.js,samples/README.md) | +| Publish Protobuf Messages to a Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishProtobufMessages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishProtobufMessages.js,samples/README.md) | +| Publish with flow control | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishWithFlowControl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishWithFlowControl.js,samples/README.md) | +| Publish with OpenTelemetry Tracing | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishWithOpenTelemetryTracing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishWithOpenTelemetryTracing.js,samples/README.md) | +| Publish With Retry Settings | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishWithRetrySettings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishWithRetrySettings.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Remove Dead Letter Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/removeDeadLetterPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/removeDeadLetterPolicy.js,samples/README.md) | +| Resume Publish | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/resumePublish.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/resumePublish.js,samples/README.md) | +| Rollback a Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/rollbackSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/rollbackSchema.js,samples/README.md) | +| Set Subscription IAM Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/setSubscriptionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/setSubscriptionPolicy.js,samples/README.md) | +| Set Topic IAM Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/setTopicPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/setTopicPolicy.js,samples/README.md) | +| Subscribe With Flow Control Settings | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/subscribeWithFlowControlSettings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/subscribeWithFlowControlSettings.js,samples/README.md) | +| Synchronous Pull | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/synchronousPull.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/synchronousPull.js,samples/README.md) | +| Synchronous Pull with delivery attempt. | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/synchronousPullWithDeliveryAttempts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/synchronousPullWithDeliveryAttempts.js,samples/README.md) | +| Synchronous Pull With Lease Management | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/synchronousPullWithLeaseManagement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/synchronousPullWithLeaseManagement.js,samples/README.md) | +| Test Subscription Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/testSubscriptionPermissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/testSubscriptionPermissions.js,samples/README.md) | +| Test Topic Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/testTopicPermissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/testTopicPermissions.js,samples/README.md) | +| Update Dead Letter Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateDeadLetterPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/updateDeadLetterPolicy.js,samples/README.md) | +| Update Topic Ingestion Type | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateTopicIngestionType.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/updateTopicIngestionType.js,samples/README.md) | +| Update Topic Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateTopicSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/updateTopicSchema.js,samples/README.md) | +| Validate a schema definition | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/validateSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/validateSchema.js,samples/README.md) | + + + +The [Google Cloud Pub/Sub Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/pubsub@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-pubsub/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-pubsub/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/pubsub/latest +[product-docs]: https://cloud.google.com/pubsub/docs/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local \ No newline at end of file diff --git a/handwritten/pubsub/bin/README.md b/handwritten/pubsub/bin/README.md new file mode 100644 index 00000000000..c7e6274589e --- /dev/null +++ b/handwritten/pubsub/bin/README.md @@ -0,0 +1,13 @@ +# benchwrapper + +benchwrapper is a lightweight gRPC server that wraps the pubsub library for +bencharmking purposes. + +## Running + +``` +cd nodejs-pubsub +npm install +export PUBSUB_EMULATOR_HOST=localhost:8080 +npm run benchwrapper -- --port 50051 +``` diff --git a/handwritten/pubsub/bin/benchwrapper.js b/handwritten/pubsub/bin/benchwrapper.js new file mode 100644 index 00000000000..f272b4ccfd9 --- /dev/null +++ b/handwritten/pubsub/bin/benchwrapper.js @@ -0,0 +1,80 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {grpc} = require('google-gax'); +const protoLoader = require('@grpc/proto-loader'); +const {PubSub} = require('../build/src'); + +const argv = require('yargs') + .option('port', { + description: 'The port that the Node.js benchwrapper should run on.', + type: 'number', + demand: true, + }) + .parse(); + +const PROTO_PATH = __dirname + '/pubsub.proto'; +// Suggested options for similarity to existing grpc.load behavior. +const packageDefinition = protoLoader.loadSync(PROTO_PATH, { + keepCase: true, + longs: String, + enums: String, + defaults: true, + oneofs: true, +}); +const protoDescriptor = grpc.loadPackageDefinition(packageDefinition); +const pubsubBenchWrapper = protoDescriptor.pubsub_bench; + +const client = new PubSub(); + +function recv(call, callback) { + const subName = call.request.sub_name; + + const sub = client.subscription(subName); + + sub.setOptions({ + streamingOptions: { + maxStreams: 1, + }, + }); + + sub.on('message', message => { + message.ack(); + }); + + sub.on('error', () => { + // We look for an error here since we expect the server + // the close the stream with an grpc "OK" error, which + // indicates a successfully closed stream. + callback(null, null); + }); +} + +const server = new grpc.Server(); + +server.addService(pubsubBenchWrapper['PubsubBenchWrapper']['service'], { + Recv: recv, +}); +console.log(`starting on localhost:${argv.port}`); +server.bindAsync( + `0.0.0.0:${argv.port}`, + grpc.ServerCredentials.createInsecure(), + err => { + if (err) { + throw err; + } else { + server.start(); + } + }, +); diff --git a/handwritten/pubsub/bin/pubsub.proto b/handwritten/pubsub/bin/pubsub.proto new file mode 100644 index 00000000000..0c3e50d7f76 --- /dev/null +++ b/handwritten/pubsub/bin/pubsub.proto @@ -0,0 +1,32 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 pubsub_bench; + +option java_multiple_files = true; + +message PubsubRecv { + // The subscription identifier corresponding to number of messages sent. + string sub_name = 1; +} + +// TODO(deklerk): Replace with Google's canonical Empty. +message EmptyResponse {} + +service PubsubBenchWrapper { + // Recv represents opening a streaming pull stream to receive messages on. + rpc Recv(PubsubRecv) returns (EmptyResponse) {} +} diff --git a/handwritten/pubsub/helperMethods.ts.tmpl b/handwritten/pubsub/helperMethods.ts.tmpl new file mode 100644 index 00000000000..773675cf9f4 --- /dev/null +++ b/handwritten/pubsub/helperMethods.ts.tmpl @@ -0,0 +1,33 @@ + /** + * This part will be added into src/v1/key_management_service_client.ts by synth.py. + * KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. + * But we don't support it now in micro-generators for rerouting one service to another and mix them in. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + * + * So this is manually written for providing methods to the KMS client. + * IamClient is created for KMS client in the constructor using src/helper.ts. + * [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. + */ + + getIamPolicy( + request: protos.google.iam.v1.GetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ) { + return this._iamClient.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protos.google.iam.v1.SetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ) { + return this._iamClient.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protos.google.iam.v1.TestIamPermissionsRequest, + options: gax.CallOptions, + callback?: protos.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ) { + return this._iamClient.testIamPermissions(request, options, callback); + } +} diff --git a/handwritten/pubsub/linkinator.config.json b/handwritten/pubsub/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/handwritten/pubsub/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/handwritten/pubsub/owlbot.py b/handwritten/pubsub/owlbot.py new file mode 100644 index 00000000000..67e7eb9d884 --- /dev/null +++ b/handwritten/pubsub/owlbot.py @@ -0,0 +1,28 @@ +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 synthtool.languages.node_mono_repo as node + +# Main OwlBot processing. +node.owlbot_main(relative_dir="handwritten/pubsub",templates_excludes=[ + 'src/index.ts', + '.github/PULL_REQUEST_TEMPLATE.md', + '.github/release-please.yml', + '.github/header-checker-lint.yaml', + '.github/workflows/ci.yaml', + '.eslintignore', + '.OwlBot.yaml', + 'renovate.json', + "README.md" +]) diff --git a/handwritten/pubsub/package.json b/handwritten/pubsub/package.json new file mode 100644 index 00000000000..617dabc9f63 --- /dev/null +++ b/handwritten/pubsub/package.json @@ -0,0 +1,115 @@ +{ + "name": "@google-cloud/pubsub", + "description": "Cloud Pub/Sub Client Library for Node.js", + "version": "5.3.0", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=18" + }, + "repository": { + "type": "git", + "directory": "handwritten/pubsub", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "main": "./build/src/index.js", + "types": "./build/src/index.d.ts", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google pubsub", + "pubsub" + ], + "scripts": { + "presystem-test": "npm run compile", + "system-test": "mocha build/system-test --timeout 600000", + "samples-test": "npm run link-samples && npm test && cd ../", + "link-samples": "cd samples/ && npm link ../ && npm install", + "test": "c8 mocha build/test --recursive", + "lint": "gts check", + "predocs": "npm run compile", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile-protos && npm run compile", + "pretest": "npm run compile", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "benchwrapper": "node bin/benchwrapper.js", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "@google-cloud/paginator": "^6.0.0", + "@google-cloud/precise-date": "^5.0.0", + "@google-cloud/projectify": "^5.0.0", + "@google-cloud/promisify": "^5.0.0", + "@opentelemetry/api": "~1.9.0", + "@opentelemetry/core": "^1.30.1", + "@opentelemetry/semantic-conventions": "~1.39.0", + "arrify": "^2.0.0", + "extend": "^3.0.2", + "google-auth-library": "^10.5.0", + "google-gax": "^5.0.5", + "google-logging-utils": "^1.1.3", + "heap-js": "^2.6.0", + "is-stream-ended": "^0.1.4", + "lodash.snakecase": "^4.1.1", + "long": "^5.3.1", + "p-defer": "^3.0.0" + }, + "devDependencies": { + "@grpc/proto-loader": "^0.8.0", + "@opentelemetry/sdk-trace-base": "^1.17.0", + "@types/duplexify": "^3.6.4", + "@types/extend": "^3.0.4", + "@types/lodash.snakecase": "^4.1.9", + "@types/mocha": "^10.0.10", + "@types/mv": "^2.1.4", + "@types/ncp": "^2.0.8", + "@types/node": "^24.0.0", + "@types/proxyquire": "^1.3.31", + "@types/sinon": "^21.0.0", + "@types/tmp": "^0.2.6", + "@types/uuid": "^11.0.0", + "c8": "^10.1.3", + "codecov": "^3.8.3", + "execa": "~5.1.0", + "gapic-tools": "^1.0.1", + "gts": "^6.0.0", + "jsdoc": "^4.0.4", + "jsdoc-fresh": "^5.0.0", + "jsdoc-region-tag": "^4.0.0", + "linkinator": "^6.1.2", + "mocha": "^11.1.0", + "mv": "^2.1.1", + "ncp": "^2.0.0", + "nise": "^6.1.1", + "null-loader": "^4.0.1", + "path-to-regexp": "^8.2.0", + "protobufjs": "~7.5.0", + "proxyquire": "^2.1.3", + "sinon": "^21.0.0", + "tmp": "^0.2.3", + "ts-loader": "^9.5.2", + "typescript": "^5.8.3", + "uuid": "^11.1.0", + "webpack": "^5.99.5", + "webpack-cli": "^6.0.1", + "why-is-node-running": "^2.3.0", + "yargs": "^17.7.2" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/handwritten/pubsub" +} diff --git a/handwritten/pubsub/protos/google/pubsub/v1/pubsub.proto b/handwritten/pubsub/protos/google/pubsub/v1/pubsub.proto new file mode 100644 index 00000000000..b542351d9d6 --- /dev/null +++ b/handwritten/pubsub/protos/google/pubsub/v1/pubsub.proto @@ -0,0 +1,2445 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.pubsub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/pubsub/v1/schema.proto"; + +option csharp_namespace = "Google.Cloud.PubSub.V1"; +option go_package = "cloud.google.com/go/pubsub/v2/apiv1/pubsubpb;pubsubpb"; +option java_multiple_files = true; +option java_outer_classname = "PubsubProto"; +option java_package = "com.google.pubsub.v1"; +option php_namespace = "Google\\Cloud\\PubSub\\V1"; +option ruby_package = "Google::Cloud::PubSub::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "analyticshub.googleapis.com/Listing" + pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" +}; + +// The service that an application uses to manipulate topics, and to send +// messages to a topic. +service Publisher { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates the given topic with the given name. See the [resource name rules] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + rpc CreateTopic(Topic) returns (Topic) { + option (google.api.http) = { + put: "/v1/{name=projects/*/topics/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing topic by updating the fields specified in the update + // mask. Note that certain properties of a topic are not modifiable. + rpc UpdateTopic(UpdateTopicRequest) returns (Topic) { + option (google.api.http) = { + patch: "/v1/{topic.name=projects/*/topics/*}" + body: "*" + }; + option (google.api.method_signature) = "topic,update_mask"; + } + + // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + // does not exist. + rpc Publish(PublishRequest) returns (PublishResponse) { + option (google.api.http) = { + post: "/v1/{topic=projects/*/topics/*}:publish" + body: "*" + }; + option (google.api.method_signature) = "topic,messages"; + } + + // Gets the configuration of a topic. + rpc GetTopic(GetTopicRequest) returns (Topic) { + option (google.api.http) = { + get: "/v1/{topic=projects/*/topics/*}" + }; + option (google.api.method_signature) = "topic"; + } + + // Lists matching topics. + rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) { + option (google.api.http) = { + get: "/v1/{project=projects/*}/topics" + }; + option (google.api.method_signature) = "project"; + } + + // Lists the names of the attached subscriptions on this topic. + rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) + returns (ListTopicSubscriptionsResponse) { + option (google.api.http) = { + get: "/v1/{topic=projects/*/topics/*}/subscriptions" + }; + option (google.api.method_signature) = "topic"; + } + + // Lists the names of the snapshots on this topic. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc ListTopicSnapshots(ListTopicSnapshotsRequest) + returns (ListTopicSnapshotsResponse) { + option (google.api.http) = { + get: "/v1/{topic=projects/*/topics/*}/snapshots" + }; + option (google.api.method_signature) = "topic"; + } + + // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + // does not exist. After a topic is deleted, a new topic may be created with + // the same name; this is an entirely new topic with none of the old + // configuration or subscriptions. Existing subscriptions to this topic are + // not deleted, but their `topic` field is set to `_deleted-topic_`. + rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{topic=projects/*/topics/*}" + }; + option (google.api.method_signature) = "topic"; + } + + // Detaches a subscription from this topic. All messages retained in the + // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + // will return FAILED_PRECONDITION. If the subscription is a push + // subscription, pushes to the endpoint will stop. + rpc DetachSubscription(DetachSubscriptionRequest) + returns (DetachSubscriptionResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:detach" + }; + } +} + +// A policy constraining the storage of messages published to the topic. +message MessageStoragePolicy { + // Optional. A list of IDs of Google Cloud regions where messages that are + // published to the topic may be persisted in storage. Messages published by + // publishers running in non-allowed Google Cloud regions (or running outside + // of Google Cloud altogether) are routed for storage in one of the allowed + // regions. An empty list means that no regions are allowed, and is not a + // valid configuration. + repeated string allowed_persistence_regions = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, `allowed_persistence_regions` is also used to enforce + // in-transit guarantees for messages. That is, Pub/Sub will fail + // Publish operations on this topic and subscribe operations + // on any subscription attached to this topic in any region that is + // not in `allowed_persistence_regions`. + bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for validating messages published against a schema. +message SchemaSettings { + // Required. The name of the schema that messages published should be + // validated against. Format is `projects/{project}/schemas/{schema}`. The + // value of this field will be `_deleted-schema_` if the schema has been + // deleted. + string schema = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Optional. The encoding of messages validated against `schema`. + Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The minimum (inclusive) revision allowed for validating messages. + // If empty or not present, allow any revision to be validated against + // last_revision or any revision created before. + string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum (inclusive) revision allowed for validating messages. + // If empty or not present, allow any revision to be validated against + // first_revision or any revision created after. + string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for an ingestion data source on a topic. +message IngestionDataSourceSettings { + // Ingestion settings for Amazon Kinesis Data Streams. + message AwsKinesis { + // Possible states for ingestion from Amazon Kinesis Data Streams. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while consuming data from Kinesis. + // This can happen if: + // - The provided `aws_role_arn` does not exist or does not have the + // appropriate permissions attached. + // - The provided `aws_role_arn` is not set up properly for Identity + // Federation using `gcp_service_account`. + // - The Pub/Sub SA is not granted the + // `iam.serviceAccounts.getOpenIdToken` permission on + // `gcp_service_account`. + KINESIS_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. This can + // happen if the Pub/Sub SA has not been granted the [appropriate publish + // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + PUBLISH_PERMISSION_DENIED = 3; + + // The Kinesis stream does not exist. + STREAM_NOT_FOUND = 4; + + // The Kinesis consumer does not exist. + CONSUMER_NOT_FOUND = 5; + } + + // Output only. An output-only field that indicates the state of the Kinesis + // ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Kinesis stream ARN to ingest data from. + string stream_arn = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Kinesis consumer ARN to used for ingestion in Enhanced + // Fan-Out mode. The consumer must be already created and ready to be used. + string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. AWS role ARN to be used for Federated Identity authentication + // with Kinesis. Check the Pub/Sub docs for how to set up this role and the + // required permissions that need to be attached to it. + string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The GCP service account to be used for Federated Identity + // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + // the provided role). The `aws_role_arn` must be set up with + // `accounts.google.com:sub` equals to this service account number. + string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // Ingestion settings for Cloud Storage. + message CloudStorage { + // Possible states for ingestion from Cloud Storage. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while calling the Cloud Storage API. This + // can happen if the Pub/Sub SA has not been granted the + // [appropriate + // permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions): + // - storage.objects.list: to list the objects in a bucket. + // - storage.objects.get: to read the objects in a bucket. + // - storage.buckets.get: to verify the bucket exists. + CLOUD_STORAGE_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. This can + // happen if the Pub/Sub SA has not been granted the [appropriate publish + // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + PUBLISH_PERMISSION_DENIED = 3; + + // The provided Cloud Storage bucket doesn't exist. + BUCKET_NOT_FOUND = 4; + + // The Cloud Storage bucket has too many objects, ingestion will be + // paused. + TOO_MANY_OBJECTS = 5; + } + + // Configuration for reading Cloud Storage data in text format. Each line of + // text as specified by the delimiter will be set to the `data` field of a + // Pub/Sub message. + message TextFormat { + // Optional. When unset, '\n' is used. + optional string delimiter = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for reading Cloud Storage data in Avro binary format. The + // bytes of each object will be set to the `data` field of a Pub/Sub + // message. + message AvroFormat {} + + // Configuration for reading Cloud Storage data written via [Cloud Storage + // subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). The + // data and attributes fields of the originally exported Pub/Sub message + // will be restored when publishing. + message PubSubAvroFormat {} + + // Output only. An output-only field that indicates the state of the Cloud + // Storage ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Cloud Storage bucket. The bucket name must be without any + // prefix like "gs://". See the [bucket naming requirements] + // (https://cloud.google.com/storage/docs/buckets#naming). + string bucket = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Defaults to text format. + oneof input_format { + // Optional. Data from Cloud Storage will be interpreted as text. + TextFormat text_format = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data from Cloud Storage will be interpreted in Avro format. + AvroFormat avro_format = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. It will be assumed data from Cloud Storage was written via + // [Cloud Storage + // subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + PubSubAvroFormat pubsub_avro_format = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Only objects with a larger or equal creation timestamp will be + // ingested. + google.protobuf.Timestamp minimum_object_create_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Glob pattern used to match objects that will be ingested. If + // unset, all objects will be ingested. See the [supported + // patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + string match_glob = 9 [(google.api.field_behavior) = OPTIONAL]; + } + + // Ingestion settings for Azure Event Hubs. + message AzureEventHubs { + // Possible states for managed ingestion from Event Hubs. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while consuming data from Event Hubs. + // This can happen when `client_id`, or `tenant_id` are invalid. Or the + // right permissions haven't been granted. + EVENT_HUBS_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. + PUBLISH_PERMISSION_DENIED = 3; + + // The provided Event Hubs namespace couldn't be found. + NAMESPACE_NOT_FOUND = 4; + + // The provided Event Hub couldn't be found. + EVENT_HUB_NOT_FOUND = 5; + + // The provided Event Hubs subscription couldn't be found. + SUBSCRIPTION_NOT_FOUND = 6; + + // The provided Event Hubs resource group couldn't be found. + RESOURCE_GROUP_NOT_FOUND = 7; + } + + // Output only. An output-only field that indicates the state of the Event + // Hubs ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Name of the resource group within the azure subscription. + string resource_group = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the Event Hubs namespace. + string namespace = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the Event Hub. + string event_hub = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The client id of the Azure application that is being used to + // authenticate Pub/Sub. + string client_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The tenant id of the Azure application that is being used to + // authenticate Pub/Sub. + string tenant_id = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Azure subscription id. + string subscription_id = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The GCP service account to be used for Federated Identity + // authentication. + string gcp_service_account = 8 [(google.api.field_behavior) = OPTIONAL]; + } + + // Ingestion settings for Amazon MSK. + message AwsMsk { + // Possible states for managed ingestion from Amazon MSK. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while consuming data from Amazon MSK. + MSK_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. + PUBLISH_PERMISSION_DENIED = 3; + + // The provided MSK cluster wasn't found. + CLUSTER_NOT_FOUND = 4; + + // The provided topic wasn't found. + TOPIC_NOT_FOUND = 5; + } + + // Output only. An output-only field that indicates the state of the Amazon + // MSK ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Amazon Resource Name (ARN) that uniquely identifies the + // cluster. + string cluster_arn = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the topic in the Amazon MSK cluster that Pub/Sub + // will import from. + string topic = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Required. AWS role ARN to be used for Federated Identity authentication + // with Amazon MSK. Check the Pub/Sub docs for how to set up this role and + // the required permissions that need to be attached to it. + string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The GCP service account to be used for Federated Identity + // authentication with Amazon MSK (via a `AssumeRoleWithWebIdentity` call + // for the provided role). The `aws_role_arn` must be set up with + // `accounts.google.com:sub` equals to this service account number. + string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // Ingestion settings for Confluent Cloud. + message ConfluentCloud { + // Possible states for managed ingestion from Confluent Cloud. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while consuming data from Confluent + // Cloud. + CONFLUENT_CLOUD_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. + PUBLISH_PERMISSION_DENIED = 3; + + // The provided bootstrap server address is unreachable. + UNREACHABLE_BOOTSTRAP_SERVER = 4; + + // The provided cluster wasn't found. + CLUSTER_NOT_FOUND = 5; + + // The provided topic wasn't found. + TOPIC_NOT_FOUND = 6; + } + + // Output only. An output-only field that indicates the state of the + // Confluent Cloud ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The address of the bootstrap server. The format is url:port. + string bootstrap_server = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the cluster. + string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the topic in the Confluent Cloud cluster that + // Pub/Sub will import from. + string topic = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the identity pool to be used for Federated Identity + // authentication with Confluent Cloud. See + // https://docs.confluent.io/cloud/current/security/authenticate/workload-identities/identity-providers/oauth/identity-pools.html#add-oauth-identity-pools. + string identity_pool_id = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The GCP service account to be used for Federated Identity + // authentication with `identity_pool_id`. + string gcp_service_account = 6 [(google.api.field_behavior) = REQUIRED]; + } + + // Only one source type can have settings set. + oneof source { + // Optional. Amazon Kinesis Data Streams. + AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage. + CloudStorage cloud_storage = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Azure Event Hubs. + AzureEventHubs azure_event_hubs = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Amazon MSK. + AwsMsk aws_msk = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Confluent Cloud. + ConfluentCloud confluent_cloud = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Platform Logs settings. If unset, no Platform Logs will be + // generated. + PlatformLogsSettings platform_logs_settings = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for Platform Logs produced by Pub/Sub. +message PlatformLogsSettings { + // Severity levels of Platform Logs. + enum Severity { + // Default value. Logs level is unspecified. Logs will be disabled. + SEVERITY_UNSPECIFIED = 0; + + // Logs will be disabled. + DISABLED = 1; + + // Debug logs and higher-severity logs will be written. + DEBUG = 2; + + // Info logs and higher-severity logs will be written. + INFO = 3; + + // Warning logs and higher-severity logs will be written. + WARNING = 4; + + // Only error logs will be written. + ERROR = 5; + } + + // Optional. The minimum severity level of Platform Logs that will be written. + Severity severity = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Payload of the Platform Log entry sent when a failure is encountered while +// ingesting. +message IngestionFailureEvent { + // Specifies the reason why some data may have been left out of + // the desired Pub/Sub message due to the API message limits + // (https://cloud.google.com/pubsub/quotas#resource_limits). For example, + // when the number of attributes is larger than 100, the number of + // attributes is truncated to 100 to respect the limit on the attribute count. + // Other attribute limits are treated similarly. When the size of the desired + // message would've been larger than 10MB, the message won't be published at + // all, and ingestion of the subsequent messages will proceed as normal. + message ApiViolationReason {} + + // Set when an Avro file is unsupported or its format is not valid. When this + // occurs, one or more Avro objects won't be ingested. + message AvroFailureReason {} + + // Set when a Pub/Sub message fails to get published due to a schema + // validation violation. + message SchemaViolationReason {} + + // Set when a Pub/Sub message fails to get published due to a message + // transformation error. + message MessageTransformationFailureReason {} + + // Failure when ingesting from a Cloud Storage source. + message CloudStorageFailure { + // Optional. Name of the Cloud Storage bucket used for ingestion. + string bucket = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of the Cloud Storage object which contained the section + // that couldn't be ingested. + string object_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Generation of the Cloud Storage object which contained the + // section that couldn't be ingested. + int64 object_generation = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Reason why ingestion failed for the specified object. + oneof reason { + // Optional. Failure encountered when parsing an Avro file. + AvroFailureReason avro_failure_reason = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Pub/Sub API limits prevented the desired message from + // being published. + ApiViolationReason api_violation_reason = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Pub/Sub message failed schema validation. + SchemaViolationReason schema_violation_reason = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure encountered when applying a message transformation to + // the Pub/Sub message. + MessageTransformationFailureReason message_transformation_failure_reason = + 8 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Failure when ingesting from an Amazon MSK source. + message AwsMskFailureReason { + // Optional. The ARN of the cluster of the topic being ingested from. + string cluster_arn = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the Kafka topic being ingested from. + string kafka_topic = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The partition ID of the message that failed to be ingested. + int64 partition_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The offset within the partition of the message that failed to + // be ingested. + int64 offset = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Reason why ingestion failed for the specified message. + oneof reason { + // Optional. The Pub/Sub API limits prevented the desired message from + // being published. + ApiViolationReason api_violation_reason = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Pub/Sub message failed schema validation. + SchemaViolationReason schema_violation_reason = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure encountered when applying a message transformation to + // the Pub/Sub message. + MessageTransformationFailureReason message_transformation_failure_reason = + 7 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Failure when ingesting from an Azure Event Hubs source. + message AzureEventHubsFailureReason { + // Optional. The namespace containing the event hub being ingested from. + string namespace = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the event hub being ingested from. + string event_hub = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The partition ID of the message that failed to be ingested. + int64 partition_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The offset within the partition of the message that failed to + // be ingested. + int64 offset = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Reason why ingestion failed for the specified message. + oneof reason { + // Optional. The Pub/Sub API limits prevented the desired message from + // being published. + ApiViolationReason api_violation_reason = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Pub/Sub message failed schema validation. + SchemaViolationReason schema_violation_reason = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure encountered when applying a message transformation to + // the Pub/Sub message. + MessageTransformationFailureReason message_transformation_failure_reason = + 7 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Failure when ingesting from a Confluent Cloud source. + message ConfluentCloudFailureReason { + // Optional. The cluster ID containing the topic being ingested from. + string cluster_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the Kafka topic being ingested from. + string kafka_topic = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The partition ID of the message that failed to be ingested. + int64 partition_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The offset within the partition of the message that failed to + // be ingested. + int64 offset = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Reason why ingestion failed for the specified message. + oneof reason { + // Optional. The Pub/Sub API limits prevented the desired message from + // being published. + ApiViolationReason api_violation_reason = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Pub/Sub message failed schema validation. + SchemaViolationReason schema_violation_reason = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure encountered when applying a message transformation to + // the Pub/Sub message. + MessageTransformationFailureReason message_transformation_failure_reason = + 7 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Failure when ingesting from an AWS Kinesis source. + message AwsKinesisFailureReason { + // Optional. The stream ARN of the Kinesis stream being ingested from. + string stream_arn = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The partition key of the message that failed to be ingested. + string partition_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The sequence number of the message that failed to be ingested. + string sequence_number = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Reason why ingestion failed for the specified message. + oneof reason { + // Optional. The Pub/Sub message failed schema validation. + SchemaViolationReason schema_violation_reason = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure encountered when applying a message transformation to + // the Pub/Sub message. + MessageTransformationFailureReason message_transformation_failure_reason = + 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The message failed to be published due to an API violation. + // This is only set when the size of the data field of the Kinesis record + // is zero. + ApiViolationReason api_violation_reason = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Required. Name of the import topic. Format is: + // projects/{project_name}/topics/{topic_name}. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Required. Error details explaining why ingestion to Pub/Sub has failed. + string error_message = 2 [(google.api.field_behavior) = REQUIRED]; + + oneof failure { + // Optional. Failure when ingesting from Cloud Storage. + CloudStorageFailure cloud_storage_failure = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure when ingesting from Amazon MSK. + AwsMskFailureReason aws_msk_failure = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure when ingesting from Azure Event Hubs. + AzureEventHubsFailureReason azure_event_hubs_failure = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure when ingesting from Confluent Cloud. + ConfluentCloudFailureReason confluent_cloud_failure = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure when ingesting from AWS Kinesis. + AwsKinesisFailureReason aws_kinesis_failure = 7 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// User-defined JavaScript function that can transform or filter a Pub/Sub +// message. +message JavaScriptUDF { + // Required. Name of the JavasScript function that should applied to Pub/Sub + // messages. + string function_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. JavaScript code that contains a function `function_name` with the + // below signature: + // + // ``` + // /** + // * Transforms a Pub/Sub message. + // + // * @return {(Object)>|null)} - To + // * filter a message, return `null`. To transform a message return a map + // * with the following keys: + // * - (required) 'data' : {string} + // * - (optional) 'attributes' : {Object} + // * Returning empty `attributes` will remove all attributes from the + // * message. + // * + // * @param {(Object)>} Pub/Sub + // * message. Keys: + // * - (required) 'data' : {string} + // * - (required) 'attributes' : {Object} + // * + // * @param {Object} metadata - Pub/Sub message metadata. + // * Keys: + // * - (optional) 'message_id' : {string} + // * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format + // * - (optional) 'ordering_key': {string} + // */ + // + // function (message, metadata) { + // } + // ``` + string code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// All supported message transforms types. +message MessageTransform { + // The type of transform to apply to messages. + oneof transform { + // Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's + // are specified on a resource, each must have a unique `function_name`. + JavaScriptUDF javascript_udf = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. This field is deprecated, use the `disabled` field to disable + // transforms. + bool enabled = 3 [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the transform is disabled and will not be applied to + // messages. Defaults to `false`. + bool disabled = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A topic resource. +message Topic { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" + pattern: "_deleted-topic_" + plural: "topics" + singular: "topic" + }; + + // The state of the topic. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The topic does not have any persistent errors. + ACTIVE = 1; + + // Ingestion from the data source has encountered a permanent error. + // See the more detailed error state in the corresponding ingestion + // source configuration. + INGESTION_RESOURCE_ERROR = 2; + } + + // Required. The name of the topic. It must have the format + // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + // signs (`%`). It must be between 3 and 255 characters in length, and it + // must not start with `"goog"`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. See [Creating and managing labels] + // (https://cloud.google.com/pubsub/docs/labels). + map labels = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Policy constraining the set of Google Cloud Platform regions + // where messages published to the topic may be stored. If not present, then + // no constraints are in effect. + MessageStoragePolicy message_storage_policy = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource name of the Cloud KMS CryptoKey to be used to + // protect access to messages published on this topic. + // + // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string kms_key_name = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Optional. Settings for validating messages published against a schema. + SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use. This field is set only in responses from + // the server; it is ignored if it is set in any requests. + bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates the minimum duration to retain a message after it is + // published to the topic. If this field is set, messages published to the + // topic in the last `message_retention_duration` are always available to + // subscribers. For instance, it allows any attached subscription to [seek to + // a + // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + // that is up to `message_retention_duration` in the past. If this field is + // not set, message retention is controlled by settings on individual + // subscriptions. Cannot be more than 31 days or less than 10 minutes. + google.protobuf.Duration message_retention_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field indicating the state of the topic. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Settings for ingestion from a data source into this topic. + IngestionDataSourceSettings ingestion_data_source_settings = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Transforms to be applied to messages published to the topic. + // Transforms are applied in the order specified. + repeated MessageTransform message_transforms = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // "123/environment": "production", + // "123/costCenter": "marketing" + map tags = 14 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A message that is published by publishers and consumed by subscribers. The +// message must contain either a non-empty data field or at least one attribute. +// Note that client libraries represent this object differently +// depending on the language. See the corresponding [client library +// documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for +// more information. See [quotas and limits] +// (https://cloud.google.com/pubsub/quotas) for more information about message +// limits. +message PubsubMessage { + // Optional. The message data field. If this field is empty, the message must + // contain at least one attribute. + bytes data = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Attributes for this message. If this field is empty, the message + // must contain non-empty data. This can be used to filter messages on the + // subscription. + map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; + + // ID of this message, assigned by the server when the message is published. + // Guaranteed to be unique within the topic. This value may be read by a + // subscriber that receives a `PubsubMessage` via a `Pull` call or a push + // delivery. It must not be populated by the publisher in a `Publish` call. + string message_id = 3; + + // The time at which the message was published, populated by the server when + // it receives the `Publish` call. It must not be populated by the + // publisher in a `Publish` call. + google.protobuf.Timestamp publish_time = 4; + + // Optional. If non-empty, identifies related messages for which publish order + // should be respected. If a `Subscription` has `enable_message_ordering` set + // to `true`, messages published with the same non-empty `ordering_key` value + // will be delivered to subscribers in the order in which they are received by + // the Pub/Sub system. All `PubsubMessage`s published in a given + // `PublishRequest` must specify the same `ordering_key` value. For more + // information, see [ordering + // messages](https://cloud.google.com/pubsub/docs/ordering). + string ordering_key = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the GetTopic method. +message GetTopicRequest { + // Required. The name of the topic to get. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; +} + +// Request for the UpdateTopic method. +message UpdateTopicRequest { + // Required. The updated topic object. + Topic topic = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates which fields in the provided topic to update. Must be + // specified and non-empty. Note that if `update_mask` contains + // "message_storage_policy" but the `message_storage_policy` is not set in + // the `topic` provided above, then the updated value is determined by the + // policy configured at the project or organization level. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the Publish method. +message PublishRequest { + // Required. The messages in the request will be published on this topic. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Required. The messages to publish. + repeated PubsubMessage messages = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `Publish` method. +message PublishResponse { + // Optional. The server-assigned ID of each published message, in the same + // order as the messages in the request. IDs are guaranteed to be unique + // within the topic. + repeated string message_ids = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `ListTopics` method. +message ListTopicsRequest { + // Required. The name of the project in which to list topics. + // Format is `projects/{project-id}`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Maximum number of topics to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListTopicsResponse`; indicates + // that this is a continuation of a prior `ListTopics` call, and that the + // system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListTopics` method. +message ListTopicsResponse { + // Optional. The resulting topics. + repeated Topic topics = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more topics that match + // the request; this value should be passed in a new `ListTopicsRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `ListTopicSubscriptions` method. +message ListTopicSubscriptionsRequest { + // Required. The name of the topic that subscriptions are attached to. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. Maximum number of subscription names to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + // indicates that this is a continuation of a prior `ListTopicSubscriptions` + // call, and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListTopicSubscriptions` method. +message ListTopicSubscriptionsResponse { + // Optional. The names of subscriptions attached to the topic specified in the + // request. + repeated string subscriptions = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. If not empty, indicates that there may be more subscriptions that + // match the request; this value should be passed in a new + // `ListTopicSubscriptionsRequest` to get more subscriptions. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `ListTopicSnapshots` method. +message ListTopicSnapshotsRequest { + // Required. The name of the topic that snapshots are attached to. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. Maximum number of snapshot names to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListTopicSnapshotsResponse`; + // indicates that this is a continuation of a prior `ListTopicSnapshots` call, + // and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListTopicSnapshots` method. +message ListTopicSnapshotsResponse { + // Optional. The names of the snapshots that match the request. + repeated string snapshots = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; + + // Optional. If not empty, indicates that there may be more snapshots that + // match the request; this value should be passed in a new + // `ListTopicSnapshotsRequest` to get more snapshots. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `DeleteTopic` method. +message DeleteTopicRequest { + // Required. Name of the topic to delete. + // Format is `projects/{project}/topics/{topic}`. + string topic = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; +} + +// Request for the DetachSubscription method. +message DetachSubscriptionRequest { + // Required. The subscription to detach. + // Format is `projects/{project}/subscriptions/{subscription}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; +} + +// Response for the DetachSubscription method. +// Reserved for future use. +message DetachSubscriptionResponse {} + +// The service that an application uses to manipulate subscriptions and to +// consume messages from a subscription via the `Pull` method or by +// establishing a bi-directional stream using the `StreamingPull` method. +service Subscriber { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates a subscription to a given topic. See the [resource name rules] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + // If the subscription already exists, returns `ALREADY_EXISTS`. + // If the corresponding topic doesn't exist, returns `NOT_FOUND`. + // + // If the name is not provided in the request, the server will assign a random + // name for this subscription on the same project as the topic, conforming + // to the [resource name format] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + // generated name is populated in the returned Subscription object. Note that + // for REST API requests, you must specify a name in the request. + rpc CreateSubscription(Subscription) returns (Subscription) { + option (google.api.http) = { + put: "/v1/{name=projects/*/subscriptions/*}" + body: "*" + }; + option (google.api.method_signature) = + "name,topic,push_config,ack_deadline_seconds"; + } + + // Gets the configuration details of a subscription. + rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + get: "/v1/{subscription=projects/*/subscriptions/*}" + }; + option (google.api.method_signature) = "subscription"; + } + + // Updates an existing subscription by updating the fields specified in the + // update mask. Note that certain properties of a subscription, such as its + // topic, are not modifiable. + rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { + option (google.api.http) = { + patch: "/v1/{subscription.name=projects/*/subscriptions/*}" + body: "*" + }; + option (google.api.method_signature) = "subscription,update_mask"; + } + + // Lists matching subscriptions. + rpc ListSubscriptions(ListSubscriptionsRequest) + returns (ListSubscriptionsResponse) { + option (google.api.http) = { + get: "/v1/{project=projects/*}/subscriptions" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes an existing subscription. All messages retained in the subscription + // are immediately dropped. Calls to `Pull` after deletion will return + // `NOT_FOUND`. After a subscription is deleted, a new one may be created with + // the same name, but the new one has no association with the old + // subscription or its topic unless the same topic is specified. + rpc DeleteSubscription(DeleteSubscriptionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{subscription=projects/*/subscriptions/*}" + }; + option (google.api.method_signature) = "subscription"; + } + + // Modifies the ack deadline for a specific message. This method is useful + // to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. Note that this does not modify the + // subscription-level `ackDeadlineSeconds` used for subsequent messages. + rpc ModifyAckDeadline(ModifyAckDeadlineRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline" + body: "*" + }; + option (google.api.method_signature) = + "subscription,ack_ids,ack_deadline_seconds"; + } + + // Acknowledges the messages associated with the `ack_ids` in the + // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + // from the subscription. + // + // Acknowledging a message whose ack deadline has expired may succeed, + // but such a message may be redelivered later. Acknowledging a message more + // than once will not result in an error. + rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge" + body: "*" + }; + option (google.api.method_signature) = "subscription,ack_ids"; + } + + // Pulls messages from the server. + rpc Pull(PullRequest) returns (PullResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:pull" + body: "*" + }; + option (google.api.method_signature) = + "subscription,return_immediately,max_messages"; + option (google.api.method_signature) = "subscription,max_messages"; + } + + // Establishes a stream with the server, which sends messages down to the + // client. The client streams acknowledgments and ack deadline modifications + // back to the server. The server will close the stream and return the status + // on any error. The server may close the stream with status `UNAVAILABLE` to + // reassign server-side resources, in which case, the client should + // re-establish the stream. Flow control can be achieved by configuring the + // underlying RPC channel. + rpc StreamingPull(stream StreamingPullRequest) + returns (stream StreamingPullResponse) {} + + // Modifies the `PushConfig` for a specified subscription. + // + // This may be used to change a push subscription to a pull one (signified by + // an empty `PushConfig`) or vice versa, or change the endpoint URL and other + // attributes of a push subscription. Messages will accumulate for delivery + // continuously through the call regardless of changes to the `PushConfig`. + rpc ModifyPushConfig(ModifyPushConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig" + body: "*" + }; + option (google.api.method_signature) = "subscription,push_config"; + } + + // Gets the configuration details of a snapshot. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v1/{snapshot=projects/*/snapshots/*}" + }; + option (google.api.method_signature) = "snapshot"; + } + + // Lists the existing snapshots. Snapshots are used in [Seek]( + // https://cloud.google.com/pubsub/docs/replay-overview) operations, which + // allow you to manage message acknowledgments in bulk. That is, you can set + // the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v1/{project=projects/*}/snapshots" + }; + option (google.api.method_signature) = "project"; + } + + // Creates a snapshot from the requested subscription. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + // If the snapshot already exists, returns `ALREADY_EXISTS`. + // If the requested subscription doesn't exist, returns `NOT_FOUND`. + // If the backlog in the subscription is too old -- and the resulting snapshot + // would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + // See also the `Snapshot.expire_time` field. If the name is not provided in + // the request, the server will assign a random + // name for this snapshot on the same project as the subscription, conforming + // to the [resource name format] + // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + // generated name is populated in the returned Snapshot object. Note that for + // REST API requests, you must specify a name in the request. + rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + put: "/v1/{name=projects/*/snapshots/*}" + body: "*" + }; + option (google.api.method_signature) = "name,subscription"; + } + + // Updates an existing snapshot by updating the fields specified in the update + // mask. Snapshots are used in + // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + // which allow you to manage message acknowledgments in bulk. That is, you can + // set the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + patch: "/v1/{snapshot.name=projects/*/snapshots/*}" + body: "*" + }; + option (google.api.method_signature) = "snapshot,update_mask"; + } + + // Removes an existing snapshot. Snapshots are used in [Seek] + // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + // allow you to manage message acknowledgments in bulk. That is, you can set + // the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. + // When the snapshot is deleted, all messages retained in the snapshot + // are immediately dropped. After a snapshot is deleted, a new one may be + // created with the same name, but the new one has no association with the old + // snapshot or its subscription, unless the same subscription is specified. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{snapshot=projects/*/snapshots/*}" + }; + option (google.api.method_signature) = "snapshot"; + } + + // Seeks an existing subscription to a point in time or to a given snapshot, + // whichever is provided in the request. Snapshots are used in [Seek] + // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + // allow you to manage message acknowledgments in bulk. That is, you can set + // the acknowledgment state of messages in an existing subscription to the + // state captured by a snapshot. Note that both the subscription and the + // snapshot must be on the same topic. + rpc Seek(SeekRequest) returns (SeekResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:seek" + body: "*" + }; + } +} + +// A subscription resource. If none of `push_config`, `bigquery_config`, or +// `cloud_storage_config` is set, then the subscriber will pull and ack messages +// using API methods. At most one of these fields may be set. +message Subscription { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Subscription" + pattern: "projects/{project}/subscriptions/{subscription}" + plural: "subscriptions" + singular: "subscription" + }; + + // Possible states for a subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription can actively receive messages + ACTIVE = 1; + + // The subscription cannot receive messages because of an error with the + // resource to which it pushes messages. See the more detailed error state + // in the corresponding configuration. + RESOURCE_ERROR = 2; + } + + // Information about an associated [Analytics Hub + // subscription](https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions). + message AnalyticsHubSubscriptionInfo { + // Optional. The name of the associated Analytics Hub listing resource. + // Pattern: + // "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + string listing = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; + + // Optional. The name of the associated Analytics Hub subscription resource. + // Pattern: + // "projects/{project}/locations/{location}/subscriptions/{subscription}" + string subscription = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The name of the subscription. It must have the format + // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + // start with a letter, and contain only letters (`[A-Za-z]`), numbers + // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + // in length, and it must not start with `"goog"`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the topic from which this subscription is receiving + // messages. Format is `projects/{project}/topics/{topic}`. The value of this + // field will be `_deleted-topic_` if the topic has been deleted. + string topic = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. If push delivery is used with this subscription, this field is + // used to configure it. + PushConfig push_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If delivery to BigQuery is used with this subscription, this + // field is used to configure it. + BigQueryConfig bigquery_config = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If delivery to Google Cloud Storage is used with this + // subscription, this field is used to configure it. + CloudStorageConfig cloud_storage_config = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + // waits for the subscriber to acknowledge receipt before resending the + // message. In the interval after the message is delivered and before it is + // acknowledged, it is considered to be _outstanding_. During that time + // period, the message will not be redelivered (on a best-effort basis). + // + // For pull subscriptions, this value is used as the initial value for the ack + // deadline. To override this value for a given message, call + // `ModifyAckDeadline` with the corresponding `ack_id` if using + // non-streaming pull or send the `ack_id` in a + // `StreamingModifyAckDeadlineRequest` if using streaming pull. + // The minimum custom deadline you can specify is 10 seconds. + // The maximum custom deadline you can specify is 600 seconds (10 minutes). + // If this parameter is 0, a default value of 10 seconds is used. + // + // For push delivery, this value is also used to set the request timeout for + // the call to the push endpoint. + // + // If the subscriber never acknowledges the message, the Pub/Sub + // system will eventually redeliver the message. + int32 ack_deadline_seconds = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether to retain acknowledged messages. If true, then + // messages are not expunged from the subscription's backlog, even if they are + // acknowledged, until they fall out of the `message_retention_duration` + // window. This must be true if you would like to [`Seek` to a timestamp] + // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + // the past to replay previously-acknowledged messages. + bool retain_acked_messages = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How long to retain unacknowledged messages in the subscription's + // backlog, from the moment a message is published. If `retain_acked_messages` + // is true, then this also configures the retention of acknowledged messages, + // and thus configures how far back in time a `Seek` can be done. Defaults to + // 7 days. Cannot be more than 31 days or less than 10 minutes. + google.protobuf.Duration message_retention_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. See [Creating and managing + // labels](https://cloud.google.com/pubsub/docs/labels). + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, messages published with the same `ordering_key` in + // `PubsubMessage` will be delivered to the subscribers in the order in which + // they are received by the Pub/Sub system. Otherwise, they may be delivered + // in any order. + bool enable_message_ordering = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies the conditions for this subscription's + // expiration. A subscription is considered active as long as any connected + // subscriber is successfully consuming messages from the subscription or is + // issuing operations on the subscription. If `expiration_policy` is not set, + // a *default policy* with `ttl` of 31 days will be used. The minimum allowed + // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + // but `expiration_policy.ttl` is not set, the subscription never expires. + ExpirationPolicy expiration_policy = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression written in the Pub/Sub [filter + // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + // then only `PubsubMessage`s whose `attributes` field matches the filter are + // delivered on this subscription. If empty, then no messages are filtered + // out. + string filter = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies the conditions for dead lettering + // messages in this subscription. If dead_letter_policy is not set, dead + // lettering is disabled. + // + // The Pub/Sub service account associated with this subscriptions's + // parent project (i.e., + // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + // permission to Acknowledge() messages on this subscription. + DeadLetterPolicy dead_letter_policy = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies how Pub/Sub retries message delivery for + // this subscription. + // + // If not set, the default retry policy is applied. This generally implies + // that messages will be retried as soon as possible for healthy subscribers. + // RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded + // events for a given message. + RetryPolicy retry_policy = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the subscription is detached from its topic. + // Detached subscriptions don't receive messages from their topic and don't + // retain any backlog. `Pull` and `StreamingPull` requests will return + // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + // the endpoint will not be made. + bool detached = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, Pub/Sub provides the following guarantees for the + // delivery of a message with a given value of `message_id` on this + // subscription: + // + // * The message sent to a subscriber is guaranteed not to be resent + // before the message's acknowledgment deadline expires. + // * An acknowledged message will not be resent to a subscriber. + // + // Note that subscribers may still receive multiple copies of a message + // when `enable_exactly_once_delivery` is true if the message was published + // multiple times by a publisher client. These copies are considered distinct + // by Pub/Sub and have distinct `message_id` values. + bool enable_exactly_once_delivery = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Indicates the minimum duration for which a message is retained + // after it is published to the subscription's topic. If this field is set, + // messages published to the subscription's topic in the last + // `topic_message_retention_duration` are always available to subscribers. See + // the `message_retention_duration` field in `Topic`. This field is set only + // in responses from the server; it is ignored if it is set in any requests. + google.protobuf.Duration topic_message_retention_duration = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An output-only field indicating whether or not the + // subscription can receive messages. + State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about the associated Analytics Hub subscription. + // Only set if the subscritpion is created by Analytics Hub. + AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Transforms to be applied to messages before they are delivered to + // subscribers. Transforms are applied in the order specified. + repeated MessageTransform message_transforms = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // "123/environment": "production", + // "123/costCenter": "marketing" + map tags = 26 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A policy that specifies how Pub/Sub retries message delivery. +// +// Retry delay will be exponential based on provided minimum and maximum +// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. +// +// RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded +// events for a given message. +// +// Retry Policy is implemented on a best effort basis. At times, the delay +// between consecutive deliveries may not match the configuration. That is, +// delay can be more or less than configured backoff. +message RetryPolicy { + // Optional. The minimum delay between consecutive deliveries of a given + // message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + google.protobuf.Duration minimum_backoff = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum delay between consecutive deliveries of a given + // message. Value should be between 0 and 600 seconds. Defaults to 600 + // seconds. + google.protobuf.Duration maximum_backoff = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Dead lettering is done on a best effort basis. The same message might be +// dead lettered multiple times. +// +// If validation on any of the fields fails at subscription creation/updation, +// the create/update subscription request will fail. +message DeadLetterPolicy { + // Optional. The name of the topic to which dead letter messages should be + // published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + // service account associated with the enclosing subscription's parent project + // (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + // have permission to Publish() to this topic. + // + // The operation will fail if the topic does not exist. + // Users should ensure that there is a subscription attached to this topic + // since messages published to a topic with no subscriptions are lost. + string dead_letter_topic = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. The maximum number of delivery attempts for any message. The + // value must be between 5 and 100. + // + // The number of delivery attempts is defined as 1 + (the sum of number of + // NACKs and number of times the acknowledgment deadline has been exceeded + // for the message). + // + // A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + // client libraries may automatically extend ack_deadlines. + // + // This field will be honored on a best effort basis. + // + // If this parameter is 0, a default value of 5 is used. + int32 max_delivery_attempts = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A policy that specifies the conditions for resource expiration (i.e., +// automatic resource deletion). +message ExpirationPolicy { + // Optional. Specifies the "time-to-live" duration for an associated resource. + // The resource expires if it is not active for a period of `ttl`. The + // definition of "activity" depends on the type of the associated resource. + // The minimum and maximum allowed values for `ttl` depend on the type of the + // associated resource, as well. If `ttl` is not set, the associated resource + // never expires. + google.protobuf.Duration ttl = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for a push delivery endpoint. +message PushConfig { + // Contains information needed for generating an + // [OpenID Connect + // token](https://developers.google.com/identity/protocols/OpenIDConnect). + message OidcToken { + // Optional. [Service account + // email](https://cloud.google.com/iam/docs/service-accounts) + // used for generating the OIDC token. For more information + // on setting up authentication, see + // [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + string service_account_email = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audience to be used when generating OIDC token. The audience + // claim identifies the recipients that the JWT is intended for. The + // audience value is a single case-sensitive string. Having multiple values + // (array) for the audience field is not supported. More info about the OIDC + // JWT token audience here: + // https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + // the Push endpoint URL will be used. + string audience = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The payload to the push endpoint is in the form of the JSON representation + // of a PubsubMessage + // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + message PubsubWrapper {} + + // Sets the `data` field as the HTTP body for delivery. + message NoWrapper { + // Optional. When true, writes the Pub/Sub message metadata to + // `x-goog-pubsub-:` headers of the HTTP request. Writes the + // Pub/Sub message attributes to `:` headers of the HTTP request. + bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A URL locating the endpoint to which messages should be pushed. + // For example, a Webhook endpoint might use `https://example.com/push`. + string push_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Endpoint configuration attributes that can be used to control + // different aspects of the message delivery. + // + // The only currently supported attribute is `x-goog-version`, which you can + // use to change the format of the pushed message. This attribute + // indicates the version of the data expected by the endpoint. This + // controls the shape of the pushed message (i.e., its fields and metadata). + // + // If not present during the `CreateSubscription` call, it will default to + // the version of the Pub/Sub API used to make such call. If not present in a + // `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + // calls will always return a valid version, even if the subscription was + // created without this attribute. + // + // The only supported values for the `x-goog-version` attribute are: + // + // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + // + // For example: + // `attributes { "x-goog-version": "v1" }` + map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; + + // An authentication method used by push endpoints to verify the source of + // push requests. This can be used with push endpoints that are private by + // default to allow requests only from the Pub/Sub system, for example. + // This field is optional and should be set only by users interested in + // authenticated push. + oneof authentication_method { + // Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + // token as an `Authorization` header in the HTTP request for every pushed + // message. + OidcToken oidc_token = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // The format of the delivered message to the push endpoint is defined by + // the chosen wrapper. When unset, `PubsubWrapper` is used. + oneof wrapper { + // Optional. When set, the payload to the push endpoint is in the form of + // the JSON representation of a PubsubMessage + // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + PubsubWrapper pubsub_wrapper = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set, the payload to the push endpoint is not wrapped. + NoWrapper no_wrapper = 5 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Configuration for a BigQuery subscription. +message BigQueryConfig { + // Possible states for a BigQuery subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription can actively send messages to BigQuery + ACTIVE = 1; + + // Cannot write to the BigQuery table because of permission denied errors. + // This can happen if + // - Pub/Sub SA has not been granted the [appropriate BigQuery IAM + // permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) + // - bigquery.googleapis.com API is not enabled for the project + // ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) + PERMISSION_DENIED = 2; + + // Cannot write to the BigQuery table because it does not exist. + NOT_FOUND = 3; + + // Cannot write to the BigQuery table due to a schema mismatch. + SCHEMA_MISMATCH = 4; + + // Cannot write to the destination because enforce_in_transit is set to true + // and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 5; + } + + // Optional. The name of the table to which to write data, of the form + // {projectId}.{datasetId}.{tableId} + string table = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, use the topic's schema as the columns to write to in + // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + // enabled at the same time. + bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, write the subscription name, message_id, publish_time, + // attributes, and ordering_key to additional columns in the table. The + // subscription name, message_id, and publish_time fields are put in their own + // columns while all other message properties (other than data) are written to + // a JSON object in the attributes column. + bool write_metadata = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true and use_topic_schema is true, any fields that are a + // part of the topic schema that are not part of the BigQuery table schema are + // dropped when writing to BigQuery. Otherwise, the schemas must be kept in + // sync and any messages with extra fields are not written and remain in the + // subscription's backlog. + bool drop_unknown_fields = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field that indicates whether or not the + // subscription can receive messages. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When true, use the BigQuery table's schema as the columns to + // write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + // enabled at the same time. + bool use_table_schema = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The service account to use to write to BigQuery. The subscription + // creator or updater that specifies this field must have + // `iam.serviceAccounts.actAs` permission on the service account. If not + // specified, the Pub/Sub [service + // agent](https://cloud.google.com/iam/docs/service-agents), + // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + string service_account_email = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for a Cloud Storage subscription. +message CloudStorageConfig { + // Configuration for writing message data in text format. + // Message payloads will be written to files as raw text, separated by a + // newline. + message TextConfig {} + + // Configuration for writing message data in Avro format. + // Message payloads and metadata will be written to files as an Avro binary. + message AvroConfig { + // Optional. When true, write the subscription name, message_id, + // publish_time, attributes, and ordering_key as additional fields in the + // output. The subscription name, message_id, and publish_time fields are + // put in their own fields while all other message properties other than + // data (for example, an ordering_key, if present) are added as entries in + // the attributes map. + bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When true, the output Cloud Storage file will be serialized + // using the topic schema, if it exists. + bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Possible states for a Cloud Storage subscription. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The subscription can actively send messages to Cloud Storage. + ACTIVE = 1; + + // Cannot write to the Cloud Storage bucket because of permission denied + // errors. + PERMISSION_DENIED = 2; + + // Cannot write to the Cloud Storage bucket because it does not exist. + NOT_FOUND = 3; + + // Cannot write to the destination because enforce_in_transit is set to true + // and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 4; + + // Cannot write to the Cloud Storage bucket due to an incompatibility + // between the topic schema and subscription settings. + SCHEMA_MISMATCH = 5; + } + + // Required. User-provided name for the Cloud Storage bucket. + // The bucket must be created by the user. The bucket name must be without + // any prefix like "gs://". See the [bucket naming + // requirements] (https://cloud.google.com/storage/docs/buckets#naming). + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User-provided prefix for Cloud Storage filename. See the [object + // naming requirements](https://cloud.google.com/storage/docs/objects#naming). + string filename_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided suffix for Cloud Storage filename. See the [object + // naming requirements](https://cloud.google.com/storage/docs/objects#naming). + // Must not end in "/". + string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided format string specifying how to represent datetimes + // in Cloud Storage filenames. See the [datetime format + // guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + string filename_datetime_format = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Defaults to text format. + oneof output_format { + // Optional. If set, message data will be written to Cloud Storage in text + // format. + TextConfig text_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, message data will be written to Cloud Storage in Avro + // format. + AvroConfig avro_config = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The maximum duration that can elapse before a new Cloud Storage + // file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + // exceed the subscription's acknowledgment deadline. + google.protobuf.Duration max_duration = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum bytes that can be written to a Cloud Storage file + // before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + // be exceeded in cases where messages are larger than the limit. + int64 max_bytes = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of messages that can be written to a Cloud + // Storage file before a new file is created. Min 1000 messages. + int64 max_messages = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field that indicates whether or not the + // subscription can receive messages. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The service account to use to write to Cloud Storage. The + // subscription creator or updater that specifies this field must have + // `iam.serviceAccounts.actAs` permission on the service account. If not + // specified, the Pub/Sub + // [service agent](https://cloud.google.com/iam/docs/service-agents), + // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + string service_account_email = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A message and its corresponding acknowledgment ID. +message ReceivedMessage { + // Optional. This ID can be used to acknowledge the received message. + string ack_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The message. + PubsubMessage message = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The approximate number of times that Pub/Sub has attempted to + // deliver the associated message to a subscriber. + // + // More precisely, this is 1 + (number of NACKs) + + // (number of ack_deadline exceeds) for this message. + // + // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + // exceeds event is whenever a message is not acknowledged within + // ack_deadline. Note that ack_deadline is initially + // Subscription.ackDeadlineSeconds, but may get extended automatically by + // the client library. + // + // Upon the first delivery of a given message, `delivery_attempt` will have a + // value of 1. The value is calculated at best effort and is approximate. + // + // If a DeadLetterPolicy is not set on the subscription, this will be 0. + int32 delivery_attempt = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the GetSubscription method. +message GetSubscriptionRequest { + // Required. The name of the subscription to get. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; +} + +// Request for the UpdateSubscription method. +message UpdateSubscriptionRequest { + // Required. The updated subscription object. + Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates which fields in the provided subscription to update. + // Must be specified and non-empty. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `ListSubscriptions` method. +message ListSubscriptionsRequest { + // Required. The name of the project in which to list subscriptions. + // Format is `projects/{project-id}`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Maximum number of subscriptions to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListSubscriptionsResponse`; + // indicates that this is a continuation of a prior `ListSubscriptions` call, + // and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListSubscriptions` method. +message ListSubscriptionsResponse { + // Optional. The subscriptions that match the request. + repeated Subscription subscriptions = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more subscriptions that + // match the request; this value should be passed in a new + // `ListSubscriptionsRequest` to get more subscriptions. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the DeleteSubscription method. +message DeleteSubscriptionRequest { + // Required. The subscription to delete. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; +} + +// Request for the ModifyPushConfig method. +message ModifyPushConfigRequest { + // Required. The name of the subscription. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Required. The push configuration for future deliveries. + // + // An empty `pushConfig` indicates that the Pub/Sub system should + // stop pushing messages from the given subscription and allow + // messages to be pulled and acknowledged - effectively pausing + // the subscription if `Pull` or `StreamingPull` is not called. + PushConfig push_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `Pull` method. +message PullRequest { + // Required. The subscription from which messages should be pulled. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. If this field set to true, the system will respond immediately + // even if it there are no messages available to return in the `Pull` + // response. Otherwise, the system may wait (for a bounded amount of time) + // until at least one message is available, rather than returning no messages. + // Warning: setting this field to `true` is discouraged because it adversely + // impacts the performance of `Pull` operations. We recommend that users do + // not set this field. + bool return_immediately = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Required. The maximum number of messages to return for this request. Must + // be a positive integer. The Pub/Sub system may return fewer than the number + // specified. + int32 max_messages = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `Pull` method. +message PullResponse { + // Optional. Received Pub/Sub messages. The list will be empty if there are no + // more messages available in the backlog, or if no messages could be returned + // before the request timeout. For JSON, the response can be entirely + // empty. The Pub/Sub system may return fewer than the `maxMessages` requested + // even if there are more messages available in the backlog. + repeated ReceivedMessage received_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the ModifyAckDeadline method. +message ModifyAckDeadlineRequest { + // Required. The name of the subscription. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Required. List of acknowledgment IDs. + repeated string ack_ids = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new ack deadline with respect to the time this request was + // sent to the Pub/Sub system. For example, if the value is 10, the new ack + // deadline will expire 10 seconds after the `ModifyAckDeadline` call was + // made. Specifying zero might immediately make the message available for + // delivery to another subscriber client. This typically results in an + // increase in the rate of message redeliveries (that is, duplicates). + // The minimum deadline you can specify is 0 seconds. + // The maximum deadline you can specify in a single request is 600 seconds + // (10 minutes). + int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the Acknowledge method. +message AcknowledgeRequest { + // Required. The subscription whose message is being acknowledged. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Required. The acknowledgment ID for the messages being acknowledged that + // was returned by the Pub/Sub system in the `Pull` response. Must not be + // empty. + repeated string ack_ids = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `StreamingPull` streaming RPC method. This request is used to +// establish the initial stream as well as to stream acknowledgments and ack +// deadline modifications from the client to the server. +message StreamingPullRequest { + // Required. The subscription for which to initialize the new stream. This + // must be provided in the first request on the stream, and must not be set in + // subsequent requests from client to server. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. List of acknowledgment IDs for acknowledging previously received + // messages (received on this stream or a different stream). If an ack ID has + // expired, the corresponding message may be redelivered later. Acknowledging + // a message more than once will not result in an error. If the acknowledgment + // ID is malformed, the stream will be aborted with status `INVALID_ARGUMENT`. + repeated string ack_ids = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of new ack deadlines for the IDs listed in + // `modify_deadline_ack_ids`. The size of this list must be the same as the + // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + // with `INVALID_ARGUMENT`. Each element in this list is applied to the + // element in the same position in `modify_deadline_ack_ids`. The new ack + // deadline is with respect to the time this request was sent to the Pub/Sub + // system. Must be >= 0. For example, if the value is 10, the new ack deadline + // will expire 10 seconds after this request is received. If the value is 0, + // the message is immediately made available for another streaming or + // non-streaming pull request. If the value is < 0 (an error), the stream will + // be aborted with status `INVALID_ARGUMENT`. + repeated int32 modify_deadline_seconds = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgment IDs whose deadline will be modified based + // on the corresponding element in `modify_deadline_seconds`. This field can + // be used to indicate that more time is needed to process a message by the + // subscriber, or to make the message available for redelivery if the + // processing was interrupted. + repeated string modify_deadline_ack_ids = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ack deadline to use for the stream. This must be provided in + // the first request on the stream, but it can also be updated on subsequent + // requests from client to server. The minimum deadline you can specify is 10 + // seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + int32 stream_ack_deadline_seconds = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier that is used to distinguish client instances + // from each other. Only needs to be provided on the initial request. When a + // stream disconnects and reconnects for the same stream, the client_id should + // be set to the same value so that state associated with the old stream can + // be transferred to the new stream. The same client_id should not be used for + // different client instances. + string client_id = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flow control settings for the maximum number of outstanding + // messages. When there are `max_outstanding_messages` currently sent to the + // streaming pull client that have not yet been acked or nacked, the server + // stops sending more messages. The sending of messages resumes once the + // number of outstanding messages is less than this value. If the value is + // <= 0, there is no limit to the number of outstanding messages. This + // property can only be set on the initial StreamingPullRequest. If it is set + // on a subsequent request, the stream will be aborted with status + // `INVALID_ARGUMENT`. + int64 max_outstanding_messages = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flow control settings for the maximum number of outstanding + // bytes. When there are `max_outstanding_bytes` or more worth of messages + // currently sent to the streaming pull client that have not yet been acked or + // nacked, the server will stop sending more messages. The sending of messages + // resumes once the number of outstanding bytes is less than this value. If + // the value is <= 0, there is no limit to the number of outstanding bytes. + // This property can only be set on the initial StreamingPullRequest. If it is + // set on a subsequent request, the stream will be aborted with status + // `INVALID_ARGUMENT`. + int64 max_outstanding_bytes = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The protocol version used by the client. This property can only + // be set on the initial StreamingPullRequest. If it is set on a subsequent + // request, the stream will be aborted with status `INVALID_ARGUMENT`. + int64 protocol_version = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `StreamingPull` method. This response is used to stream +// messages from the server to the client. +message StreamingPullResponse { + // Acknowledgment IDs sent in one or more previous requests to acknowledge a + // previously received message. + message AcknowledgeConfirmation { + // Optional. Successfully processed acknowledgment IDs. + repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgment IDs that were malformed or whose + // acknowledgment deadline has expired. + repeated string invalid_ack_ids = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgment IDs that were out of order. + repeated string unordered_ack_ids = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgment IDs that failed processing with + // temporary issues. + repeated string temporary_failed_ack_ids = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Acknowledgment IDs sent in one or more previous requests to modify the + // deadline for a specific message. + message ModifyAckDeadlineConfirmation { + // Optional. Successfully processed acknowledgment IDs. + repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgment IDs that were malformed or whose + // acknowledgment deadline has expired. + repeated string invalid_ack_ids = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgment IDs that failed processing with + // temporary issues. + repeated string temporary_failed_ack_ids = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Subscription properties sent as part of the response. + message SubscriptionProperties { + // Optional. True iff exactly once delivery is enabled for this + // subscription. + bool exactly_once_delivery_enabled = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True iff message ordering is enabled for this subscription. + bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Received Pub/Sub messages. + repeated ReceivedMessage received_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field will only be set if `enable_exactly_once_delivery` is + // set to `true` and is not guaranteed to be populated. + AcknowledgeConfirmation acknowledge_confirmation = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field will only be set if `enable_exactly_once_delivery` is + // set to `true` and is not guaranteed to be populated. + ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Properties associated with this subscription. + SubscriptionProperties subscription_properties = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `CreateSnapshot` method. +message CreateSnapshotRequest { + // Required. User-provided name for this snapshot. If the name is not provided + // in the request, the server will assign a random name for this snapshot on + // the same project as the subscription. Note that for REST API requests, you + // must specify a name. See the [resource name + // rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + // Format is `projects/{project}/snapshots/{snap}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; + + // Required. The subscription whose backlog the snapshot retains. + // Specifically, the created snapshot is guaranteed to retain: + // (a) The existing backlog on the subscription. More precisely, this is + // defined as the messages in the subscription's backlog that are + // unacknowledged upon the successful completion of the + // `CreateSnapshot` request; as well as: + // (b) Any messages published to the subscription's topic following the + // successful completion of the CreateSnapshot request. + // Format is `projects/{project}/subscriptions/{sub}`. + string subscription = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // Optional. See [Creating and managing + // labels](https://cloud.google.com/pubsub/docs/labels). + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // "123/environment": "production", + // "123/costCenter": "marketing" + map tags = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request for the UpdateSnapshot method. +message UpdateSnapshotRequest { + // Required. The updated snapshot object. + Snapshot snapshot = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Indicates which fields in the provided snapshot to update. + // Must be specified and non-empty. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A snapshot resource. Snapshots are used in +// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) +// operations, which allow you to manage message acknowledgments in bulk. That +// is, you can set the acknowledgment state of messages in an existing +// subscription to the state captured by a snapshot. +message Snapshot { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Snapshot" + pattern: "projects/{project}/snapshots/{snapshot}" + plural: "snapshots" + singular: "snapshot" + }; + + // Optional. The name of the snapshot. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the topic from which this snapshot is retaining + // messages. + string topic = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Optional. The snapshot is guaranteed to exist up until this time. + // A newly-created snapshot expires no later than 7 days from the time of its + // creation. Its exact lifetime is determined at creation by the existing + // backlog in the source subscription. Specifically, the lifetime of the + // snapshot is `7 days - (age of oldest unacked message in the subscription)`. + // For example, consider a subscription whose oldest unacked message is 3 days + // old. If a snapshot is created from this subscription, the snapshot -- which + // will always capture this 3-day-old backlog as long as the snapshot + // exists -- will expire in 4 days. The service will refuse to create a + // snapshot that would expire in less than 1 hour after creation. + google.protobuf.Timestamp expire_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. See [Creating and managing labels] + // (https://cloud.google.com/pubsub/docs/labels). + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the GetSnapshot method. +message GetSnapshotRequest { + // Required. The name of the snapshot to get. + // Format is `projects/{project}/snapshots/{snap}`. + string snapshot = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; +} + +// Request for the `ListSnapshots` method. +message ListSnapshotsRequest { + // Required. The name of the project in which to list snapshots. + // Format is `projects/{project-id}`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. Maximum number of snapshots to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last `ListSnapshotsResponse`; indicates + // that this is a continuation of a prior `ListSnapshots` call, and that the + // system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the `ListSnapshots` method. +message ListSnapshotsResponse { + // Optional. The resulting snapshots. + repeated Snapshot snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not empty, indicates that there may be more snapshot that + // match the request; this value should be passed in a new + // `ListSnapshotsRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `DeleteSnapshot` method. +message DeleteSnapshotRequest { + // Required. The name of the snapshot to delete. + // Format is `projects/{project}/snapshots/{snap}`. + string snapshot = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } + ]; +} + +// Request for the `Seek` method. +message SeekRequest { + // Required. The subscription to affect. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + oneof target { + // Optional. The time to seek to. + // Messages retained in the subscription that were published before this + // time are marked as acknowledged, and messages retained in the + // subscription that were published after this time are marked as + // unacknowledged. Note that this operation affects only those messages + // retained in the subscription (configured by the combination of + // `message_retention_duration` and `retain_acked_messages`). For example, + // if `time` corresponds to a point before the message retention + // window (or to a point before the system's notion of the subscription + // creation time), only retained messages will be marked as unacknowledged, + // and already-expunged messages will not be restored. + google.protobuf.Timestamp time = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The snapshot to seek to. The snapshot's topic must be the same + // as that of the provided subscription. Format is + // `projects/{project}/snapshots/{snap}`. + string snapshot = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Snapshot" + } + ]; + } +} + +// Response for the `Seek` method (this response is empty). +message SeekResponse {} diff --git a/handwritten/pubsub/protos/google/pubsub/v1/schema.proto b/handwritten/pubsub/protos/google/pubsub/v1/schema.proto new file mode 100644 index 00000000000..37fd2f461c0 --- /dev/null +++ b/handwritten/pubsub/protos/google/pubsub/v1/schema.proto @@ -0,0 +1,409 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.pubsub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.PubSub.V1"; +option go_package = "cloud.google.com/go/pubsub/v2/apiv1/pubsubpb;pubsubpb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.pubsub.v1"; +option php_namespace = "Google\\Cloud\\PubSub\\V1"; +option ruby_package = "Google::Cloud::PubSub::V1"; + +// Service for doing schema-related operations. +service SchemaService { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates a schema. + rpc CreateSchema(CreateSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas" + body: "schema" + }; + option (google.api.method_signature) = "parent,schema,schema_id"; + } + + // Gets a schema. + rpc GetSchema(GetSchemaRequest) returns (Schema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/schemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists schemas in a project. + rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/schemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all schema revisions for the named schema. + rpc ListSchemaRevisions(ListSchemaRevisionsRequest) + returns (ListSchemaRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/schemas/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Commits a new schema revision to an existing schema. + rpc CommitSchema(CommitSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{name=projects/*/schemas/*}:commit" + body: "*" + }; + option (google.api.method_signature) = "name,schema"; + } + + // Creates a new schema revision that is a copy of the provided revision_id. + rpc RollbackSchema(RollbackSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{name=projects/*/schemas/*}:rollback" + body: "*" + }; + option (google.api.method_signature) = "name,revision_id"; + } + + // Deletes a specific schema revision. + rpc DeleteSchemaRevision(DeleteSchemaRevisionRequest) returns (Schema) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/schemas/*}:deleteRevision" + }; + option (google.api.method_signature) = "name,revision_id"; + } + + // Deletes a schema. + rpc DeleteSchema(DeleteSchemaRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/schemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Validates a schema. + rpc ValidateSchema(ValidateSchemaRequest) returns (ValidateSchemaResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas:validate" + body: "*" + }; + option (google.api.method_signature) = "parent,schema"; + } + + // Validates a message against a schema. + rpc ValidateMessage(ValidateMessageRequest) + returns (ValidateMessageResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas:validateMessage" + body: "*" + }; + } +} + +// A schema resource. +message Schema { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Schema" + pattern: "projects/{project}/schemas/{schema}" + }; + + // Possible schema definition types. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // A Protocol Buffer schema definition. + PROTOCOL_BUFFER = 1; + + // An Avro schema definition. + AVRO = 2; + } + + // Required. Name of the schema. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The type of the schema definition. + Type type = 2; + + // The definition of the schema. This should contain a string representing + // the full definition of the schema that is a valid schema definition of + // the type specified in `type`. + string definition = 3; + + // Output only. Immutable. The revision ID of the schema. + string revision_id = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// View of Schema object fields to be returned by GetSchema and ListSchemas. +enum SchemaView { + // The default / unset value. + // The API will default to the BASIC view. + SCHEMA_VIEW_UNSPECIFIED = 0; + + // Include the name and type of the schema, but not the definition. + BASIC = 1; + + // Include all Schema object fields. + FULL = 2; +} + +// Request for the CreateSchema method. +message CreateSchemaRequest { + // Required. The name of the project in which to create the schema. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "pubsub.googleapis.com/Schema" + } + ]; + + // Required. The schema object to create. + // + // This schema's `name` parameter is ignored. The schema object returned + // by CreateSchema will have a `name` made using the given `parent` and + // `schema_id`. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the schema, which will become the final component of + // the schema's resource name. + // + // See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + // resource name constraints. + string schema_id = 3; +} + +// Request for the GetSchema method. +message GetSchemaRequest { + // Required. The name of the schema to get. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // The set of fields to return in the response. If not set, returns a Schema + // with all fields filled out. Set to `BASIC` to omit the `definition`. + SchemaView view = 2; +} + +// Request for the `ListSchemas` method. +message ListSchemasRequest { + // Required. The name of the project in which to list schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The set of Schema fields to return in the response. If not set, returns + // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + // retrieve all fields. + SchemaView view = 2; + + // Maximum number of schemas to return. + int32 page_size = 3; + + // The value returned by the last `ListSchemasResponse`; indicates that + // this is a continuation of a prior `ListSchemas` call, and that the + // system should return the next page of data. + string page_token = 4; +} + +// Response for the `ListSchemas` method. +message ListSchemasResponse { + // The resulting schemas. + repeated Schema schemas = 1; + + // If not empty, indicates that there may be more schemas that match the + // request; this value should be passed in a new `ListSchemasRequest`. + string next_page_token = 2; +} + +// Request for the `ListSchemaRevisions` method. +message ListSchemaRevisionsRequest { + // Required. The name of the schema to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // The set of Schema fields to return in the response. If not set, returns + // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + // retrieve all fields. + SchemaView view = 2; + + // The maximum number of revisions to return per page. + int32 page_size = 3; + + // The page token, received from a previous ListSchemaRevisions call. + // Provide this to retrieve the subsequent page. + string page_token = 4; +} + +// Response for the `ListSchemaRevisions` method. +message ListSchemaRevisionsResponse { + // The revisions of the schema. + repeated Schema schemas = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is empty, there are no subsequent pages. + string next_page_token = 2; +} + +// Request for CommitSchema method. +message CommitSchemaRequest { + // Required. The name of the schema we are revising. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Required. The schema revision to commit. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `RollbackSchema` method. +message RollbackSchemaRequest { + // Required. The schema being rolled back with revision id. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Required. The revision ID to roll back to. + // It must be a revision of the same schema. + // + // Example: c7cfa2a8 + string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteSchemaRevision` method. +message DeleteSchemaRevisionRequest { + // Required. The name of the schema revision to be deleted, with a revision ID + // explicitly included. + // + // Example: `projects/123/schemas/my-schema@c7cfa2a8` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Optional. This field is deprecated and should not be used for specifying + // the revision ID. The revision ID should be specified via the `name` + // parameter. + string revision_id = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `DeleteSchema` method. +message DeleteSchemaRequest { + // Required. Name of the schema to delete. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; +} + +// Request for the `ValidateSchema` method. +message ValidateSchemaRequest { + // Required. The name of the project in which to validate schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The schema object to validate. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `ValidateSchema` method. +// Empty for now. +message ValidateSchemaResponse {} + +// Request for the `ValidateMessage` method. +message ValidateMessageRequest { + // Required. The name of the project in which to validate schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + oneof schema_spec { + // Name of the schema against which to validate. + // + // Format is `projects/{project}/schemas/{schema}`. + string name = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Ad-hoc schema against which to validate + Schema schema = 3; + } + + // Message to validate against the provided `schema_spec`. + bytes message = 4; + + // The encoding expected for messages + Encoding encoding = 5; +} + +// Response for the `ValidateMessage` method. +// Empty for now. +message ValidateMessageResponse {} + +// Possible encoding types for messages. +enum Encoding { + // Unspecified + ENCODING_UNSPECIFIED = 0; + + // JSON encoding + JSON = 1; + + // Binary encoding, as defined by the schema type. For some schema types, + // binary encoding may not be available. + BINARY = 2; +} diff --git a/handwritten/pubsub/protos/protos.d.ts b/handwritten/pubsub/protos/protos.d.ts new file mode 100644 index 00000000000..6f6201d1f82 --- /dev/null +++ b/handwritten/pubsub/protos/protos.d.ts @@ -0,0 +1,18272 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 pubsub. */ + namespace pubsub { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Publisher */ + class Publisher extends $protobuf.rpc.Service { + + /** + * Constructs a new Publisher 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 Publisher 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): Publisher; + + /** + * Calls CreateTopic. + * @param request Topic message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public createTopic(request: google.pubsub.v1.ITopic, callback: google.pubsub.v1.Publisher.CreateTopicCallback): void; + + /** + * Calls CreateTopic. + * @param request Topic message or plain object + * @returns Promise + */ + public createTopic(request: google.pubsub.v1.ITopic): Promise; + + /** + * Calls UpdateTopic. + * @param request UpdateTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest, callback: google.pubsub.v1.Publisher.UpdateTopicCallback): void; + + /** + * Calls UpdateTopic. + * @param request UpdateTopicRequest message or plain object + * @returns Promise + */ + public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest): Promise; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublishResponse + */ + public publish(request: google.pubsub.v1.IPublishRequest, callback: google.pubsub.v1.Publisher.PublishCallback): void; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @returns Promise + */ + public publish(request: google.pubsub.v1.IPublishRequest): Promise; + + /** + * Calls GetTopic. + * @param request GetTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public getTopic(request: google.pubsub.v1.IGetTopicRequest, callback: google.pubsub.v1.Publisher.GetTopicCallback): void; + + /** + * Calls GetTopic. + * @param request GetTopicRequest message or plain object + * @returns Promise + */ + public getTopic(request: google.pubsub.v1.IGetTopicRequest): Promise; + + /** + * Calls ListTopics. + * @param request ListTopicsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicsResponse + */ + public listTopics(request: google.pubsub.v1.IListTopicsRequest, callback: google.pubsub.v1.Publisher.ListTopicsCallback): void; + + /** + * Calls ListTopics. + * @param request ListTopicsRequest message or plain object + * @returns Promise + */ + public listTopics(request: google.pubsub.v1.IListTopicsRequest): Promise; + + /** + * Calls ListTopicSubscriptions. + * @param request ListTopicSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + */ + public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest, callback: google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback): void; + + /** + * Calls ListTopicSubscriptions. + * @param request ListTopicSubscriptionsRequest message or plain object + * @returns Promise + */ + public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest): Promise; + + /** + * Calls ListTopicSnapshots. + * @param request ListTopicSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + */ + public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest, callback: google.pubsub.v1.Publisher.ListTopicSnapshotsCallback): void; + + /** + * Calls ListTopicSnapshots. + * @param request ListTopicSnapshotsRequest message or plain object + * @returns Promise + */ + public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest): Promise; + + /** + * Calls DeleteTopic. + * @param request DeleteTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest, callback: google.pubsub.v1.Publisher.DeleteTopicCallback): void; + + /** + * Calls DeleteTopic. + * @param request DeleteTopicRequest message or plain object + * @returns Promise + */ + public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise; + + /** + * Calls DetachSubscription. + * @param request DetachSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetachSubscriptionResponse + */ + public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest, callback: google.pubsub.v1.Publisher.DetachSubscriptionCallback): void; + + /** + * Calls DetachSubscription. + * @param request DetachSubscriptionRequest message or plain object + * @returns Promise + */ + public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest): Promise; + } + + namespace Publisher { + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type CreateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type UpdateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|publish}. + * @param error Error, if any + * @param [response] PublishResponse + */ + type PublishCallback = (error: (Error|null), response?: google.pubsub.v1.PublishResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type GetTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}. + * @param error Error, if any + * @param [response] ListTopicsResponse + */ + type ListTopicsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}. + * @param error Error, if any + * @param [response] ListTopicSubscriptionsResponse + */ + type ListTopicSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSubscriptionsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}. + * @param error Error, if any + * @param [response] ListTopicSnapshotsResponse + */ + type ListTopicSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}. + * @param error Error, if any + * @param [response] DetachSubscriptionResponse + */ + type DetachSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.DetachSubscriptionResponse) => void; + } + + /** Properties of a MessageStoragePolicy. */ + interface IMessageStoragePolicy { + + /** MessageStoragePolicy allowedPersistenceRegions */ + allowedPersistenceRegions?: (string[]|null); + + /** MessageStoragePolicy enforceInTransit */ + enforceInTransit?: (boolean|null); + } + + /** Represents a MessageStoragePolicy. */ + class MessageStoragePolicy implements IMessageStoragePolicy { + + /** + * Constructs a new MessageStoragePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IMessageStoragePolicy); + + /** MessageStoragePolicy allowedPersistenceRegions. */ + public allowedPersistenceRegions: string[]; + + /** MessageStoragePolicy enforceInTransit. */ + public enforceInTransit: boolean; + + /** + * Creates a new MessageStoragePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageStoragePolicy instance + */ + public static create(properties?: google.pubsub.v1.IMessageStoragePolicy): google.pubsub.v1.MessageStoragePolicy; + + /** + * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @param message MessageStoragePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @param message MessageStoragePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.MessageStoragePolicy; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.MessageStoragePolicy; + + /** + * Verifies a MessageStoragePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageStoragePolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageStoragePolicy; + + /** + * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * @param message MessageStoragePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.MessageStoragePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageStoragePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageStoragePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SchemaSettings. */ + interface ISchemaSettings { + + /** SchemaSettings schema */ + schema?: (string|null); + + /** SchemaSettings encoding */ + encoding?: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding|null); + + /** SchemaSettings firstRevisionId */ + firstRevisionId?: (string|null); + + /** SchemaSettings lastRevisionId */ + lastRevisionId?: (string|null); + } + + /** Represents a SchemaSettings. */ + class SchemaSettings implements ISchemaSettings { + + /** + * Constructs a new SchemaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISchemaSettings); + + /** SchemaSettings schema. */ + public schema: string; + + /** SchemaSettings encoding. */ + public encoding: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding); + + /** SchemaSettings firstRevisionId. */ + public firstRevisionId: string; + + /** SchemaSettings lastRevisionId. */ + public lastRevisionId: string; + + /** + * Creates a new SchemaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaSettings instance + */ + public static create(properties?: google.pubsub.v1.ISchemaSettings): google.pubsub.v1.SchemaSettings; + + /** + * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @param message SchemaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISchemaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @param message SchemaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISchemaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SchemaSettings; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SchemaSettings; + + /** + * Verifies a SchemaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchemaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaSettings + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SchemaSettings; + + /** + * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified. + * @param message SchemaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.SchemaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestionDataSourceSettings. */ + interface IIngestionDataSourceSettings { + + /** IngestionDataSourceSettings awsKinesis */ + awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); + + /** IngestionDataSourceSettings cloudStorage */ + cloudStorage?: (google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage|null); + + /** IngestionDataSourceSettings azureEventHubs */ + azureEventHubs?: (google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs|null); + + /** IngestionDataSourceSettings awsMsk */ + awsMsk?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk|null); + + /** IngestionDataSourceSettings confluentCloud */ + confluentCloud?: (google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud|null); + + /** IngestionDataSourceSettings platformLogsSettings */ + platformLogsSettings?: (google.pubsub.v1.IPlatformLogsSettings|null); + } + + /** Represents an IngestionDataSourceSettings. */ + class IngestionDataSourceSettings implements IIngestionDataSourceSettings { + + /** + * Constructs a new IngestionDataSourceSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IIngestionDataSourceSettings); + + /** IngestionDataSourceSettings awsKinesis. */ + public awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); + + /** IngestionDataSourceSettings cloudStorage. */ + public cloudStorage?: (google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage|null); + + /** IngestionDataSourceSettings azureEventHubs. */ + public azureEventHubs?: (google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs|null); + + /** IngestionDataSourceSettings awsMsk. */ + public awsMsk?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk|null); + + /** IngestionDataSourceSettings confluentCloud. */ + public confluentCloud?: (google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud|null); + + /** IngestionDataSourceSettings platformLogsSettings. */ + public platformLogsSettings?: (google.pubsub.v1.IPlatformLogsSettings|null); + + /** IngestionDataSourceSettings source. */ + public source?: ("awsKinesis"|"cloudStorage"|"azureEventHubs"|"awsMsk"|"confluentCloud"); + + /** + * Creates a new IngestionDataSourceSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestionDataSourceSettings instance + */ + public static create(properties?: google.pubsub.v1.IIngestionDataSourceSettings): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @param message IngestionDataSourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @param message IngestionDataSourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Verifies an IngestionDataSourceSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestionDataSourceSettings + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. + * @param message IngestionDataSourceSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestionDataSourceSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestionDataSourceSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IngestionDataSourceSettings { + + /** Properties of an AwsKinesis. */ + interface IAwsKinesis { + + /** AwsKinesis state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null); + + /** AwsKinesis streamArn */ + streamArn?: (string|null); + + /** AwsKinesis consumerArn */ + consumerArn?: (string|null); + + /** AwsKinesis awsRoleArn */ + awsRoleArn?: (string|null); + + /** AwsKinesis gcpServiceAccount */ + gcpServiceAccount?: (string|null); + } + + /** Represents an AwsKinesis. */ + class AwsKinesis implements IAwsKinesis { + + /** + * Constructs a new AwsKinesis. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis); + + /** AwsKinesis state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State); + + /** AwsKinesis streamArn. */ + public streamArn: string; + + /** AwsKinesis consumerArn. */ + public consumerArn: string; + + /** AwsKinesis awsRoleArn. */ + public awsRoleArn: string; + + /** AwsKinesis gcpServiceAccount. */ + public gcpServiceAccount: string; + + /** + * Creates a new AwsKinesis instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsKinesis instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @param message AwsKinesis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @param message AwsKinesis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Verifies an AwsKinesis message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsKinesis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsKinesis + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. + * @param message AwsKinesis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsKinesis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsKinesis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AwsKinesis { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + KINESIS_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + STREAM_NOT_FOUND = 4, + CONSUMER_NOT_FOUND = 5 + } + } + + /** Properties of a CloudStorage. */ + interface ICloudStorage { + + /** CloudStorage state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State|null); + + /** CloudStorage bucket */ + bucket?: (string|null); + + /** CloudStorage textFormat */ + textFormat?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat|null); + + /** CloudStorage avroFormat */ + avroFormat?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat|null); + + /** CloudStorage pubsubAvroFormat */ + pubsubAvroFormat?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat|null); + + /** CloudStorage minimumObjectCreateTime */ + minimumObjectCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudStorage matchGlob */ + matchGlob?: (string|null); + } + + /** Represents a CloudStorage. */ + class CloudStorage implements ICloudStorage { + + /** + * Constructs a new CloudStorage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage); + + /** CloudStorage state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State); + + /** CloudStorage bucket. */ + public bucket: string; + + /** CloudStorage textFormat. */ + public textFormat?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat|null); + + /** CloudStorage avroFormat. */ + public avroFormat?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat|null); + + /** CloudStorage pubsubAvroFormat. */ + public pubsubAvroFormat?: (google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat|null); + + /** CloudStorage minimumObjectCreateTime. */ + public minimumObjectCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudStorage matchGlob. */ + public matchGlob: string; + + /** CloudStorage inputFormat. */ + public inputFormat?: ("textFormat"|"avroFormat"|"pubsubAvroFormat"); + + /** + * Creates a new CloudStorage instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorage instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage; + + /** + * Encodes the specified CloudStorage message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.verify|verify} messages. + * @param message CloudStorage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorage message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.verify|verify} messages. + * @param message CloudStorage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage; + + /** + * Decodes a CloudStorage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage; + + /** + * Verifies a CloudStorage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage; + + /** + * Creates a plain object from a CloudStorage message. Also converts values to other types if specified. + * @param message CloudStorage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudStorage { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CLOUD_STORAGE_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + BUCKET_NOT_FOUND = 4, + TOO_MANY_OBJECTS = 5 + } + + /** Properties of a TextFormat. */ + interface ITextFormat { + + /** TextFormat delimiter */ + delimiter?: (string|null); + } + + /** Represents a TextFormat. */ + class TextFormat implements ITextFormat { + + /** + * Constructs a new TextFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat); + + /** TextFormat delimiter. */ + public delimiter?: (string|null); + + /** + * Creates a new TextFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns TextFormat instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat; + + /** + * Encodes the specified TextFormat message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.verify|verify} messages. + * @param message TextFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextFormat message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.verify|verify} messages. + * @param message TextFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat; + + /** + * Decodes a TextFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat; + + /** + * Verifies a TextFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextFormat + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat; + + /** + * Creates a plain object from a TextFormat message. Also converts values to other types if specified. + * @param message TextFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AvroFormat. */ + interface IAvroFormat { + } + + /** Represents an AvroFormat. */ + class AvroFormat implements IAvroFormat { + + /** + * Constructs a new AvroFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat); + + /** + * Creates a new AvroFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroFormat instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat; + + /** + * Encodes the specified AvroFormat message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.verify|verify} messages. + * @param message AvroFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroFormat message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.verify|verify} messages. + * @param message AvroFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat; + + /** + * Decodes an AvroFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat; + + /** + * Verifies an AvroFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvroFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroFormat + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat; + + /** + * Creates a plain object from an AvroFormat message. Also converts values to other types if specified. + * @param message AvroFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PubSubAvroFormat. */ + interface IPubSubAvroFormat { + } + + /** Represents a PubSubAvroFormat. */ + class PubSubAvroFormat implements IPubSubAvroFormat { + + /** + * Constructs a new PubSubAvroFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat); + + /** + * Creates a new PubSubAvroFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns PubSubAvroFormat instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat; + + /** + * Encodes the specified PubSubAvroFormat message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.verify|verify} messages. + * @param message PubSubAvroFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubSubAvroFormat message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.verify|verify} messages. + * @param message PubSubAvroFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubSubAvroFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubSubAvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat; + + /** + * Decodes a PubSubAvroFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubSubAvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat; + + /** + * Verifies a PubSubAvroFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubSubAvroFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubSubAvroFormat + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat; + + /** + * Creates a plain object from a PubSubAvroFormat message. Also converts values to other types if specified. + * @param message PubSubAvroFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubSubAvroFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubSubAvroFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AzureEventHubs. */ + interface IAzureEventHubs { + + /** AzureEventHubs state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State|null); + + /** AzureEventHubs resourceGroup */ + resourceGroup?: (string|null); + + /** AzureEventHubs namespace */ + namespace?: (string|null); + + /** AzureEventHubs eventHub */ + eventHub?: (string|null); + + /** AzureEventHubs clientId */ + clientId?: (string|null); + + /** AzureEventHubs tenantId */ + tenantId?: (string|null); + + /** AzureEventHubs subscriptionId */ + subscriptionId?: (string|null); + + /** AzureEventHubs gcpServiceAccount */ + gcpServiceAccount?: (string|null); + } + + /** Represents an AzureEventHubs. */ + class AzureEventHubs implements IAzureEventHubs { + + /** + * Constructs a new AzureEventHubs. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs); + + /** AzureEventHubs state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State); + + /** AzureEventHubs resourceGroup. */ + public resourceGroup: string; + + /** AzureEventHubs namespace. */ + public namespace: string; + + /** AzureEventHubs eventHub. */ + public eventHub: string; + + /** AzureEventHubs clientId. */ + public clientId: string; + + /** AzureEventHubs tenantId. */ + public tenantId: string; + + /** AzureEventHubs subscriptionId. */ + public subscriptionId: string; + + /** AzureEventHubs gcpServiceAccount. */ + public gcpServiceAccount: string; + + /** + * Creates a new AzureEventHubs instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureEventHubs instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs): google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs; + + /** + * Encodes the specified AzureEventHubs message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.verify|verify} messages. + * @param message AzureEventHubs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureEventHubs message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.verify|verify} messages. + * @param message AzureEventHubs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureEventHubs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureEventHubs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs; + + /** + * Decodes an AzureEventHubs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureEventHubs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs; + + /** + * Verifies an AzureEventHubs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AzureEventHubs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureEventHubs + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs; + + /** + * Creates a plain object from an AzureEventHubs message. Also converts values to other types if specified. + * @param message AzureEventHubs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureEventHubs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureEventHubs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AzureEventHubs { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + EVENT_HUBS_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + NAMESPACE_NOT_FOUND = 4, + EVENT_HUB_NOT_FOUND = 5, + SUBSCRIPTION_NOT_FOUND = 6, + RESOURCE_GROUP_NOT_FOUND = 7 + } + } + + /** Properties of an AwsMsk. */ + interface IAwsMsk { + + /** AwsMsk state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State|null); + + /** AwsMsk clusterArn */ + clusterArn?: (string|null); + + /** AwsMsk topic */ + topic?: (string|null); + + /** AwsMsk awsRoleArn */ + awsRoleArn?: (string|null); + + /** AwsMsk gcpServiceAccount */ + gcpServiceAccount?: (string|null); + } + + /** Represents an AwsMsk. */ + class AwsMsk implements IAwsMsk { + + /** + * Constructs a new AwsMsk. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk); + + /** AwsMsk state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State); + + /** AwsMsk clusterArn. */ + public clusterArn: string; + + /** AwsMsk topic. */ + public topic: string; + + /** AwsMsk awsRoleArn. */ + public awsRoleArn: string; + + /** AwsMsk gcpServiceAccount. */ + public gcpServiceAccount: string; + + /** + * Creates a new AwsMsk instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsMsk instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk): google.pubsub.v1.IngestionDataSourceSettings.AwsMsk; + + /** + * Encodes the specified AwsMsk message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.verify|verify} messages. + * @param message AwsMsk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsMsk message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.verify|verify} messages. + * @param message AwsMsk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsMsk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsMsk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.AwsMsk; + + /** + * Decodes an AwsMsk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsMsk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.AwsMsk; + + /** + * Verifies an AwsMsk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsMsk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsMsk + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.AwsMsk; + + /** + * Creates a plain object from an AwsMsk message. Also converts values to other types if specified. + * @param message AwsMsk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.AwsMsk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsMsk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsMsk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AwsMsk { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + MSK_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + CLUSTER_NOT_FOUND = 4, + TOPIC_NOT_FOUND = 5 + } + } + + /** Properties of a ConfluentCloud. */ + interface IConfluentCloud { + + /** ConfluentCloud state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State|null); + + /** ConfluentCloud bootstrapServer */ + bootstrapServer?: (string|null); + + /** ConfluentCloud clusterId */ + clusterId?: (string|null); + + /** ConfluentCloud topic */ + topic?: (string|null); + + /** ConfluentCloud identityPoolId */ + identityPoolId?: (string|null); + + /** ConfluentCloud gcpServiceAccount */ + gcpServiceAccount?: (string|null); + } + + /** Represents a ConfluentCloud. */ + class ConfluentCloud implements IConfluentCloud { + + /** + * Constructs a new ConfluentCloud. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud); + + /** ConfluentCloud state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State); + + /** ConfluentCloud bootstrapServer. */ + public bootstrapServer: string; + + /** ConfluentCloud clusterId. */ + public clusterId: string; + + /** ConfluentCloud topic. */ + public topic: string; + + /** ConfluentCloud identityPoolId. */ + public identityPoolId: string; + + /** ConfluentCloud gcpServiceAccount. */ + public gcpServiceAccount: string; + + /** + * Creates a new ConfluentCloud instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfluentCloud instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud): google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud; + + /** + * Encodes the specified ConfluentCloud message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.verify|verify} messages. + * @param message ConfluentCloud message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfluentCloud message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.verify|verify} messages. + * @param message ConfluentCloud message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfluentCloud message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfluentCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud; + + /** + * Decodes a ConfluentCloud message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfluentCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud; + + /** + * Verifies a ConfluentCloud message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfluentCloud message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfluentCloud + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud; + + /** + * Creates a plain object from a ConfluentCloud message. Also converts values to other types if specified. + * @param message ConfluentCloud + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfluentCloud to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfluentCloud + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfluentCloud { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CONFLUENT_CLOUD_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + UNREACHABLE_BOOTSTRAP_SERVER = 4, + CLUSTER_NOT_FOUND = 5, + TOPIC_NOT_FOUND = 6 + } + } + } + + /** Properties of a PlatformLogsSettings. */ + interface IPlatformLogsSettings { + + /** PlatformLogsSettings severity */ + severity?: (google.pubsub.v1.PlatformLogsSettings.Severity|keyof typeof google.pubsub.v1.PlatformLogsSettings.Severity|null); + } + + /** Represents a PlatformLogsSettings. */ + class PlatformLogsSettings implements IPlatformLogsSettings { + + /** + * Constructs a new PlatformLogsSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPlatformLogsSettings); + + /** PlatformLogsSettings severity. */ + public severity: (google.pubsub.v1.PlatformLogsSettings.Severity|keyof typeof google.pubsub.v1.PlatformLogsSettings.Severity); + + /** + * Creates a new PlatformLogsSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PlatformLogsSettings instance + */ + public static create(properties?: google.pubsub.v1.IPlatformLogsSettings): google.pubsub.v1.PlatformLogsSettings; + + /** + * Encodes the specified PlatformLogsSettings message. Does not implicitly {@link google.pubsub.v1.PlatformLogsSettings.verify|verify} messages. + * @param message PlatformLogsSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPlatformLogsSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlatformLogsSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.PlatformLogsSettings.verify|verify} messages. + * @param message PlatformLogsSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPlatformLogsSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlatformLogsSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlatformLogsSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PlatformLogsSettings; + + /** + * Decodes a PlatformLogsSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlatformLogsSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PlatformLogsSettings; + + /** + * Verifies a PlatformLogsSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlatformLogsSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlatformLogsSettings + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PlatformLogsSettings; + + /** + * Creates a plain object from a PlatformLogsSettings message. Also converts values to other types if specified. + * @param message PlatformLogsSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PlatformLogsSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlatformLogsSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlatformLogsSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PlatformLogsSettings { + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + DISABLED = 1, + DEBUG = 2, + INFO = 3, + WARNING = 4, + ERROR = 5 + } + } + + /** Properties of an IngestionFailureEvent. */ + interface IIngestionFailureEvent { + + /** IngestionFailureEvent topic */ + topic?: (string|null); + + /** IngestionFailureEvent errorMessage */ + errorMessage?: (string|null); + + /** IngestionFailureEvent cloudStorageFailure */ + cloudStorageFailure?: (google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure|null); + + /** IngestionFailureEvent awsMskFailure */ + awsMskFailure?: (google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason|null); + + /** IngestionFailureEvent azureEventHubsFailure */ + azureEventHubsFailure?: (google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason|null); + + /** IngestionFailureEvent confluentCloudFailure */ + confluentCloudFailure?: (google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason|null); + + /** IngestionFailureEvent awsKinesisFailure */ + awsKinesisFailure?: (google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason|null); + } + + /** Represents an IngestionFailureEvent. */ + class IngestionFailureEvent implements IIngestionFailureEvent { + + /** + * Constructs a new IngestionFailureEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IIngestionFailureEvent); + + /** IngestionFailureEvent topic. */ + public topic: string; + + /** IngestionFailureEvent errorMessage. */ + public errorMessage: string; + + /** IngestionFailureEvent cloudStorageFailure. */ + public cloudStorageFailure?: (google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure|null); + + /** IngestionFailureEvent awsMskFailure. */ + public awsMskFailure?: (google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason|null); + + /** IngestionFailureEvent azureEventHubsFailure. */ + public azureEventHubsFailure?: (google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason|null); + + /** IngestionFailureEvent confluentCloudFailure. */ + public confluentCloudFailure?: (google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason|null); + + /** IngestionFailureEvent awsKinesisFailure. */ + public awsKinesisFailure?: (google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason|null); + + /** IngestionFailureEvent failure. */ + public failure?: ("cloudStorageFailure"|"awsMskFailure"|"azureEventHubsFailure"|"confluentCloudFailure"|"awsKinesisFailure"); + + /** + * Creates a new IngestionFailureEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestionFailureEvent instance + */ + public static create(properties?: google.pubsub.v1.IIngestionFailureEvent): google.pubsub.v1.IngestionFailureEvent; + + /** + * Encodes the specified IngestionFailureEvent message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.verify|verify} messages. + * @param message IngestionFailureEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IIngestionFailureEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestionFailureEvent message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.verify|verify} messages. + * @param message IngestionFailureEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IIngestionFailureEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestionFailureEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestionFailureEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent; + + /** + * Decodes an IngestionFailureEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestionFailureEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent; + + /** + * Verifies an IngestionFailureEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestionFailureEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestionFailureEvent + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent; + + /** + * Creates a plain object from an IngestionFailureEvent message. Also converts values to other types if specified. + * @param message IngestionFailureEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestionFailureEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestionFailureEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IngestionFailureEvent { + + /** Properties of an ApiViolationReason. */ + interface IApiViolationReason { + } + + /** Represents an ApiViolationReason. */ + class ApiViolationReason implements IApiViolationReason { + + /** + * Constructs a new ApiViolationReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IApiViolationReason); + + /** + * Creates a new ApiViolationReason instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiViolationReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IApiViolationReason): google.pubsub.v1.IngestionFailureEvent.ApiViolationReason; + + /** + * Encodes the specified ApiViolationReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify|verify} messages. + * @param message ApiViolationReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IApiViolationReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiViolationReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify|verify} messages. + * @param message ApiViolationReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IApiViolationReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiViolationReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.ApiViolationReason; + + /** + * Decodes an ApiViolationReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.ApiViolationReason; + + /** + * Verifies an ApiViolationReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiViolationReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiViolationReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.ApiViolationReason; + + /** + * Creates a plain object from an ApiViolationReason message. Also converts values to other types if specified. + * @param message ApiViolationReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.ApiViolationReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiViolationReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiViolationReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AvroFailureReason. */ + interface IAvroFailureReason { + } + + /** Represents an AvroFailureReason. */ + class AvroFailureReason implements IAvroFailureReason { + + /** + * Constructs a new AvroFailureReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason); + + /** + * Creates a new AvroFailureReason instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroFailureReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason): google.pubsub.v1.IngestionFailureEvent.AvroFailureReason; + + /** + * Encodes the specified AvroFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.verify|verify} messages. + * @param message AvroFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.verify|verify} messages. + * @param message AvroFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroFailureReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.AvroFailureReason; + + /** + * Decodes an AvroFailureReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.AvroFailureReason; + + /** + * Verifies an AvroFailureReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvroFailureReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroFailureReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.AvroFailureReason; + + /** + * Creates a plain object from an AvroFailureReason message. Also converts values to other types if specified. + * @param message AvroFailureReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.AvroFailureReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroFailureReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroFailureReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SchemaViolationReason. */ + interface ISchemaViolationReason { + } + + /** Represents a SchemaViolationReason. */ + class SchemaViolationReason implements ISchemaViolationReason { + + /** + * Constructs a new SchemaViolationReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason); + + /** + * Creates a new SchemaViolationReason instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaViolationReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason): google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason; + + /** + * Encodes the specified SchemaViolationReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify|verify} messages. + * @param message SchemaViolationReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaViolationReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify|verify} messages. + * @param message SchemaViolationReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaViolationReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason; + + /** + * Decodes a SchemaViolationReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason; + + /** + * Verifies a SchemaViolationReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchemaViolationReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaViolationReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason; + + /** + * Creates a plain object from a SchemaViolationReason message. Also converts values to other types if specified. + * @param message SchemaViolationReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaViolationReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaViolationReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageTransformationFailureReason. */ + interface IMessageTransformationFailureReason { + } + + /** Represents a MessageTransformationFailureReason. */ + class MessageTransformationFailureReason implements IMessageTransformationFailureReason { + + /** + * Constructs a new MessageTransformationFailureReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason); + + /** + * Creates a new MessageTransformationFailureReason instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageTransformationFailureReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason): google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason; + + /** + * Encodes the specified MessageTransformationFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify|verify} messages. + * @param message MessageTransformationFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageTransformationFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify|verify} messages. + * @param message MessageTransformationFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageTransformationFailureReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageTransformationFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason; + + /** + * Decodes a MessageTransformationFailureReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageTransformationFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason; + + /** + * Verifies a MessageTransformationFailureReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageTransformationFailureReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageTransformationFailureReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason; + + /** + * Creates a plain object from a MessageTransformationFailureReason message. Also converts values to other types if specified. + * @param message MessageTransformationFailureReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageTransformationFailureReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageTransformationFailureReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudStorageFailure. */ + interface ICloudStorageFailure { + + /** CloudStorageFailure bucket */ + bucket?: (string|null); + + /** CloudStorageFailure objectName */ + objectName?: (string|null); + + /** CloudStorageFailure objectGeneration */ + objectGeneration?: (number|Long|string|null); + + /** CloudStorageFailure avroFailureReason */ + avroFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason|null); + + /** CloudStorageFailure apiViolationReason */ + apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** CloudStorageFailure schemaViolationReason */ + schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** CloudStorageFailure messageTransformationFailureReason */ + messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + } + + /** Represents a CloudStorageFailure. */ + class CloudStorageFailure implements ICloudStorageFailure { + + /** + * Constructs a new CloudStorageFailure. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure); + + /** CloudStorageFailure bucket. */ + public bucket: string; + + /** CloudStorageFailure objectName. */ + public objectName: string; + + /** CloudStorageFailure objectGeneration. */ + public objectGeneration: (number|Long|string); + + /** CloudStorageFailure avroFailureReason. */ + public avroFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason|null); + + /** CloudStorageFailure apiViolationReason. */ + public apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** CloudStorageFailure schemaViolationReason. */ + public schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** CloudStorageFailure messageTransformationFailureReason. */ + public messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + + /** CloudStorageFailure reason. */ + public reason?: ("avroFailureReason"|"apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"); + + /** + * Creates a new CloudStorageFailure instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageFailure instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure): google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure; + + /** + * Encodes the specified CloudStorageFailure message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.verify|verify} messages. + * @param message CloudStorageFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageFailure message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.verify|verify} messages. + * @param message CloudStorageFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageFailure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure; + + /** + * Decodes a CloudStorageFailure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure; + + /** + * Verifies a CloudStorageFailure message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorageFailure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageFailure + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure; + + /** + * Creates a plain object from a CloudStorageFailure message. Also converts values to other types if specified. + * @param message CloudStorageFailure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageFailure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageFailure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsMskFailureReason. */ + interface IAwsMskFailureReason { + + /** AwsMskFailureReason clusterArn */ + clusterArn?: (string|null); + + /** AwsMskFailureReason kafkaTopic */ + kafkaTopic?: (string|null); + + /** AwsMskFailureReason partitionId */ + partitionId?: (number|Long|string|null); + + /** AwsMskFailureReason offset */ + offset?: (number|Long|string|null); + + /** AwsMskFailureReason apiViolationReason */ + apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** AwsMskFailureReason schemaViolationReason */ + schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** AwsMskFailureReason messageTransformationFailureReason */ + messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + } + + /** Represents an AwsMskFailureReason. */ + class AwsMskFailureReason implements IAwsMskFailureReason { + + /** + * Constructs a new AwsMskFailureReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason); + + /** AwsMskFailureReason clusterArn. */ + public clusterArn: string; + + /** AwsMskFailureReason kafkaTopic. */ + public kafkaTopic: string; + + /** AwsMskFailureReason partitionId. */ + public partitionId: (number|Long|string); + + /** AwsMskFailureReason offset. */ + public offset: (number|Long|string); + + /** AwsMskFailureReason apiViolationReason. */ + public apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** AwsMskFailureReason schemaViolationReason. */ + public schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** AwsMskFailureReason messageTransformationFailureReason. */ + public messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + + /** AwsMskFailureReason reason. */ + public reason?: ("apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"); + + /** + * Creates a new AwsMskFailureReason instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsMskFailureReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason): google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason; + + /** + * Encodes the specified AwsMskFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.verify|verify} messages. + * @param message AwsMskFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsMskFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.verify|verify} messages. + * @param message AwsMskFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsMskFailureReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsMskFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason; + + /** + * Decodes an AwsMskFailureReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsMskFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason; + + /** + * Verifies an AwsMskFailureReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsMskFailureReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsMskFailureReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason; + + /** + * Creates a plain object from an AwsMskFailureReason message. Also converts values to other types if specified. + * @param message AwsMskFailureReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsMskFailureReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsMskFailureReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureEventHubsFailureReason. */ + interface IAzureEventHubsFailureReason { + + /** AzureEventHubsFailureReason namespace */ + namespace?: (string|null); + + /** AzureEventHubsFailureReason eventHub */ + eventHub?: (string|null); + + /** AzureEventHubsFailureReason partitionId */ + partitionId?: (number|Long|string|null); + + /** AzureEventHubsFailureReason offset */ + offset?: (number|Long|string|null); + + /** AzureEventHubsFailureReason apiViolationReason */ + apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** AzureEventHubsFailureReason schemaViolationReason */ + schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** AzureEventHubsFailureReason messageTransformationFailureReason */ + messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + } + + /** Represents an AzureEventHubsFailureReason. */ + class AzureEventHubsFailureReason implements IAzureEventHubsFailureReason { + + /** + * Constructs a new AzureEventHubsFailureReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason); + + /** AzureEventHubsFailureReason namespace. */ + public namespace: string; + + /** AzureEventHubsFailureReason eventHub. */ + public eventHub: string; + + /** AzureEventHubsFailureReason partitionId. */ + public partitionId: (number|Long|string); + + /** AzureEventHubsFailureReason offset. */ + public offset: (number|Long|string); + + /** AzureEventHubsFailureReason apiViolationReason. */ + public apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** AzureEventHubsFailureReason schemaViolationReason. */ + public schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** AzureEventHubsFailureReason messageTransformationFailureReason. */ + public messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + + /** AzureEventHubsFailureReason reason. */ + public reason?: ("apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"); + + /** + * Creates a new AzureEventHubsFailureReason instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureEventHubsFailureReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason): google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason; + + /** + * Encodes the specified AzureEventHubsFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.verify|verify} messages. + * @param message AzureEventHubsFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureEventHubsFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.verify|verify} messages. + * @param message AzureEventHubsFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureEventHubsFailureReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureEventHubsFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason; + + /** + * Decodes an AzureEventHubsFailureReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureEventHubsFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason; + + /** + * Verifies an AzureEventHubsFailureReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AzureEventHubsFailureReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureEventHubsFailureReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason; + + /** + * Creates a plain object from an AzureEventHubsFailureReason message. Also converts values to other types if specified. + * @param message AzureEventHubsFailureReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureEventHubsFailureReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureEventHubsFailureReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfluentCloudFailureReason. */ + interface IConfluentCloudFailureReason { + + /** ConfluentCloudFailureReason clusterId */ + clusterId?: (string|null); + + /** ConfluentCloudFailureReason kafkaTopic */ + kafkaTopic?: (string|null); + + /** ConfluentCloudFailureReason partitionId */ + partitionId?: (number|Long|string|null); + + /** ConfluentCloudFailureReason offset */ + offset?: (number|Long|string|null); + + /** ConfluentCloudFailureReason apiViolationReason */ + apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** ConfluentCloudFailureReason schemaViolationReason */ + schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** ConfluentCloudFailureReason messageTransformationFailureReason */ + messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + } + + /** Represents a ConfluentCloudFailureReason. */ + class ConfluentCloudFailureReason implements IConfluentCloudFailureReason { + + /** + * Constructs a new ConfluentCloudFailureReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason); + + /** ConfluentCloudFailureReason clusterId. */ + public clusterId: string; + + /** ConfluentCloudFailureReason kafkaTopic. */ + public kafkaTopic: string; + + /** ConfluentCloudFailureReason partitionId. */ + public partitionId: (number|Long|string); + + /** ConfluentCloudFailureReason offset. */ + public offset: (number|Long|string); + + /** ConfluentCloudFailureReason apiViolationReason. */ + public apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** ConfluentCloudFailureReason schemaViolationReason. */ + public schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** ConfluentCloudFailureReason messageTransformationFailureReason. */ + public messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + + /** ConfluentCloudFailureReason reason. */ + public reason?: ("apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"); + + /** + * Creates a new ConfluentCloudFailureReason instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfluentCloudFailureReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason): google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason; + + /** + * Encodes the specified ConfluentCloudFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.verify|verify} messages. + * @param message ConfluentCloudFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfluentCloudFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.verify|verify} messages. + * @param message ConfluentCloudFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfluentCloudFailureReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfluentCloudFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason; + + /** + * Decodes a ConfluentCloudFailureReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfluentCloudFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason; + + /** + * Verifies a ConfluentCloudFailureReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfluentCloudFailureReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfluentCloudFailureReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason; + + /** + * Creates a plain object from a ConfluentCloudFailureReason message. Also converts values to other types if specified. + * @param message ConfluentCloudFailureReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfluentCloudFailureReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfluentCloudFailureReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsKinesisFailureReason. */ + interface IAwsKinesisFailureReason { + + /** AwsKinesisFailureReason streamArn */ + streamArn?: (string|null); + + /** AwsKinesisFailureReason partitionKey */ + partitionKey?: (string|null); + + /** AwsKinesisFailureReason sequenceNumber */ + sequenceNumber?: (string|null); + + /** AwsKinesisFailureReason schemaViolationReason */ + schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** AwsKinesisFailureReason messageTransformationFailureReason */ + messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + + /** AwsKinesisFailureReason apiViolationReason */ + apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + } + + /** Represents an AwsKinesisFailureReason. */ + class AwsKinesisFailureReason implements IAwsKinesisFailureReason { + + /** + * Constructs a new AwsKinesisFailureReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason); + + /** AwsKinesisFailureReason streamArn. */ + public streamArn: string; + + /** AwsKinesisFailureReason partitionKey. */ + public partitionKey: string; + + /** AwsKinesisFailureReason sequenceNumber. */ + public sequenceNumber: string; + + /** AwsKinesisFailureReason schemaViolationReason. */ + public schemaViolationReason?: (google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null); + + /** AwsKinesisFailureReason messageTransformationFailureReason. */ + public messageTransformationFailureReason?: (google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null); + + /** AwsKinesisFailureReason apiViolationReason. */ + public apiViolationReason?: (google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null); + + /** AwsKinesisFailureReason reason. */ + public reason?: ("schemaViolationReason"|"messageTransformationFailureReason"|"apiViolationReason"); + + /** + * Creates a new AwsKinesisFailureReason instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsKinesisFailureReason instance + */ + public static create(properties?: google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason): google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason; + + /** + * Encodes the specified AwsKinesisFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.verify|verify} messages. + * @param message AwsKinesisFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsKinesisFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.verify|verify} messages. + * @param message AwsKinesisFailureReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsKinesisFailureReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsKinesisFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason; + + /** + * Decodes an AwsKinesisFailureReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsKinesisFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason; + + /** + * Verifies an AwsKinesisFailureReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsKinesisFailureReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsKinesisFailureReason + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason; + + /** + * Creates a plain object from an AwsKinesisFailureReason message. Also converts values to other types if specified. + * @param message AwsKinesisFailureReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsKinesisFailureReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsKinesisFailureReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a JavaScriptUDF. */ + interface IJavaScriptUDF { + + /** JavaScriptUDF functionName */ + functionName?: (string|null); + + /** JavaScriptUDF code */ + code?: (string|null); + } + + /** Represents a JavaScriptUDF. */ + class JavaScriptUDF implements IJavaScriptUDF { + + /** + * Constructs a new JavaScriptUDF. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IJavaScriptUDF); + + /** JavaScriptUDF functionName. */ + public functionName: string; + + /** JavaScriptUDF code. */ + public code: string; + + /** + * Creates a new JavaScriptUDF instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaScriptUDF instance + */ + public static create(properties?: google.pubsub.v1.IJavaScriptUDF): google.pubsub.v1.JavaScriptUDF; + + /** + * Encodes the specified JavaScriptUDF message. Does not implicitly {@link google.pubsub.v1.JavaScriptUDF.verify|verify} messages. + * @param message JavaScriptUDF message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IJavaScriptUDF, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaScriptUDF message, length delimited. Does not implicitly {@link google.pubsub.v1.JavaScriptUDF.verify|verify} messages. + * @param message JavaScriptUDF message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IJavaScriptUDF, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaScriptUDF message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaScriptUDF + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.JavaScriptUDF; + + /** + * Decodes a JavaScriptUDF message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaScriptUDF + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.JavaScriptUDF; + + /** + * Verifies a JavaScriptUDF message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaScriptUDF message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaScriptUDF + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.JavaScriptUDF; + + /** + * Creates a plain object from a JavaScriptUDF message. Also converts values to other types if specified. + * @param message JavaScriptUDF + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.JavaScriptUDF, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaScriptUDF to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaScriptUDF + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessageTransform. */ + interface IMessageTransform { + + /** MessageTransform javascriptUdf */ + javascriptUdf?: (google.pubsub.v1.IJavaScriptUDF|null); + + /** MessageTransform enabled */ + enabled?: (boolean|null); + + /** MessageTransform disabled */ + disabled?: (boolean|null); + } + + /** Represents a MessageTransform. */ + class MessageTransform implements IMessageTransform { + + /** + * Constructs a new MessageTransform. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IMessageTransform); + + /** MessageTransform javascriptUdf. */ + public javascriptUdf?: (google.pubsub.v1.IJavaScriptUDF|null); + + /** MessageTransform enabled. */ + public enabled: boolean; + + /** MessageTransform disabled. */ + public disabled: boolean; + + /** MessageTransform transform. */ + public transform?: "javascriptUdf"; + + /** + * Creates a new MessageTransform instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageTransform instance + */ + public static create(properties?: google.pubsub.v1.IMessageTransform): google.pubsub.v1.MessageTransform; + + /** + * Encodes the specified MessageTransform message. Does not implicitly {@link google.pubsub.v1.MessageTransform.verify|verify} messages. + * @param message MessageTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IMessageTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageTransform message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageTransform.verify|verify} messages. + * @param message MessageTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IMessageTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageTransform message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.MessageTransform; + + /** + * Decodes a MessageTransform message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.MessageTransform; + + /** + * Verifies a MessageTransform message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageTransform message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageTransform + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageTransform; + + /** + * Creates a plain object from a MessageTransform message. Also converts values to other types if specified. + * @param message MessageTransform + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.MessageTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageTransform to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageTransform + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Topic. */ + interface ITopic { + + /** Topic name */ + name?: (string|null); + + /** Topic labels */ + labels?: ({ [k: string]: string }|null); + + /** Topic messageStoragePolicy */ + messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); + + /** Topic kmsKeyName */ + kmsKeyName?: (string|null); + + /** Topic schemaSettings */ + schemaSettings?: (google.pubsub.v1.ISchemaSettings|null); + + /** Topic satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Topic messageRetentionDuration */ + messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Topic state */ + state?: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State|null); + + /** Topic ingestionDataSourceSettings */ + ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); + + /** Topic messageTransforms */ + messageTransforms?: (google.pubsub.v1.IMessageTransform[]|null); + + /** Topic tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents a Topic. */ + class Topic implements ITopic { + + /** + * Constructs a new Topic. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ITopic); + + /** Topic name. */ + public name: string; + + /** Topic labels. */ + public labels: { [k: string]: string }; + + /** Topic messageStoragePolicy. */ + public messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); + + /** Topic kmsKeyName. */ + public kmsKeyName: string; + + /** Topic schemaSettings. */ + public schemaSettings?: (google.pubsub.v1.ISchemaSettings|null); + + /** Topic satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Topic messageRetentionDuration. */ + public messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Topic state. */ + public state: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State); + + /** Topic ingestionDataSourceSettings. */ + public ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); + + /** Topic messageTransforms. */ + public messageTransforms: google.pubsub.v1.IMessageTransform[]; + + /** Topic tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Topic instance using the specified properties. + * @param [properties] Properties to set + * @returns Topic instance + */ + public static create(properties?: google.pubsub.v1.ITopic): google.pubsub.v1.Topic; + + /** + * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Topic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Topic; + + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Topic; + + /** + * Verifies a Topic message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Topic + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Topic; + + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @param message Topic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Topic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Topic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Topic { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INGESTION_RESOURCE_ERROR = 2 + } + } + + /** Properties of a PubsubMessage. */ + interface IPubsubMessage { + + /** PubsubMessage data */ + data?: (Uint8Array|Buffer|string|null); + + /** PubsubMessage attributes */ + attributes?: ({ [k: string]: string }|null); + + /** PubsubMessage messageId */ + messageId?: (string|null); + + /** PubsubMessage publishTime */ + publishTime?: (google.protobuf.ITimestamp|null); + + /** PubsubMessage orderingKey */ + orderingKey?: (string|null); + } + + /** Represents a PubsubMessage. */ + class PubsubMessage implements IPubsubMessage { + + /** + * Constructs a new PubsubMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPubsubMessage); + + /** PubsubMessage data. */ + public data: (Uint8Array|Buffer|string); + + /** PubsubMessage attributes. */ + public attributes: { [k: string]: string }; + + /** PubsubMessage messageId. */ + public messageId: string; + + /** PubsubMessage publishTime. */ + public publishTime?: (google.protobuf.ITimestamp|null); + + /** PubsubMessage orderingKey. */ + public orderingKey: string; + + /** + * Creates a new PubsubMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubMessage instance + */ + public static create(properties?: google.pubsub.v1.IPubsubMessage): google.pubsub.v1.PubsubMessage; + + /** + * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @param message PubsubMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @param message PubsubMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PubsubMessage; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PubsubMessage; + + /** + * Verifies a PubsubMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubMessage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PubsubMessage; + + /** + * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * @param message PubsubMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PubsubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTopicRequest. */ + interface IGetTopicRequest { + + /** GetTopicRequest topic */ + topic?: (string|null); + } + + /** Represents a GetTopicRequest. */ + class GetTopicRequest implements IGetTopicRequest { + + /** + * Constructs a new GetTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetTopicRequest); + + /** GetTopicRequest topic. */ + public topic: string; + + /** + * Creates a new GetTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetTopicRequest): google.pubsub.v1.GetTopicRequest; + + /** + * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @param message GetTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @param message GetTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetTopicRequest; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetTopicRequest; + + /** + * Verifies a GetTopicRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetTopicRequest; + + /** + * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * @param message GetTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTopicRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTopicRequest. */ + interface IUpdateTopicRequest { + + /** UpdateTopicRequest topic */ + topic?: (google.pubsub.v1.ITopic|null); + + /** UpdateTopicRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTopicRequest. */ + class UpdateTopicRequest implements IUpdateTopicRequest { + + /** + * Constructs a new UpdateTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateTopicRequest); + + /** UpdateTopicRequest topic. */ + public topic?: (google.pubsub.v1.ITopic|null); + + /** UpdateTopicRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateTopicRequest): google.pubsub.v1.UpdateTopicRequest; + + /** + * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @param message UpdateTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @param message UpdateTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateTopicRequest; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateTopicRequest; + + /** + * Verifies an UpdateTopicRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateTopicRequest; + + /** + * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * @param message UpdateTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTopicRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublishRequest. */ + interface IPublishRequest { + + /** PublishRequest topic */ + topic?: (string|null); + + /** PublishRequest messages */ + messages?: (google.pubsub.v1.IPubsubMessage[]|null); + } + + /** Represents a PublishRequest. */ + class PublishRequest implements IPublishRequest { + + /** + * Constructs a new PublishRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPublishRequest); + + /** PublishRequest topic. */ + public topic: string; + + /** PublishRequest messages. */ + public messages: google.pubsub.v1.IPubsubMessage[]; + + /** + * Creates a new PublishRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishRequest instance + */ + public static create(properties?: google.pubsub.v1.IPublishRequest): google.pubsub.v1.PublishRequest; + + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishRequest; + + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishRequest; + + /** + * Verifies a PublishRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishRequest; + + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @param message PublishRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublishResponse. */ + interface IPublishResponse { + + /** PublishResponse messageIds */ + messageIds?: (string[]|null); + } + + /** Represents a PublishResponse. */ + class PublishResponse implements IPublishResponse { + + /** + * Constructs a new PublishResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPublishResponse); + + /** PublishResponse messageIds. */ + public messageIds: string[]; + + /** + * Creates a new PublishResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishResponse instance + */ + public static create(properties?: google.pubsub.v1.IPublishResponse): google.pubsub.v1.PublishResponse; + + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishResponse; + + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishResponse; + + /** + * Verifies a PublishResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishResponse; + + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @param message PublishResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicsRequest. */ + interface IListTopicsRequest { + + /** ListTopicsRequest project */ + project?: (string|null); + + /** ListTopicsRequest pageSize */ + pageSize?: (number|null); + + /** ListTopicsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTopicsRequest. */ + class ListTopicsRequest implements IListTopicsRequest { + + /** + * Constructs a new ListTopicsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicsRequest); + + /** ListTopicsRequest project. */ + public project: string; + + /** ListTopicsRequest pageSize. */ + public pageSize: number; + + /** ListTopicsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTopicsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicsRequest): google.pubsub.v1.ListTopicsRequest; + + /** + * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @param message ListTopicsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @param message ListTopicsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsRequest; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsRequest; + + /** + * Verifies a ListTopicsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsRequest; + + /** + * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * @param message ListTopicsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicsResponse. */ + interface IListTopicsResponse { + + /** ListTopicsResponse topics */ + topics?: (google.pubsub.v1.ITopic[]|null); + + /** ListTopicsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTopicsResponse. */ + class ListTopicsResponse implements IListTopicsResponse { + + /** + * Constructs a new ListTopicsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicsResponse); + + /** ListTopicsResponse topics. */ + public topics: google.pubsub.v1.ITopic[]; + + /** ListTopicsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTopicsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicsResponse): google.pubsub.v1.ListTopicsResponse; + + /** + * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @param message ListTopicsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @param message ListTopicsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsResponse; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsResponse; + + /** + * Verifies a ListTopicsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsResponse; + + /** + * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * @param message ListTopicsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSubscriptionsRequest. */ + interface IListTopicSubscriptionsRequest { + + /** ListTopicSubscriptionsRequest topic */ + topic?: (string|null); + + /** ListTopicSubscriptionsRequest pageSize */ + pageSize?: (number|null); + + /** ListTopicSubscriptionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTopicSubscriptionsRequest. */ + class ListTopicSubscriptionsRequest implements IListTopicSubscriptionsRequest { + + /** + * Constructs a new ListTopicSubscriptionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest); + + /** ListTopicSubscriptionsRequest topic. */ + public topic: string; + + /** ListTopicSubscriptionsRequest pageSize. */ + public pageSize: number; + + /** ListTopicSubscriptionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSubscriptionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest): google.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @param message ListTopicSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @param message ListTopicSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Verifies a ListTopicSubscriptionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSubscriptionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsRequest; + + /** + * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListTopicSubscriptionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSubscriptionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSubscriptionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSubscriptionsResponse. */ + interface IListTopicSubscriptionsResponse { + + /** ListTopicSubscriptionsResponse subscriptions */ + subscriptions?: (string[]|null); + + /** ListTopicSubscriptionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTopicSubscriptionsResponse. */ + class ListTopicSubscriptionsResponse implements IListTopicSubscriptionsResponse { + + /** + * Constructs a new ListTopicSubscriptionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse); + + /** ListTopicSubscriptionsResponse subscriptions. */ + public subscriptions: string[]; + + /** ListTopicSubscriptionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSubscriptionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse): google.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @param message ListTopicSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @param message ListTopicSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Verifies a ListTopicSubscriptionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSubscriptionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsResponse; + + /** + * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListTopicSubscriptionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSubscriptionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSubscriptionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSnapshotsRequest. */ + interface IListTopicSnapshotsRequest { + + /** ListTopicSnapshotsRequest topic */ + topic?: (string|null); + + /** ListTopicSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListTopicSnapshotsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTopicSnapshotsRequest. */ + class ListTopicSnapshotsRequest implements IListTopicSnapshotsRequest { + + /** + * Constructs a new ListTopicSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSnapshotsRequest); + + /** ListTopicSnapshotsRequest topic. */ + public topic: string; + + /** ListTopicSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListTopicSnapshotsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTopicSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSnapshotsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSnapshotsRequest): google.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @param message ListTopicSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @param message ListTopicSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Verifies a ListTopicSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsRequest; + + /** + * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListTopicSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTopicSnapshotsResponse. */ + interface IListTopicSnapshotsResponse { + + /** ListTopicSnapshotsResponse snapshots */ + snapshots?: (string[]|null); + + /** ListTopicSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTopicSnapshotsResponse. */ + class ListTopicSnapshotsResponse implements IListTopicSnapshotsResponse { + + /** + * Constructs a new ListTopicSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSnapshotsResponse); + + /** ListTopicSnapshotsResponse snapshots. */ + public snapshots: string[]; + + /** ListTopicSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTopicSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSnapshotsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSnapshotsResponse): google.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @param message ListTopicSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @param message ListTopicSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Verifies a ListTopicSnapshotsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsResponse; + + /** + * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListTopicSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTopicSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTopicSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTopicRequest. */ + interface IDeleteTopicRequest { + + /** DeleteTopicRequest topic */ + topic?: (string|null); + } + + /** Represents a DeleteTopicRequest. */ + class DeleteTopicRequest implements IDeleteTopicRequest { + + /** + * Constructs a new DeleteTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteTopicRequest); + + /** DeleteTopicRequest topic. */ + public topic: string; + + /** + * Creates a new DeleteTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteTopicRequest): google.pubsub.v1.DeleteTopicRequest; + + /** + * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @param message DeleteTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @param message DeleteTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteTopicRequest; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteTopicRequest; + + /** + * Verifies a DeleteTopicRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteTopicRequest; + + /** + * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. + * @param message DeleteTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTopicRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetachSubscriptionRequest. */ + interface IDetachSubscriptionRequest { + + /** DetachSubscriptionRequest subscription */ + subscription?: (string|null); + } + + /** Represents a DetachSubscriptionRequest. */ + class DetachSubscriptionRequest implements IDetachSubscriptionRequest { + + /** + * Constructs a new DetachSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDetachSubscriptionRequest); + + /** DetachSubscriptionRequest subscription. */ + public subscription: string; + + /** + * Creates a new DetachSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IDetachSubscriptionRequest): google.pubsub.v1.DetachSubscriptionRequest; + + /** + * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @param message DetachSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @param message DetachSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DetachSubscriptionRequest; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DetachSubscriptionRequest; + + /** + * Verifies a DetachSubscriptionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionRequest; + + /** + * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified. + * @param message DetachSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DetachSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetachSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetachSubscriptionResponse. */ + interface IDetachSubscriptionResponse { + } + + /** Represents a DetachSubscriptionResponse. */ + class DetachSubscriptionResponse implements IDetachSubscriptionResponse { + + /** + * Constructs a new DetachSubscriptionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDetachSubscriptionResponse); + + /** + * Creates a new DetachSubscriptionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachSubscriptionResponse instance + */ + public static create(properties?: google.pubsub.v1.IDetachSubscriptionResponse): google.pubsub.v1.DetachSubscriptionResponse; + + /** + * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @param message DetachSubscriptionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @param message DetachSubscriptionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachSubscriptionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DetachSubscriptionResponse; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachSubscriptionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DetachSubscriptionResponse; + + /** + * Verifies a DetachSubscriptionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachSubscriptionResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionResponse; + + /** + * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified. + * @param message DetachSubscriptionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DetachSubscriptionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachSubscriptionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetachSubscriptionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Subscriber */ + class Subscriber extends $protobuf.rpc.Service { + + /** + * Constructs a new Subscriber 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 Subscriber 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): Subscriber; + + /** + * Calls CreateSubscription. + * @param request Subscription message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public createSubscription(request: google.pubsub.v1.ISubscription, callback: google.pubsub.v1.Subscriber.CreateSubscriptionCallback): void; + + /** + * Calls CreateSubscription. + * @param request Subscription message or plain object + * @returns Promise + */ + public createSubscription(request: google.pubsub.v1.ISubscription): Promise; + + /** + * Calls GetSubscription. + * @param request GetSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest, callback: google.pubsub.v1.Subscriber.GetSubscriptionCallback): void; + + /** + * Calls GetSubscription. + * @param request GetSubscriptionRequest message or plain object + * @returns Promise + */ + public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest): Promise; + + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest, callback: google.pubsub.v1.Subscriber.UpdateSubscriptionCallback): void; + + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @returns Promise + */ + public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest): Promise; + + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + */ + public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest, callback: google.pubsub.v1.Subscriber.ListSubscriptionsCallback): void; + + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @returns Promise + */ + public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest): Promise; + + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest, callback: google.pubsub.v1.Subscriber.DeleteSubscriptionCallback): void; + + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @returns Promise + */ + public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest): Promise; + + /** + * Calls ModifyAckDeadline. + * @param request ModifyAckDeadlineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest, callback: google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback): void; + + /** + * Calls ModifyAckDeadline. + * @param request ModifyAckDeadlineRequest message or plain object + * @returns Promise + */ + public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest): Promise; + + /** + * Calls Acknowledge. + * @param request AcknowledgeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest, callback: google.pubsub.v1.Subscriber.AcknowledgeCallback): void; + + /** + * Calls Acknowledge. + * @param request AcknowledgeRequest message or plain object + * @returns Promise + */ + public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest): Promise; + + /** + * Calls Pull. + * @param request PullRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PullResponse + */ + public pull(request: google.pubsub.v1.IPullRequest, callback: google.pubsub.v1.Subscriber.PullCallback): void; + + /** + * Calls Pull. + * @param request PullRequest message or plain object + * @returns Promise + */ + public pull(request: google.pubsub.v1.IPullRequest): Promise; + + /** + * Calls StreamingPull. + * @param request StreamingPullRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingPullResponse + */ + public streamingPull(request: google.pubsub.v1.IStreamingPullRequest, callback: google.pubsub.v1.Subscriber.StreamingPullCallback): void; + + /** + * Calls StreamingPull. + * @param request StreamingPullRequest message or plain object + * @returns Promise + */ + public streamingPull(request: google.pubsub.v1.IStreamingPullRequest): Promise; + + /** + * Calls ModifyPushConfig. + * @param request ModifyPushConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest, callback: google.pubsub.v1.Subscriber.ModifyPushConfigCallback): void; + + /** + * Calls ModifyPushConfig. + * @param request ModifyPushConfigRequest message or plain object + * @returns Promise + */ + public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest): Promise; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest, callback: google.pubsub.v1.Subscriber.GetSnapshotCallback): void; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest): Promise; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest, callback: google.pubsub.v1.Subscriber.ListSnapshotsCallback): void; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest): Promise; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest, callback: google.pubsub.v1.Subscriber.CreateSnapshotCallback): void; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @returns Promise + */ + public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest): Promise; + + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest, callback: google.pubsub.v1.Subscriber.UpdateSnapshotCallback): void; + + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @returns Promise + */ + public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest): Promise; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest, callback: google.pubsub.v1.Subscriber.DeleteSnapshotCallback): void; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest): Promise; + + /** + * Calls Seek. + * @param request SeekRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SeekResponse + */ + public seek(request: google.pubsub.v1.ISeekRequest, callback: google.pubsub.v1.Subscriber.SeekCallback): void; + + /** + * Calls Seek. + * @param request SeekRequest message or plain object + * @returns Promise + */ + public seek(request: google.pubsub.v1.ISeekRequest): Promise; + } + + namespace Subscriber { + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type CreateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type GetSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type UpdateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}. + * @param error Error, if any + * @param [response] ListSubscriptionsResponse + */ + type ListSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSubscriptionsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}. + * @param error Error, if any + * @param [response] Empty + */ + type ModifyAckDeadlineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}. + * @param error Error, if any + * @param [response] Empty + */ + type AcknowledgeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|pull}. + * @param error Error, if any + * @param [response] PullResponse + */ + type PullCallback = (error: (Error|null), response?: google.pubsub.v1.PullResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}. + * @param error Error, if any + * @param [response] StreamingPullResponse + */ + type StreamingPullCallback = (error: (Error|null), response?: google.pubsub.v1.StreamingPullResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type ModifyPushConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type CreateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type UpdateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|seek}. + * @param error Error, if any + * @param [response] SeekResponse + */ + type SeekCallback = (error: (Error|null), response?: google.pubsub.v1.SeekResponse) => void; + } + + /** Properties of a Subscription. */ + interface ISubscription { + + /** Subscription name */ + name?: (string|null); + + /** Subscription topic */ + topic?: (string|null); + + /** Subscription pushConfig */ + pushConfig?: (google.pubsub.v1.IPushConfig|null); + + /** Subscription bigqueryConfig */ + bigqueryConfig?: (google.pubsub.v1.IBigQueryConfig|null); + + /** Subscription cloudStorageConfig */ + cloudStorageConfig?: (google.pubsub.v1.ICloudStorageConfig|null); + + /** Subscription ackDeadlineSeconds */ + ackDeadlineSeconds?: (number|null); + + /** Subscription retainAckedMessages */ + retainAckedMessages?: (boolean|null); + + /** Subscription messageRetentionDuration */ + messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription labels */ + labels?: ({ [k: string]: string }|null); + + /** Subscription enableMessageOrdering */ + enableMessageOrdering?: (boolean|null); + + /** Subscription expirationPolicy */ + expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); + + /** Subscription filter */ + filter?: (string|null); + + /** Subscription deadLetterPolicy */ + deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); + + /** Subscription retryPolicy */ + retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); + + /** Subscription detached */ + detached?: (boolean|null); + + /** Subscription enableExactlyOnceDelivery */ + enableExactlyOnceDelivery?: (boolean|null); + + /** Subscription topicMessageRetentionDuration */ + topicMessageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription state */ + state?: (google.pubsub.v1.Subscription.State|keyof typeof google.pubsub.v1.Subscription.State|null); + + /** Subscription analyticsHubSubscriptionInfo */ + analyticsHubSubscriptionInfo?: (google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo|null); + + /** Subscription messageTransforms */ + messageTransforms?: (google.pubsub.v1.IMessageTransform[]|null); + + /** Subscription tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents a Subscription. */ + class Subscription implements ISubscription { + + /** + * Constructs a new Subscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISubscription); + + /** Subscription name. */ + public name: string; + + /** Subscription topic. */ + public topic: string; + + /** Subscription pushConfig. */ + public pushConfig?: (google.pubsub.v1.IPushConfig|null); + + /** Subscription bigqueryConfig. */ + public bigqueryConfig?: (google.pubsub.v1.IBigQueryConfig|null); + + /** Subscription cloudStorageConfig. */ + public cloudStorageConfig?: (google.pubsub.v1.ICloudStorageConfig|null); + + /** Subscription ackDeadlineSeconds. */ + public ackDeadlineSeconds: number; + + /** Subscription retainAckedMessages. */ + public retainAckedMessages: boolean; + + /** Subscription messageRetentionDuration. */ + public messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription labels. */ + public labels: { [k: string]: string }; + + /** Subscription enableMessageOrdering. */ + public enableMessageOrdering: boolean; + + /** Subscription expirationPolicy. */ + public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); + + /** Subscription filter. */ + public filter: string; + + /** Subscription deadLetterPolicy. */ + public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); + + /** Subscription retryPolicy. */ + public retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); + + /** Subscription detached. */ + public detached: boolean; + + /** Subscription enableExactlyOnceDelivery. */ + public enableExactlyOnceDelivery: boolean; + + /** Subscription topicMessageRetentionDuration. */ + public topicMessageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Subscription state. */ + public state: (google.pubsub.v1.Subscription.State|keyof typeof google.pubsub.v1.Subscription.State); + + /** Subscription analyticsHubSubscriptionInfo. */ + public analyticsHubSubscriptionInfo?: (google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo|null); + + /** Subscription messageTransforms. */ + public messageTransforms: google.pubsub.v1.IMessageTransform[]; + + /** Subscription tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Subscription instance using the specified properties. + * @param [properties] Properties to set + * @returns Subscription instance + */ + public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription; + + /** + * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Subscription; + + /** + * Decodes a Subscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Subscription; + + /** + * Verifies a Subscription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subscription + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription; + + /** + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @param message Subscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Subscription { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + RESOURCE_ERROR = 2 + } + + /** Properties of an AnalyticsHubSubscriptionInfo. */ + interface IAnalyticsHubSubscriptionInfo { + + /** AnalyticsHubSubscriptionInfo listing */ + listing?: (string|null); + + /** AnalyticsHubSubscriptionInfo subscription */ + subscription?: (string|null); + } + + /** Represents an AnalyticsHubSubscriptionInfo. */ + class AnalyticsHubSubscriptionInfo implements IAnalyticsHubSubscriptionInfo { + + /** + * Constructs a new AnalyticsHubSubscriptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo); + + /** AnalyticsHubSubscriptionInfo listing. */ + public listing: string; + + /** AnalyticsHubSubscriptionInfo subscription. */ + public subscription: string; + + /** + * Creates a new AnalyticsHubSubscriptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyticsHubSubscriptionInfo instance + */ + public static create(properties?: google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo): google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo; + + /** + * Encodes the specified AnalyticsHubSubscriptionInfo message. Does not implicitly {@link google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.verify|verify} messages. + * @param message AnalyticsHubSubscriptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyticsHubSubscriptionInfo message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.verify|verify} messages. + * @param message AnalyticsHubSubscriptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyticsHubSubscriptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyticsHubSubscriptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo; + + /** + * Decodes an AnalyticsHubSubscriptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyticsHubSubscriptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo; + + /** + * Verifies an AnalyticsHubSubscriptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalyticsHubSubscriptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyticsHubSubscriptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo; + + /** + * Creates a plain object from an AnalyticsHubSubscriptionInfo message. Also converts values to other types if specified. + * @param message AnalyticsHubSubscriptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyticsHubSubscriptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyticsHubSubscriptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RetryPolicy. */ + interface IRetryPolicy { + + /** RetryPolicy minimumBackoff */ + minimumBackoff?: (google.protobuf.IDuration|null); + + /** RetryPolicy maximumBackoff */ + maximumBackoff?: (google.protobuf.IDuration|null); + } + + /** Represents a RetryPolicy. */ + class RetryPolicy implements IRetryPolicy { + + /** + * Constructs a new RetryPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IRetryPolicy); + + /** RetryPolicy minimumBackoff. */ + public minimumBackoff?: (google.protobuf.IDuration|null); + + /** RetryPolicy maximumBackoff. */ + public maximumBackoff?: (google.protobuf.IDuration|null); + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryPolicy instance + */ + public static create(properties?: google.pubsub.v1.IRetryPolicy): google.pubsub.v1.RetryPolicy; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.RetryPolicy; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.RetryPolicy; + + /** + * Verifies a RetryPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RetryPolicy; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @param message RetryPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.RetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeadLetterPolicy. */ + interface IDeadLetterPolicy { + + /** DeadLetterPolicy deadLetterTopic */ + deadLetterTopic?: (string|null); + + /** DeadLetterPolicy maxDeliveryAttempts */ + maxDeliveryAttempts?: (number|null); + } + + /** Represents a DeadLetterPolicy. */ + class DeadLetterPolicy implements IDeadLetterPolicy { + + /** + * Constructs a new DeadLetterPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeadLetterPolicy); + + /** DeadLetterPolicy deadLetterTopic. */ + public deadLetterTopic: string; + + /** DeadLetterPolicy maxDeliveryAttempts. */ + public maxDeliveryAttempts: number; + + /** + * Creates a new DeadLetterPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DeadLetterPolicy instance + */ + public static create(properties?: google.pubsub.v1.IDeadLetterPolicy): google.pubsub.v1.DeadLetterPolicy; + + /** + * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @param message DeadLetterPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @param message DeadLetterPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeadLetterPolicy; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeadLetterPolicy; + + /** + * Verifies a DeadLetterPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeadLetterPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeadLetterPolicy; + + /** + * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. + * @param message DeadLetterPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeadLetterPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeadLetterPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeadLetterPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExpirationPolicy. */ + interface IExpirationPolicy { + + /** ExpirationPolicy ttl */ + ttl?: (google.protobuf.IDuration|null); + } + + /** Represents an ExpirationPolicy. */ + class ExpirationPolicy implements IExpirationPolicy { + + /** + * Constructs a new ExpirationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IExpirationPolicy); + + /** ExpirationPolicy ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** + * Creates a new ExpirationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpirationPolicy instance + */ + public static create(properties?: google.pubsub.v1.IExpirationPolicy): google.pubsub.v1.ExpirationPolicy; + + /** + * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @param message ExpirationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @param message ExpirationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ExpirationPolicy; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ExpirationPolicy; + + /** + * Verifies an ExpirationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpirationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ExpirationPolicy; + + /** + * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. + * @param message ExpirationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ExpirationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpirationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpirationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PushConfig. */ + interface IPushConfig { + + /** PushConfig pushEndpoint */ + pushEndpoint?: (string|null); + + /** PushConfig attributes */ + attributes?: ({ [k: string]: string }|null); + + /** PushConfig oidcToken */ + oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + + /** PushConfig pubsubWrapper */ + pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); + + /** PushConfig noWrapper */ + noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); + } + + /** Represents a PushConfig. */ + class PushConfig implements IPushConfig { + + /** + * Constructs a new PushConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPushConfig); + + /** PushConfig pushEndpoint. */ + public pushEndpoint: string; + + /** PushConfig attributes. */ + public attributes: { [k: string]: string }; + + /** PushConfig oidcToken. */ + public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + + /** PushConfig pubsubWrapper. */ + public pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null); + + /** PushConfig noWrapper. */ + public noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null); + + /** PushConfig authenticationMethod. */ + public authenticationMethod?: "oidcToken"; + + /** PushConfig wrapper. */ + public wrapper?: ("pubsubWrapper"|"noWrapper"); + + /** + * Creates a new PushConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PushConfig instance + */ + public static create(properties?: google.pubsub.v1.IPushConfig): google.pubsub.v1.PushConfig; + + /** + * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @param message PushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @param message PushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PushConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig; + + /** + * Decodes a PushConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig; + + /** + * Verifies a PushConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PushConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig; + + /** + * Creates a plain object from a PushConfig message. Also converts values to other types if specified. + * @param message PushConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PushConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PushConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PushConfig { + + /** Properties of an OidcToken. */ + interface IOidcToken { + + /** OidcToken serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** OidcToken audience */ + audience?: (string|null); + } + + /** Represents an OidcToken. */ + class OidcToken implements IOidcToken { + + /** + * Constructs a new OidcToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.IOidcToken); + + /** OidcToken serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** OidcToken audience. */ + public audience: string; + + /** + * Creates a new OidcToken instance using the specified properties. + * @param [properties] Properties to set + * @returns OidcToken instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.IOidcToken): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @param message OidcToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @param message OidcToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OidcToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Decodes an OidcToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Verifies an OidcToken message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OidcToken + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Creates a plain object from an OidcToken message. Also converts values to other types if specified. + * @param message OidcToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OidcToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OidcToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PubsubWrapper. */ + interface IPubsubWrapper { + } + + /** Represents a PubsubWrapper. */ + class PubsubWrapper implements IPubsubWrapper { + + /** + * Constructs a new PubsubWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper); + + /** + * Creates a new PubsubWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubWrapper instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @param message PubsubWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @param message PubsubWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Verifies a PubsubWrapper message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubWrapper + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.PubsubWrapper; + + /** + * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. + * @param message PubsubWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.PubsubWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NoWrapper. */ + interface INoWrapper { + + /** NoWrapper writeMetadata */ + writeMetadata?: (boolean|null); + } + + /** Represents a NoWrapper. */ + class NoWrapper implements INoWrapper { + + /** + * Constructs a new NoWrapper. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.INoWrapper); + + /** NoWrapper writeMetadata. */ + public writeMetadata: boolean; + + /** + * Creates a new NoWrapper instance using the specified properties. + * @param [properties] Properties to set + * @returns NoWrapper instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.INoWrapper): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @param message NoWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @param message NoWrapper message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NoWrapper message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Decodes a NoWrapper message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Verifies a NoWrapper message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NoWrapper + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.NoWrapper; + + /** + * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. + * @param message NoWrapper + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.NoWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NoWrapper to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NoWrapper + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BigQueryConfig. */ + interface IBigQueryConfig { + + /** BigQueryConfig table */ + table?: (string|null); + + /** BigQueryConfig useTopicSchema */ + useTopicSchema?: (boolean|null); + + /** BigQueryConfig writeMetadata */ + writeMetadata?: (boolean|null); + + /** BigQueryConfig dropUnknownFields */ + dropUnknownFields?: (boolean|null); + + /** BigQueryConfig state */ + state?: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State|null); + + /** BigQueryConfig useTableSchema */ + useTableSchema?: (boolean|null); + + /** BigQueryConfig serviceAccountEmail */ + serviceAccountEmail?: (string|null); + } + + /** Represents a BigQueryConfig. */ + class BigQueryConfig implements IBigQueryConfig { + + /** + * Constructs a new BigQueryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IBigQueryConfig); + + /** BigQueryConfig table. */ + public table: string; + + /** BigQueryConfig useTopicSchema. */ + public useTopicSchema: boolean; + + /** BigQueryConfig writeMetadata. */ + public writeMetadata: boolean; + + /** BigQueryConfig dropUnknownFields. */ + public dropUnknownFields: boolean; + + /** BigQueryConfig state. */ + public state: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State); + + /** BigQueryConfig useTableSchema. */ + public useTableSchema: boolean; + + /** BigQueryConfig serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** + * Creates a new BigQueryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryConfig instance + */ + public static create(properties?: google.pubsub.v1.IBigQueryConfig): google.pubsub.v1.BigQueryConfig; + + /** + * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @param message BigQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @param message BigQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.BigQueryConfig; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.BigQueryConfig; + + /** + * Verifies a BigQueryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.BigQueryConfig; + + /** + * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. + * @param message BigQueryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.BigQueryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BigQueryConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PERMISSION_DENIED = 2, + NOT_FOUND = 3, + SCHEMA_MISMATCH = 4, + IN_TRANSIT_LOCATION_RESTRICTION = 5 + } + } + + /** Properties of a CloudStorageConfig. */ + interface ICloudStorageConfig { + + /** CloudStorageConfig bucket */ + bucket?: (string|null); + + /** CloudStorageConfig filenamePrefix */ + filenamePrefix?: (string|null); + + /** CloudStorageConfig filenameSuffix */ + filenameSuffix?: (string|null); + + /** CloudStorageConfig filenameDatetimeFormat */ + filenameDatetimeFormat?: (string|null); + + /** CloudStorageConfig textConfig */ + textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null); + + /** CloudStorageConfig avroConfig */ + avroConfig?: (google.pubsub.v1.CloudStorageConfig.IAvroConfig|null); + + /** CloudStorageConfig maxDuration */ + maxDuration?: (google.protobuf.IDuration|null); + + /** CloudStorageConfig maxBytes */ + maxBytes?: (number|Long|string|null); + + /** CloudStorageConfig maxMessages */ + maxMessages?: (number|Long|string|null); + + /** CloudStorageConfig state */ + state?: (google.pubsub.v1.CloudStorageConfig.State|keyof typeof google.pubsub.v1.CloudStorageConfig.State|null); + + /** CloudStorageConfig serviceAccountEmail */ + serviceAccountEmail?: (string|null); + } + + /** Represents a CloudStorageConfig. */ + class CloudStorageConfig implements ICloudStorageConfig { + + /** + * Constructs a new CloudStorageConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICloudStorageConfig); + + /** CloudStorageConfig bucket. */ + public bucket: string; + + /** CloudStorageConfig filenamePrefix. */ + public filenamePrefix: string; + + /** CloudStorageConfig filenameSuffix. */ + public filenameSuffix: string; + + /** CloudStorageConfig filenameDatetimeFormat. */ + public filenameDatetimeFormat: string; + + /** CloudStorageConfig textConfig. */ + public textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null); + + /** CloudStorageConfig avroConfig. */ + public avroConfig?: (google.pubsub.v1.CloudStorageConfig.IAvroConfig|null); + + /** CloudStorageConfig maxDuration. */ + public maxDuration?: (google.protobuf.IDuration|null); + + /** CloudStorageConfig maxBytes. */ + public maxBytes: (number|Long|string); + + /** CloudStorageConfig maxMessages. */ + public maxMessages: (number|Long|string); + + /** CloudStorageConfig state. */ + public state: (google.pubsub.v1.CloudStorageConfig.State|keyof typeof google.pubsub.v1.CloudStorageConfig.State); + + /** CloudStorageConfig serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** CloudStorageConfig outputFormat. */ + public outputFormat?: ("textConfig"|"avroConfig"); + + /** + * Creates a new CloudStorageConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageConfig instance + */ + public static create(properties?: google.pubsub.v1.ICloudStorageConfig): google.pubsub.v1.CloudStorageConfig; + + /** + * Encodes the specified CloudStorageConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @param message CloudStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICloudStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @param message CloudStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICloudStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CloudStorageConfig; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CloudStorageConfig; + + /** + * Verifies a CloudStorageConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorageConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig; + + /** + * Creates a plain object from a CloudStorageConfig message. Also converts values to other types if specified. + * @param message CloudStorageConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CloudStorageConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudStorageConfig { + + /** Properties of a TextConfig. */ + interface ITextConfig { + } + + /** Represents a TextConfig. */ + class TextConfig implements ITextConfig { + + /** + * Constructs a new TextConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.CloudStorageConfig.ITextConfig); + + /** + * Creates a new TextConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextConfig instance + */ + public static create(properties?: google.pubsub.v1.CloudStorageConfig.ITextConfig): google.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Encodes the specified TextConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @param message TextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.CloudStorageConfig.ITextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @param message TextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.CloudStorageConfig.ITextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Decodes a TextConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Verifies a TextConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig.TextConfig; + + /** + * Creates a plain object from a TextConfig message. Also converts values to other types if specified. + * @param message TextConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CloudStorageConfig.TextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AvroConfig. */ + interface IAvroConfig { + + /** AvroConfig writeMetadata */ + writeMetadata?: (boolean|null); + + /** AvroConfig useTopicSchema */ + useTopicSchema?: (boolean|null); + } + + /** Represents an AvroConfig. */ + class AvroConfig implements IAvroConfig { + + /** + * Constructs a new AvroConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.CloudStorageConfig.IAvroConfig); + + /** AvroConfig writeMetadata. */ + public writeMetadata: boolean; + + /** AvroConfig useTopicSchema. */ + public useTopicSchema: boolean; + + /** + * Creates a new AvroConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroConfig instance + */ + public static create(properties?: google.pubsub.v1.CloudStorageConfig.IAvroConfig): google.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Encodes the specified AvroConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @param message AvroConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.CloudStorageConfig.IAvroConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @param message AvroConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.CloudStorageConfig.IAvroConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Decodes an AvroConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Verifies an AvroConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvroConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CloudStorageConfig.AvroConfig; + + /** + * Creates a plain object from an AvroConfig message. Also converts values to other types if specified. + * @param message AvroConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CloudStorageConfig.AvroConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PERMISSION_DENIED = 2, + NOT_FOUND = 3, + IN_TRANSIT_LOCATION_RESTRICTION = 4, + SCHEMA_MISMATCH = 5 + } + } + + /** Properties of a ReceivedMessage. */ + interface IReceivedMessage { + + /** ReceivedMessage ackId */ + ackId?: (string|null); + + /** ReceivedMessage message */ + message?: (google.pubsub.v1.IPubsubMessage|null); + + /** ReceivedMessage deliveryAttempt */ + deliveryAttempt?: (number|null); + } + + /** Represents a ReceivedMessage. */ + class ReceivedMessage implements IReceivedMessage { + + /** + * Constructs a new ReceivedMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IReceivedMessage); + + /** ReceivedMessage ackId. */ + public ackId: string; + + /** ReceivedMessage message. */ + public message?: (google.pubsub.v1.IPubsubMessage|null); + + /** ReceivedMessage deliveryAttempt. */ + public deliveryAttempt: number; + + /** + * Creates a new ReceivedMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceivedMessage instance + */ + public static create(properties?: google.pubsub.v1.IReceivedMessage): google.pubsub.v1.ReceivedMessage; + + /** + * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @param message ReceivedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @param message ReceivedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ReceivedMessage; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ReceivedMessage; + + /** + * Verifies a ReceivedMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceivedMessage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ReceivedMessage; + + /** + * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. + * @param message ReceivedMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ReceivedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceivedMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceivedMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSubscriptionRequest. */ + interface IGetSubscriptionRequest { + + /** GetSubscriptionRequest subscription */ + subscription?: (string|null); + } + + /** Represents a GetSubscriptionRequest. */ + class GetSubscriptionRequest implements IGetSubscriptionRequest { + + /** + * Constructs a new GetSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSubscriptionRequest); + + /** GetSubscriptionRequest subscription. */ + public subscription: string; + + /** + * Creates a new GetSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSubscriptionRequest): google.pubsub.v1.GetSubscriptionRequest; + + /** + * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @param message GetSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @param message GetSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSubscriptionRequest; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSubscriptionRequest; + + /** + * Verifies a GetSubscriptionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSubscriptionRequest; + + /** + * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. + * @param message GetSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSubscriptionRequest. */ + interface IUpdateSubscriptionRequest { + + /** UpdateSubscriptionRequest subscription */ + subscription?: (google.pubsub.v1.ISubscription|null); + + /** UpdateSubscriptionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSubscriptionRequest. */ + class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { + + /** + * Constructs a new UpdateSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateSubscriptionRequest); + + /** UpdateSubscriptionRequest subscription. */ + public subscription?: (google.pubsub.v1.ISubscription|null); + + /** UpdateSubscriptionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateSubscriptionRequest): google.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Verifies an UpdateSubscriptionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSubscriptionRequest; + + /** + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @param message UpdateSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubscriptionsRequest. */ + interface IListSubscriptionsRequest { + + /** ListSubscriptionsRequest project */ + project?: (string|null); + + /** ListSubscriptionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSubscriptionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSubscriptionsRequest. */ + class ListSubscriptionsRequest implements IListSubscriptionsRequest { + + /** + * Constructs a new ListSubscriptionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSubscriptionsRequest); + + /** ListSubscriptionsRequest project. */ + public project: string; + + /** ListSubscriptionsRequest pageSize. */ + public pageSize: number; + + /** ListSubscriptionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscriptionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSubscriptionsRequest): google.pubsub.v1.ListSubscriptionsRequest; + + /** + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsRequest; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsRequest; + + /** + * Verifies a ListSubscriptionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscriptionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsRequest; + + /** + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListSubscriptionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscriptionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubscriptionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubscriptionsResponse. */ + interface IListSubscriptionsResponse { + + /** ListSubscriptionsResponse subscriptions */ + subscriptions?: (google.pubsub.v1.ISubscription[]|null); + + /** ListSubscriptionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSubscriptionsResponse. */ + class ListSubscriptionsResponse implements IListSubscriptionsResponse { + + /** + * Constructs a new ListSubscriptionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSubscriptionsResponse); + + /** ListSubscriptionsResponse subscriptions. */ + public subscriptions: google.pubsub.v1.ISubscription[]; + + /** ListSubscriptionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSubscriptionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscriptionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSubscriptionsResponse): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Verifies a ListSubscriptionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscriptionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListSubscriptionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscriptionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubscriptionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSubscriptionRequest. */ + interface IDeleteSubscriptionRequest { + + /** DeleteSubscriptionRequest subscription */ + subscription?: (string|null); + } + + /** Represents a DeleteSubscriptionRequest. */ + class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { + + /** + * Constructs a new DeleteSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSubscriptionRequest); + + /** DeleteSubscriptionRequest subscription. */ + public subscription: string; + + /** + * Creates a new DeleteSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSubscriptionRequest): google.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Verifies a DeleteSubscriptionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSubscriptionRequest; + + /** + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @param message DeleteSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSubscriptionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyPushConfigRequest. */ + interface IModifyPushConfigRequest { + + /** ModifyPushConfigRequest subscription */ + subscription?: (string|null); + + /** ModifyPushConfigRequest pushConfig */ + pushConfig?: (google.pubsub.v1.IPushConfig|null); + } + + /** Represents a ModifyPushConfigRequest. */ + class ModifyPushConfigRequest implements IModifyPushConfigRequest { + + /** + * Constructs a new ModifyPushConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IModifyPushConfigRequest); + + /** ModifyPushConfigRequest subscription. */ + public subscription: string; + + /** ModifyPushConfigRequest pushConfig. */ + public pushConfig?: (google.pubsub.v1.IPushConfig|null); + + /** + * Creates a new ModifyPushConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyPushConfigRequest instance + */ + public static create(properties?: google.pubsub.v1.IModifyPushConfigRequest): google.pubsub.v1.ModifyPushConfigRequest; + + /** + * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @param message ModifyPushConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @param message ModifyPushConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyPushConfigRequest; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyPushConfigRequest; + + /** + * Verifies a ModifyPushConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyPushConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyPushConfigRequest; + + /** + * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. + * @param message ModifyPushConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ModifyPushConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyPushConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyPushConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PullRequest. */ + interface IPullRequest { + + /** PullRequest subscription */ + subscription?: (string|null); + + /** PullRequest returnImmediately */ + returnImmediately?: (boolean|null); + + /** PullRequest maxMessages */ + maxMessages?: (number|null); + } + + /** Represents a PullRequest. */ + class PullRequest implements IPullRequest { + + /** + * Constructs a new PullRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPullRequest); + + /** PullRequest subscription. */ + public subscription: string; + + /** PullRequest returnImmediately. */ + public returnImmediately: boolean; + + /** PullRequest maxMessages. */ + public maxMessages: number; + + /** + * Creates a new PullRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PullRequest instance + */ + public static create(properties?: google.pubsub.v1.IPullRequest): google.pubsub.v1.PullRequest; + + /** + * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @param message PullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @param message PullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PullRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullRequest; + + /** + * Decodes a PullRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullRequest; + + /** + * Verifies a PullRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PullRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullRequest; + + /** + * Creates a plain object from a PullRequest message. Also converts values to other types if specified. + * @param message PullRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PullRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PullRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PullResponse. */ + interface IPullResponse { + + /** PullResponse receivedMessages */ + receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); + } + + /** Represents a PullResponse. */ + class PullResponse implements IPullResponse { + + /** + * Constructs a new PullResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPullResponse); + + /** PullResponse receivedMessages. */ + public receivedMessages: google.pubsub.v1.IReceivedMessage[]; + + /** + * Creates a new PullResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PullResponse instance + */ + public static create(properties?: google.pubsub.v1.IPullResponse): google.pubsub.v1.PullResponse; + + /** + * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @param message PullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @param message PullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PullResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullResponse; + + /** + * Decodes a PullResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullResponse; + + /** + * Verifies a PullResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PullResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullResponse; + + /** + * Creates a plain object from a PullResponse message. Also converts values to other types if specified. + * @param message PullResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PullResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PullResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyAckDeadlineRequest. */ + interface IModifyAckDeadlineRequest { + + /** ModifyAckDeadlineRequest subscription */ + subscription?: (string|null); + + /** ModifyAckDeadlineRequest ackIds */ + ackIds?: (string[]|null); + + /** ModifyAckDeadlineRequest ackDeadlineSeconds */ + ackDeadlineSeconds?: (number|null); + } + + /** Represents a ModifyAckDeadlineRequest. */ + class ModifyAckDeadlineRequest implements IModifyAckDeadlineRequest { + + /** + * Constructs a new ModifyAckDeadlineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IModifyAckDeadlineRequest); + + /** ModifyAckDeadlineRequest subscription. */ + public subscription: string; + + /** ModifyAckDeadlineRequest ackIds. */ + public ackIds: string[]; + + /** ModifyAckDeadlineRequest ackDeadlineSeconds. */ + public ackDeadlineSeconds: number; + + /** + * Creates a new ModifyAckDeadlineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyAckDeadlineRequest instance + */ + public static create(properties?: google.pubsub.v1.IModifyAckDeadlineRequest): google.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @param message ModifyAckDeadlineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @param message ModifyAckDeadlineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Verifies a ModifyAckDeadlineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyAckDeadlineRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyAckDeadlineRequest; + + /** + * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. + * @param message ModifyAckDeadlineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ModifyAckDeadlineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyAckDeadlineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyAckDeadlineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcknowledgeRequest. */ + interface IAcknowledgeRequest { + + /** AcknowledgeRequest subscription */ + subscription?: (string|null); + + /** AcknowledgeRequest ackIds */ + ackIds?: (string[]|null); + } + + /** Represents an AcknowledgeRequest. */ + class AcknowledgeRequest implements IAcknowledgeRequest { + + /** + * Constructs a new AcknowledgeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IAcknowledgeRequest); + + /** AcknowledgeRequest subscription. */ + public subscription: string; + + /** AcknowledgeRequest ackIds. */ + public ackIds: string[]; + + /** + * Creates a new AcknowledgeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeRequest instance + */ + public static create(properties?: google.pubsub.v1.IAcknowledgeRequest): google.pubsub.v1.AcknowledgeRequest; + + /** + * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @param message AcknowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @param message AcknowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.AcknowledgeRequest; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.AcknowledgeRequest; + + /** + * Verifies an AcknowledgeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.AcknowledgeRequest; + + /** + * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. + * @param message AcknowledgeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.AcknowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcknowledgeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcknowledgeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingPullRequest. */ + interface IStreamingPullRequest { + + /** StreamingPullRequest subscription */ + subscription?: (string|null); + + /** StreamingPullRequest ackIds */ + ackIds?: (string[]|null); + + /** StreamingPullRequest modifyDeadlineSeconds */ + modifyDeadlineSeconds?: (number[]|null); + + /** StreamingPullRequest modifyDeadlineAckIds */ + modifyDeadlineAckIds?: (string[]|null); + + /** StreamingPullRequest streamAckDeadlineSeconds */ + streamAckDeadlineSeconds?: (number|null); + + /** StreamingPullRequest clientId */ + clientId?: (string|null); + + /** StreamingPullRequest maxOutstandingMessages */ + maxOutstandingMessages?: (number|Long|string|null); + + /** StreamingPullRequest maxOutstandingBytes */ + maxOutstandingBytes?: (number|Long|string|null); + + /** StreamingPullRequest protocolVersion */ + protocolVersion?: (number|Long|string|null); + } + + /** Represents a StreamingPullRequest. */ + class StreamingPullRequest implements IStreamingPullRequest { + + /** + * Constructs a new StreamingPullRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IStreamingPullRequest); + + /** StreamingPullRequest subscription. */ + public subscription: string; + + /** StreamingPullRequest ackIds. */ + public ackIds: string[]; + + /** StreamingPullRequest modifyDeadlineSeconds. */ + public modifyDeadlineSeconds: number[]; + + /** StreamingPullRequest modifyDeadlineAckIds. */ + public modifyDeadlineAckIds: string[]; + + /** StreamingPullRequest streamAckDeadlineSeconds. */ + public streamAckDeadlineSeconds: number; + + /** StreamingPullRequest clientId. */ + public clientId: string; + + /** StreamingPullRequest maxOutstandingMessages. */ + public maxOutstandingMessages: (number|Long|string); + + /** StreamingPullRequest maxOutstandingBytes. */ + public maxOutstandingBytes: (number|Long|string); + + /** StreamingPullRequest protocolVersion. */ + public protocolVersion: (number|Long|string); + + /** + * Creates a new StreamingPullRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingPullRequest instance + */ + public static create(properties?: google.pubsub.v1.IStreamingPullRequest): google.pubsub.v1.StreamingPullRequest; + + /** + * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @param message StreamingPullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @param message StreamingPullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullRequest; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullRequest; + + /** + * Verifies a StreamingPullRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingPullRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullRequest; + + /** + * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. + * @param message StreamingPullRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingPullRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingPullRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingPullResponse. */ + interface IStreamingPullResponse { + + /** StreamingPullResponse receivedMessages */ + receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); + + /** StreamingPullResponse acknowledgeConfirmation */ + acknowledgeConfirmation?: (google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null); + + /** StreamingPullResponse modifyAckDeadlineConfirmation */ + modifyAckDeadlineConfirmation?: (google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null); + + /** StreamingPullResponse subscriptionProperties */ + subscriptionProperties?: (google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null); + } + + /** Represents a StreamingPullResponse. */ + class StreamingPullResponse implements IStreamingPullResponse { + + /** + * Constructs a new StreamingPullResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IStreamingPullResponse); + + /** StreamingPullResponse receivedMessages. */ + public receivedMessages: google.pubsub.v1.IReceivedMessage[]; + + /** StreamingPullResponse acknowledgeConfirmation. */ + public acknowledgeConfirmation?: (google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null); + + /** StreamingPullResponse modifyAckDeadlineConfirmation. */ + public modifyAckDeadlineConfirmation?: (google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null); + + /** StreamingPullResponse subscriptionProperties. */ + public subscriptionProperties?: (google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null); + + /** + * Creates a new StreamingPullResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingPullResponse instance + */ + public static create(properties?: google.pubsub.v1.IStreamingPullResponse): google.pubsub.v1.StreamingPullResponse; + + /** + * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @param message StreamingPullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @param message StreamingPullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingPullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingPullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse; + + /** + * Verifies a StreamingPullResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingPullResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse; + + /** + * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. + * @param message StreamingPullResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingPullResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingPullResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamingPullResponse { + + /** Properties of an AcknowledgeConfirmation. */ + interface IAcknowledgeConfirmation { + + /** AcknowledgeConfirmation ackIds */ + ackIds?: (string[]|null); + + /** AcknowledgeConfirmation invalidAckIds */ + invalidAckIds?: (string[]|null); + + /** AcknowledgeConfirmation unorderedAckIds */ + unorderedAckIds?: (string[]|null); + + /** AcknowledgeConfirmation temporaryFailedAckIds */ + temporaryFailedAckIds?: (string[]|null); + } + + /** Represents an AcknowledgeConfirmation. */ + class AcknowledgeConfirmation implements IAcknowledgeConfirmation { + + /** + * Constructs a new AcknowledgeConfirmation. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation); + + /** AcknowledgeConfirmation ackIds. */ + public ackIds: string[]; + + /** AcknowledgeConfirmation invalidAckIds. */ + public invalidAckIds: string[]; + + /** AcknowledgeConfirmation unorderedAckIds. */ + public unorderedAckIds: string[]; + + /** AcknowledgeConfirmation temporaryFailedAckIds. */ + public temporaryFailedAckIds: string[]; + + /** + * Creates a new AcknowledgeConfirmation instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeConfirmation instance + */ + public static create(properties?: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @param message AcknowledgeConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @param message AcknowledgeConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Verifies an AcknowledgeConfirmation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeConfirmation + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation; + + /** + * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified. + * @param message AcknowledgeConfirmation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcknowledgeConfirmation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcknowledgeConfirmation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModifyAckDeadlineConfirmation. */ + interface IModifyAckDeadlineConfirmation { + + /** ModifyAckDeadlineConfirmation ackIds */ + ackIds?: (string[]|null); + + /** ModifyAckDeadlineConfirmation invalidAckIds */ + invalidAckIds?: (string[]|null); + + /** ModifyAckDeadlineConfirmation temporaryFailedAckIds */ + temporaryFailedAckIds?: (string[]|null); + } + + /** Represents a ModifyAckDeadlineConfirmation. */ + class ModifyAckDeadlineConfirmation implements IModifyAckDeadlineConfirmation { + + /** + * Constructs a new ModifyAckDeadlineConfirmation. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation); + + /** ModifyAckDeadlineConfirmation ackIds. */ + public ackIds: string[]; + + /** ModifyAckDeadlineConfirmation invalidAckIds. */ + public invalidAckIds: string[]; + + /** ModifyAckDeadlineConfirmation temporaryFailedAckIds. */ + public temporaryFailedAckIds: string[]; + + /** + * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyAckDeadlineConfirmation instance + */ + public static create(properties?: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @param message ModifyAckDeadlineConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @param message ModifyAckDeadlineConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyAckDeadlineConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyAckDeadlineConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Verifies a ModifyAckDeadlineConfirmation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyAckDeadlineConfirmation + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation; + + /** + * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified. + * @param message ModifyAckDeadlineConfirmation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModifyAckDeadlineConfirmation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModifyAckDeadlineConfirmation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscriptionProperties. */ + interface ISubscriptionProperties { + + /** SubscriptionProperties exactlyOnceDeliveryEnabled */ + exactlyOnceDeliveryEnabled?: (boolean|null); + + /** SubscriptionProperties messageOrderingEnabled */ + messageOrderingEnabled?: (boolean|null); + } + + /** Represents a SubscriptionProperties. */ + class SubscriptionProperties implements ISubscriptionProperties { + + /** + * Constructs a new SubscriptionProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties); + + /** SubscriptionProperties exactlyOnceDeliveryEnabled. */ + public exactlyOnceDeliveryEnabled: boolean; + + /** SubscriptionProperties messageOrderingEnabled. */ + public messageOrderingEnabled: boolean; + + /** + * Creates a new SubscriptionProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriptionProperties instance + */ + public static create(properties?: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @param message SubscriptionProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @param message SubscriptionProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriptionProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriptionProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Verifies a SubscriptionProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscriptionProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriptionProperties + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse.SubscriptionProperties; + + /** + * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified. + * @param message SubscriptionProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.StreamingPullResponse.SubscriptionProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriptionProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriptionProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateSnapshotRequest. */ + interface ICreateSnapshotRequest { + + /** CreateSnapshotRequest name */ + name?: (string|null); + + /** CreateSnapshotRequest subscription */ + subscription?: (string|null); + + /** CreateSnapshotRequest labels */ + labels?: ({ [k: string]: string }|null); + + /** CreateSnapshotRequest tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents a CreateSnapshotRequest. */ + class CreateSnapshotRequest implements ICreateSnapshotRequest { + + /** + * Constructs a new CreateSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICreateSnapshotRequest); + + /** CreateSnapshotRequest name. */ + public name: string; + + /** CreateSnapshotRequest subscription. */ + public subscription: string; + + /** CreateSnapshotRequest labels. */ + public labels: { [k: string]: string }; + + /** CreateSnapshotRequest tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new CreateSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.ICreateSnapshotRequest): google.pubsub.v1.CreateSnapshotRequest; + + /** + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CreateSnapshotRequest; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CreateSnapshotRequest; + + /** + * Verifies a CreateSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSnapshotRequest; + + /** + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @param message CreateSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSnapshotRequest. */ + interface IUpdateSnapshotRequest { + + /** UpdateSnapshotRequest snapshot */ + snapshot?: (google.pubsub.v1.ISnapshot|null); + + /** UpdateSnapshotRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSnapshotRequest. */ + class UpdateSnapshotRequest implements IUpdateSnapshotRequest { + + /** + * Constructs a new UpdateSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateSnapshotRequest); + + /** UpdateSnapshotRequest snapshot. */ + public snapshot?: (google.pubsub.v1.ISnapshot|null); + + /** UpdateSnapshotRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateSnapshotRequest): google.pubsub.v1.UpdateSnapshotRequest; + + /** + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSnapshotRequest; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSnapshotRequest; + + /** + * Verifies an UpdateSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSnapshotRequest; + + /** + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @param message UpdateSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot name */ + name?: (string|null); + + /** Snapshot topic */ + topic?: (string|null); + + /** Snapshot expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISnapshot); + + /** Snapshot name. */ + public name: string; + + /** Snapshot topic. */ + public topic: string; + + /** Snapshot expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.pubsub.v1.ISnapshot): google.pubsub.v1.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Snapshot; + + /** + * Verifies a Snapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Snapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSnapshotRequest); + + /** GetSnapshotRequest snapshot. */ + public snapshot: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSnapshotRequest): google.pubsub.v1.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest project */ + project?: (string|null); + + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSnapshotsRequest); + + /** ListSnapshotsRequest project. */ + public project: string; + + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSnapshotsRequest): google.pubsub.v1.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { + + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.pubsub.v1.ISnapshot[]|null); + + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { + + /** + * Constructs a new ListSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSnapshotsResponse); + + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.pubsub.v1.ISnapshot[]; + + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSnapshotsResponse): google.pubsub.v1.ListSnapshotsResponse; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsResponse; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsResponse; + + /** + * Verifies a ListSnapshotsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsResponse; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest snapshot. */ + public snapshot: string; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSnapshotRequest): google.pubsub.v1.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SeekRequest. */ + interface ISeekRequest { + + /** SeekRequest subscription */ + subscription?: (string|null); + + /** SeekRequest time */ + time?: (google.protobuf.ITimestamp|null); + + /** SeekRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a SeekRequest. */ + class SeekRequest implements ISeekRequest { + + /** + * Constructs a new SeekRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISeekRequest); + + /** SeekRequest subscription. */ + public subscription: string; + + /** SeekRequest time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** SeekRequest snapshot. */ + public snapshot?: (string|null); + + /** SeekRequest target. */ + public target?: ("time"|"snapshot"); + + /** + * Creates a new SeekRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SeekRequest instance + */ + public static create(properties?: google.pubsub.v1.ISeekRequest): google.pubsub.v1.SeekRequest; + + /** + * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @param message SeekRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @param message SeekRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeekRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeekRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SeekRequest; + + /** + * Decodes a SeekRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeekRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SeekRequest; + + /** + * Verifies a SeekRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeekRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekRequest; + + /** + * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. + * @param message SeekRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.SeekRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeekRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeekRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SeekResponse. */ + interface ISeekResponse { + } + + /** Represents a SeekResponse. */ + class SeekResponse implements ISeekResponse { + + /** + * Constructs a new SeekResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISeekResponse); + + /** + * Creates a new SeekResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SeekResponse instance + */ + public static create(properties?: google.pubsub.v1.ISeekResponse): google.pubsub.v1.SeekResponse; + + /** + * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @param message SeekResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @param message SeekResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeekResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SeekResponse; + + /** + * Decodes a SeekResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SeekResponse; + + /** + * Verifies a SeekResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeekResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekResponse; + + /** + * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. + * @param message SeekResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.SeekResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeekResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeekResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SchemaService */ + class SchemaService extends $protobuf.rpc.Service { + + /** + * Constructs a new SchemaService 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 SchemaService 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): SchemaService; + + /** + * Calls CreateSchema. + * @param request CreateSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public createSchema(request: google.pubsub.v1.ICreateSchemaRequest, callback: google.pubsub.v1.SchemaService.CreateSchemaCallback): void; + + /** + * Calls CreateSchema. + * @param request CreateSchemaRequest message or plain object + * @returns Promise + */ + public createSchema(request: google.pubsub.v1.ICreateSchemaRequest): Promise; + + /** + * Calls GetSchema. + * @param request GetSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public getSchema(request: google.pubsub.v1.IGetSchemaRequest, callback: google.pubsub.v1.SchemaService.GetSchemaCallback): void; + + /** + * Calls GetSchema. + * @param request GetSchemaRequest message or plain object + * @returns Promise + */ + public getSchema(request: google.pubsub.v1.IGetSchemaRequest): Promise; + + /** + * Calls ListSchemas. + * @param request ListSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemasResponse + */ + public listSchemas(request: google.pubsub.v1.IListSchemasRequest, callback: google.pubsub.v1.SchemaService.ListSchemasCallback): void; + + /** + * Calls ListSchemas. + * @param request ListSchemasRequest message or plain object + * @returns Promise + */ + public listSchemas(request: google.pubsub.v1.IListSchemasRequest): Promise; + + /** + * Calls ListSchemaRevisions. + * @param request ListSchemaRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemaRevisionsResponse + */ + public listSchemaRevisions(request: google.pubsub.v1.IListSchemaRevisionsRequest, callback: google.pubsub.v1.SchemaService.ListSchemaRevisionsCallback): void; + + /** + * Calls ListSchemaRevisions. + * @param request ListSchemaRevisionsRequest message or plain object + * @returns Promise + */ + public listSchemaRevisions(request: google.pubsub.v1.IListSchemaRevisionsRequest): Promise; + + /** + * Calls CommitSchema. + * @param request CommitSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public commitSchema(request: google.pubsub.v1.ICommitSchemaRequest, callback: google.pubsub.v1.SchemaService.CommitSchemaCallback): void; + + /** + * Calls CommitSchema. + * @param request CommitSchemaRequest message or plain object + * @returns Promise + */ + public commitSchema(request: google.pubsub.v1.ICommitSchemaRequest): Promise; + + /** + * Calls RollbackSchema. + * @param request RollbackSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public rollbackSchema(request: google.pubsub.v1.IRollbackSchemaRequest, callback: google.pubsub.v1.SchemaService.RollbackSchemaCallback): void; + + /** + * Calls RollbackSchema. + * @param request RollbackSchemaRequest message or plain object + * @returns Promise + */ + public rollbackSchema(request: google.pubsub.v1.IRollbackSchemaRequest): Promise; + + /** + * Calls DeleteSchemaRevision. + * @param request DeleteSchemaRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public deleteSchemaRevision(request: google.pubsub.v1.IDeleteSchemaRevisionRequest, callback: google.pubsub.v1.SchemaService.DeleteSchemaRevisionCallback): void; + + /** + * Calls DeleteSchemaRevision. + * @param request DeleteSchemaRevisionRequest message or plain object + * @returns Promise + */ + public deleteSchemaRevision(request: google.pubsub.v1.IDeleteSchemaRevisionRequest): Promise; + + /** + * Calls DeleteSchema. + * @param request DeleteSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSchema(request: google.pubsub.v1.IDeleteSchemaRequest, callback: google.pubsub.v1.SchemaService.DeleteSchemaCallback): void; + + /** + * Calls DeleteSchema. + * @param request DeleteSchemaRequest message or plain object + * @returns Promise + */ + public deleteSchema(request: google.pubsub.v1.IDeleteSchemaRequest): Promise; + + /** + * Calls ValidateSchema. + * @param request ValidateSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValidateSchemaResponse + */ + public validateSchema(request: google.pubsub.v1.IValidateSchemaRequest, callback: google.pubsub.v1.SchemaService.ValidateSchemaCallback): void; + + /** + * Calls ValidateSchema. + * @param request ValidateSchemaRequest message or plain object + * @returns Promise + */ + public validateSchema(request: google.pubsub.v1.IValidateSchemaRequest): Promise; + + /** + * Calls ValidateMessage. + * @param request ValidateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValidateMessageResponse + */ + public validateMessage(request: google.pubsub.v1.IValidateMessageRequest, callback: google.pubsub.v1.SchemaService.ValidateMessageCallback): void; + + /** + * Calls ValidateMessage. + * @param request ValidateMessageRequest message or plain object + * @returns Promise + */ + public validateMessage(request: google.pubsub.v1.IValidateMessageRequest): Promise; + } + + namespace SchemaService { + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type CreateSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type GetSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}. + * @param error Error, if any + * @param [response] ListSchemasResponse + */ + type ListSchemasCallback = (error: (Error|null), response?: google.pubsub.v1.ListSchemasResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemaRevisions}. + * @param error Error, if any + * @param [response] ListSchemaRevisionsResponse + */ + type ListSchemaRevisionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSchemaRevisionsResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|commitSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type CommitSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|rollbackSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type RollbackSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchemaRevision}. + * @param error Error, if any + * @param [response] Schema + */ + type DeleteSchemaRevisionCallback = (error: (Error|null), response?: google.pubsub.v1.Schema) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSchemaCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}. + * @param error Error, if any + * @param [response] ValidateSchemaResponse + */ + type ValidateSchemaCallback = (error: (Error|null), response?: google.pubsub.v1.ValidateSchemaResponse) => void; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}. + * @param error Error, if any + * @param [response] ValidateMessageResponse + */ + type ValidateMessageCallback = (error: (Error|null), response?: google.pubsub.v1.ValidateMessageResponse) => void; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema name */ + name?: (string|null); + + /** Schema type */ + type?: (google.pubsub.v1.Schema.Type|keyof typeof google.pubsub.v1.Schema.Type|null); + + /** Schema definition */ + definition?: (string|null); + + /** Schema revisionId */ + revisionId?: (string|null); + + /** Schema revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISchema); + + /** Schema name. */ + public name: string; + + /** Schema type. */ + public type: (google.pubsub.v1.Schema.Type|keyof typeof google.pubsub.v1.Schema.Type); + + /** Schema definition. */ + public definition: string; + + /** Schema revisionId. */ + public revisionId: string; + + /** Schema revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.pubsub.v1.ISchema): google.pubsub.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Schema { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PROTOCOL_BUFFER = 1, + AVRO = 2 + } + } + + /** SchemaView enum. */ + enum SchemaView { + SCHEMA_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a CreateSchemaRequest. */ + interface ICreateSchemaRequest { + + /** CreateSchemaRequest parent */ + parent?: (string|null); + + /** CreateSchemaRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + + /** CreateSchemaRequest schemaId */ + schemaId?: (string|null); + } + + /** Represents a CreateSchemaRequest. */ + class CreateSchemaRequest implements ICreateSchemaRequest { + + /** + * Constructs a new CreateSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICreateSchemaRequest); + + /** CreateSchemaRequest parent. */ + public parent: string; + + /** CreateSchemaRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** CreateSchemaRequest schemaId. */ + public schemaId: string; + + /** + * Creates a new CreateSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.ICreateSchemaRequest): google.pubsub.v1.CreateSchemaRequest; + + /** + * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @param message CreateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @param message CreateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CreateSchemaRequest; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CreateSchemaRequest; + + /** + * Verifies a CreateSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSchemaRequest; + + /** + * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. + * @param message CreateSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CreateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSchemaRequest. */ + interface IGetSchemaRequest { + + /** GetSchemaRequest name */ + name?: (string|null); + + /** GetSchemaRequest view */ + view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); + } + + /** Represents a GetSchemaRequest. */ + class GetSchemaRequest implements IGetSchemaRequest { + + /** + * Constructs a new GetSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSchemaRequest); + + /** GetSchemaRequest name. */ + public name: string; + + /** GetSchemaRequest view. */ + public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSchemaRequest): google.pubsub.v1.GetSchemaRequest; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSchemaRequest; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSchemaRequest; + + /** + * Verifies a GetSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSchemaRequest; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @param message GetSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemasRequest. */ + interface IListSchemasRequest { + + /** ListSchemasRequest parent */ + parent?: (string|null); + + /** ListSchemasRequest view */ + view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); + + /** ListSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemasRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemasRequest. */ + class ListSchemasRequest implements IListSchemasRequest { + + /** + * Constructs a new ListSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemasRequest); + + /** ListSchemasRequest parent. */ + public parent: string; + + /** ListSchemasRequest view. */ + public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); + + /** ListSchemasRequest pageSize. */ + public pageSize: number; + + /** ListSchemasRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemasRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSchemasRequest): google.pubsub.v1.ListSchemasRequest; + + /** + * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @param message ListSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @param message ListSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSchemasRequest; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSchemasRequest; + + /** + * Verifies a ListSchemasRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemasRequest; + + /** + * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. + * @param message ListSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemasResponse. */ + interface IListSchemasResponse { + + /** ListSchemasResponse schemas */ + schemas?: (google.pubsub.v1.ISchema[]|null); + + /** ListSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemasResponse. */ + class ListSchemasResponse implements IListSchemasResponse { + + /** + * Constructs a new ListSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemasResponse); + + /** ListSchemasResponse schemas. */ + public schemas: google.pubsub.v1.ISchema[]; + + /** ListSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemasResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSchemasResponse): google.pubsub.v1.ListSchemasResponse; + + /** + * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @param message ListSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @param message ListSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSchemasResponse; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSchemasResponse; + + /** + * Verifies a ListSchemasResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemasResponse; + + /** + * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. + * @param message ListSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaRevisionsRequest. */ + interface IListSchemaRevisionsRequest { + + /** ListSchemaRevisionsRequest name */ + name?: (string|null); + + /** ListSchemaRevisionsRequest view */ + view?: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView|null); + + /** ListSchemaRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemaRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemaRevisionsRequest. */ + class ListSchemaRevisionsRequest implements IListSchemaRevisionsRequest { + + /** + * Constructs a new ListSchemaRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemaRevisionsRequest); + + /** ListSchemaRevisionsRequest name. */ + public name: string; + + /** ListSchemaRevisionsRequest view. */ + public view: (google.pubsub.v1.SchemaView|keyof typeof google.pubsub.v1.SchemaView); + + /** ListSchemaRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListSchemaRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemaRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaRevisionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSchemaRevisionsRequest): google.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Encodes the specified ListSchemaRevisionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @param message ListSchemaRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemaRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaRevisionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @param message ListSchemaRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemaRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Verifies a ListSchemaRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemaRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemaRevisionsRequest; + + /** + * Creates a plain object from a ListSchemaRevisionsRequest message. Also converts values to other types if specified. + * @param message ListSchemaRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemaRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemaRevisionsResponse. */ + interface IListSchemaRevisionsResponse { + + /** ListSchemaRevisionsResponse schemas */ + schemas?: (google.pubsub.v1.ISchema[]|null); + + /** ListSchemaRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemaRevisionsResponse. */ + class ListSchemaRevisionsResponse implements IListSchemaRevisionsResponse { + + /** + * Constructs a new ListSchemaRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSchemaRevisionsResponse); + + /** ListSchemaRevisionsResponse schemas. */ + public schemas: google.pubsub.v1.ISchema[]; + + /** ListSchemaRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemaRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemaRevisionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSchemaRevisionsResponse): google.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Encodes the specified ListSchemaRevisionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @param message ListSchemaRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSchemaRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemaRevisionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @param message ListSchemaRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSchemaRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemaRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemaRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Verifies a ListSchemaRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemaRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemaRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSchemaRevisionsResponse; + + /** + * Creates a plain object from a ListSchemaRevisionsResponse message. Also converts values to other types if specified. + * @param message ListSchemaRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSchemaRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemaRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemaRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitSchemaRequest. */ + interface ICommitSchemaRequest { + + /** CommitSchemaRequest name */ + name?: (string|null); + + /** CommitSchemaRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + } + + /** Represents a CommitSchemaRequest. */ + class CommitSchemaRequest implements ICommitSchemaRequest { + + /** + * Constructs a new CommitSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ICommitSchemaRequest); + + /** CommitSchemaRequest name. */ + public name: string; + + /** CommitSchemaRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** + * Creates a new CommitSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.ICommitSchemaRequest): google.pubsub.v1.CommitSchemaRequest; + + /** + * Encodes the specified CommitSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @param message CommitSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ICommitSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @param message CommitSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ICommitSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CommitSchemaRequest; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CommitSchemaRequest; + + /** + * Verifies a CommitSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CommitSchemaRequest; + + /** + * Creates a plain object from a CommitSchemaRequest message. Also converts values to other types if specified. + * @param message CommitSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.CommitSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackSchemaRequest. */ + interface IRollbackSchemaRequest { + + /** RollbackSchemaRequest name */ + name?: (string|null); + + /** RollbackSchemaRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a RollbackSchemaRequest. */ + class RollbackSchemaRequest implements IRollbackSchemaRequest { + + /** + * Constructs a new RollbackSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IRollbackSchemaRequest); + + /** RollbackSchemaRequest name. */ + public name: string; + + /** RollbackSchemaRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new RollbackSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IRollbackSchemaRequest): google.pubsub.v1.RollbackSchemaRequest; + + /** + * Encodes the specified RollbackSchemaRequest message. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @param message RollbackSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IRollbackSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @param message RollbackSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IRollbackSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.RollbackSchemaRequest; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.RollbackSchemaRequest; + + /** + * Verifies a RollbackSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RollbackSchemaRequest; + + /** + * Creates a plain object from a RollbackSchemaRequest message. Also converts values to other types if specified. + * @param message RollbackSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.RollbackSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaRevisionRequest. */ + interface IDeleteSchemaRevisionRequest { + + /** DeleteSchemaRevisionRequest name */ + name?: (string|null); + + /** DeleteSchemaRevisionRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a DeleteSchemaRevisionRequest. */ + class DeleteSchemaRevisionRequest implements IDeleteSchemaRevisionRequest { + + /** + * Constructs a new DeleteSchemaRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSchemaRevisionRequest); + + /** DeleteSchemaRevisionRequest name. */ + public name: string; + + /** DeleteSchemaRevisionRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new DeleteSchemaRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaRevisionRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSchemaRevisionRequest): google.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @param message DeleteSchemaRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSchemaRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @param message DeleteSchemaRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSchemaRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Verifies a DeleteSchemaRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSchemaRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSchemaRevisionRequest; + + /** + * Creates a plain object from a DeleteSchemaRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSchemaRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaRequest. */ + interface IDeleteSchemaRequest { + + /** DeleteSchemaRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSchemaRequest. */ + class DeleteSchemaRequest implements IDeleteSchemaRequest { + + /** + * Constructs a new DeleteSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteSchemaRequest); + + /** DeleteSchemaRequest name. */ + public name: string; + + /** + * Creates a new DeleteSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteSchemaRequest): google.pubsub.v1.DeleteSchemaRequest; + + /** + * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @param message DeleteSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @param message DeleteSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSchemaRequest; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSchemaRequest; + + /** + * Verifies a DeleteSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSchemaRequest; + + /** + * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateSchemaRequest. */ + interface IValidateSchemaRequest { + + /** ValidateSchemaRequest parent */ + parent?: (string|null); + + /** ValidateSchemaRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + } + + /** Represents a ValidateSchemaRequest. */ + class ValidateSchemaRequest implements IValidateSchemaRequest { + + /** + * Constructs a new ValidateSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateSchemaRequest); + + /** ValidateSchemaRequest parent. */ + public parent: string; + + /** ValidateSchemaRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** + * Creates a new ValidateSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateSchemaRequest instance + */ + public static create(properties?: google.pubsub.v1.IValidateSchemaRequest): google.pubsub.v1.ValidateSchemaRequest; + + /** + * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @param message ValidateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @param message ValidateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ValidateSchemaRequest; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ValidateSchemaRequest; + + /** + * Verifies a ValidateSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateSchemaRequest; + + /** + * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified. + * @param message ValidateSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateSchemaResponse. */ + interface IValidateSchemaResponse { + } + + /** Represents a ValidateSchemaResponse. */ + class ValidateSchemaResponse implements IValidateSchemaResponse { + + /** + * Constructs a new ValidateSchemaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateSchemaResponse); + + /** + * Creates a new ValidateSchemaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateSchemaResponse instance + */ + public static create(properties?: google.pubsub.v1.IValidateSchemaResponse): google.pubsub.v1.ValidateSchemaResponse; + + /** + * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @param message ValidateSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @param message ValidateSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ValidateSchemaResponse; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ValidateSchemaResponse; + + /** + * Verifies a ValidateSchemaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateSchemaResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateSchemaResponse; + + /** + * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified. + * @param message ValidateSchemaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateSchemaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateSchemaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateMessageRequest. */ + interface IValidateMessageRequest { + + /** ValidateMessageRequest parent */ + parent?: (string|null); + + /** ValidateMessageRequest name */ + name?: (string|null); + + /** ValidateMessageRequest schema */ + schema?: (google.pubsub.v1.ISchema|null); + + /** ValidateMessageRequest message */ + message?: (Uint8Array|Buffer|string|null); + + /** ValidateMessageRequest encoding */ + encoding?: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding|null); + } + + /** Represents a ValidateMessageRequest. */ + class ValidateMessageRequest implements IValidateMessageRequest { + + /** + * Constructs a new ValidateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateMessageRequest); + + /** ValidateMessageRequest parent. */ + public parent: string; + + /** ValidateMessageRequest name. */ + public name?: (string|null); + + /** ValidateMessageRequest schema. */ + public schema?: (google.pubsub.v1.ISchema|null); + + /** ValidateMessageRequest message. */ + public message: (Uint8Array|Buffer|string); + + /** ValidateMessageRequest encoding. */ + public encoding: (google.pubsub.v1.Encoding|keyof typeof google.pubsub.v1.Encoding); + + /** ValidateMessageRequest schemaSpec. */ + public schemaSpec?: ("name"|"schema"); + + /** + * Creates a new ValidateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateMessageRequest instance + */ + public static create(properties?: google.pubsub.v1.IValidateMessageRequest): google.pubsub.v1.ValidateMessageRequest; + + /** + * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @param message ValidateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @param message ValidateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ValidateMessageRequest; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ValidateMessageRequest; + + /** + * Verifies a ValidateMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateMessageRequest; + + /** + * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified. + * @param message ValidateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidateMessageResponse. */ + interface IValidateMessageResponse { + } + + /** Represents a ValidateMessageResponse. */ + class ValidateMessageResponse implements IValidateMessageResponse { + + /** + * Constructs a new ValidateMessageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IValidateMessageResponse); + + /** + * Creates a new ValidateMessageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateMessageResponse instance + */ + public static create(properties?: google.pubsub.v1.IValidateMessageResponse): google.pubsub.v1.ValidateMessageResponse; + + /** + * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @param message ValidateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IValidateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @param message ValidateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IValidateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ValidateMessageResponse; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ValidateMessageResponse; + + /** + * Verifies a ValidateMessageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateMessageResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ValidateMessageResponse; + + /** + * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified. + * @param message ValidateMessageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ValidateMessageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateMessageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateMessageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Encoding enum. */ + enum Encoding { + ENCODING_UNSPECIFIED = 0, + JSON = 1, + BINARY = 2 + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|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[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * 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); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|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); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|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; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not 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.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload 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.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @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); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|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); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * 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 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not 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.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload 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.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + 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 optionDependency */ + optionDependency?: (string[]|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 optionDependency. */ + public optionDependency: string[]; + + /** 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); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|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[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|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[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * 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 featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|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 a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a 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.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is 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.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @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 featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|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 featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|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); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * 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 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a 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.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is 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.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** 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 overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (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 overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (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 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 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 an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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; + } + } +} diff --git a/handwritten/pubsub/protos/protos.js b/handwritten/pubsub/protos/protos.js new file mode 100644 index 00000000000..319bc79955f --- /dev/null +++ b/handwritten/pubsub/protos/protos.js @@ -0,0 +1,47589 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_pubsub_protos || ($protobuf.roots._google_cloud_pubsub_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.pubsub = (function() { + + /** + * Namespace pubsub. + * @memberof google + * @namespace + */ + var pubsub = {}; + + pubsub.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.pubsub + * @namespace + */ + var v1 = {}; + + v1.Publisher = (function() { + + /** + * Constructs a new Publisher service. + * @memberof google.pubsub.v1 + * @classdesc Represents a Publisher + * @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 Publisher(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Publisher.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Publisher; + + /** + * Creates new Publisher service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.Publisher + * @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 {Publisher} RPC service. Useful where requests and/or responses are streamed. + */ + Publisher.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef CreateTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ + + /** + * Calls CreateTopic. + * @function createTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.ITopic} request Topic message or plain object + * @param {google.pubsub.v1.Publisher.CreateTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.createTopic = function createTopic(request, callback) { + return this.rpcCall(createTopic, $root.google.pubsub.v1.Topic, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "CreateTopic" }); + + /** + * Calls CreateTopic. + * @function createTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.ITopic} request Topic message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef UpdateTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ + + /** + * Calls UpdateTopic. + * @function updateTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.UpdateTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.updateTopic = function updateTopic(request, callback) { + return this.rpcCall(updateTopic, $root.google.pubsub.v1.UpdateTopicRequest, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "UpdateTopic" }); + + /** + * Calls UpdateTopic. + * @function updateTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|publish}. + * @memberof google.pubsub.v1.Publisher + * @typedef PublishCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.PublishResponse} [response] PublishResponse + */ + + /** + * Calls Publish. + * @function publish + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object + * @param {google.pubsub.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) { + return this.rpcCall(publish, $root.google.pubsub.v1.PublishRequest, $root.google.pubsub.v1.PublishResponse, request, callback); + }, "name", { value: "Publish" }); + + /** + * Calls Publish. + * @function publish + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef GetTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ + + /** + * Calls GetTopic. + * @function getTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.GetTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.getTopic = function getTopic(request, callback) { + return this.rpcCall(getTopic, $root.google.pubsub.v1.GetTopicRequest, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "GetTopic" }); + + /** + * Calls GetTopic. + * @function getTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicsResponse} [response] ListTopicsResponse + */ + + /** + * Calls ListTopics. + * @function listTopics + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicsCallback} callback Node-style callback called with the error, if any, and ListTopicsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.listTopics = function listTopics(request, callback) { + return this.rpcCall(listTopics, $root.google.pubsub.v1.ListTopicsRequest, $root.google.pubsub.v1.ListTopicsResponse, request, callback); + }, "name", { value: "ListTopics" }); + + /** + * Calls ListTopics. + * @function listTopics + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} [response] ListTopicSubscriptionsResponse + */ + + /** + * Calls ListTopicSubscriptions. + * @function listTopicSubscriptions + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.listTopicSubscriptions = function listTopicSubscriptions(request, callback) { + return this.rpcCall(listTopicSubscriptions, $root.google.pubsub.v1.ListTopicSubscriptionsRequest, $root.google.pubsub.v1.ListTopicSubscriptionsResponse, request, callback); + }, "name", { value: "ListTopicSubscriptions" }); + + /** + * Calls ListTopicSubscriptions. + * @function listTopicSubscriptions + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicSnapshotsResponse} [response] ListTopicSnapshotsResponse + */ + + /** + * Calls ListTopicSnapshots. + * @function listTopicSnapshots + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicSnapshotsCallback} callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.listTopicSnapshots = function listTopicSnapshots(request, callback) { + return this.rpcCall(listTopicSnapshots, $root.google.pubsub.v1.ListTopicSnapshotsRequest, $root.google.pubsub.v1.ListTopicSnapshotsResponse, request, callback); + }, "name", { value: "ListTopicSnapshots" }); + + /** + * Calls ListTopicSnapshots. + * @function listTopicSnapshots + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef DeleteTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTopic. + * @function deleteTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.DeleteTopicCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.deleteTopic = function deleteTopic(request, callback) { + return this.rpcCall(deleteTopic, $root.google.pubsub.v1.DeleteTopicRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTopic" }); + + /** + * Calls DeleteTopic. + * @function deleteTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}. + * @memberof google.pubsub.v1.Publisher + * @typedef DetachSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.DetachSubscriptionResponse} [response] DetachSubscriptionResponse + */ + + /** + * Calls DetachSubscription. + * @function detachSubscription + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Publisher.DetachSubscriptionCallback} callback Node-style callback called with the error, if any, and DetachSubscriptionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.detachSubscription = function detachSubscription(request, callback) { + return this.rpcCall(detachSubscription, $root.google.pubsub.v1.DetachSubscriptionRequest, $root.google.pubsub.v1.DetachSubscriptionResponse, request, callback); + }, "name", { value: "DetachSubscription" }); + + /** + * Calls DetachSubscription. + * @function detachSubscription + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Publisher; + })(); + + v1.MessageStoragePolicy = (function() { + + /** + * Properties of a MessageStoragePolicy. + * @memberof google.pubsub.v1 + * @interface IMessageStoragePolicy + * @property {Array.|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions + * @property {boolean|null} [enforceInTransit] MessageStoragePolicy enforceInTransit + */ + + /** + * Constructs a new MessageStoragePolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a MessageStoragePolicy. + * @implements IMessageStoragePolicy + * @constructor + * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set + */ + function MessageStoragePolicy(properties) { + this.allowedPersistenceRegions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageStoragePolicy allowedPersistenceRegions. + * @member {Array.} allowedPersistenceRegions + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + */ + MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray; + + /** + * MessageStoragePolicy enforceInTransit. + * @member {boolean} enforceInTransit + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + */ + MessageStoragePolicy.prototype.enforceInTransit = false; + + /** + * Creates a new MessageStoragePolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy instance + */ + MessageStoragePolicy.create = function create(properties) { + return new MessageStoragePolicy(properties); + }; + + /** + * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageStoragePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length) + for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]); + if (message.enforceInTransit != null && Object.hasOwnProperty.call(message, "enforceInTransit")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enforceInTransit); + return writer; + }; + + /** + * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageStoragePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageStoragePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.MessageStoragePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedPersistenceRegions && message.allowedPersistenceRegions.length)) + message.allowedPersistenceRegions = []; + message.allowedPersistenceRegions.push(reader.string()); + break; + } + case 2: { + message.enforceInTransit = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageStoragePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageStoragePolicy message. + * @function verify + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageStoragePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedPersistenceRegions != null && message.hasOwnProperty("allowedPersistenceRegions")) { + if (!Array.isArray(message.allowedPersistenceRegions)) + return "allowedPersistenceRegions: array expected"; + for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) + if (!$util.isString(message.allowedPersistenceRegions[i])) + return "allowedPersistenceRegions: string[] expected"; + } + if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) + if (typeof message.enforceInTransit !== "boolean") + return "enforceInTransit: boolean expected"; + return null; + }; + + /** + * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + */ + MessageStoragePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.MessageStoragePolicy) + return object; + var message = new $root.google.pubsub.v1.MessageStoragePolicy(); + if (object.allowedPersistenceRegions) { + if (!Array.isArray(object.allowedPersistenceRegions)) + throw TypeError(".google.pubsub.v1.MessageStoragePolicy.allowedPersistenceRegions: array expected"); + message.allowedPersistenceRegions = []; + for (var i = 0; i < object.allowedPersistenceRegions.length; ++i) + message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]); + } + if (object.enforceInTransit != null) + message.enforceInTransit = Boolean(object.enforceInTransit); + return message; + }; + + /** + * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.MessageStoragePolicy} message MessageStoragePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageStoragePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedPersistenceRegions = []; + if (options.defaults) + object.enforceInTransit = false; + if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) { + object.allowedPersistenceRegions = []; + for (var j = 0; j < message.allowedPersistenceRegions.length; ++j) + object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j]; + } + if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) + object.enforceInTransit = message.enforceInTransit; + return object; + }; + + /** + * Converts this MessageStoragePolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + * @returns {Object.} JSON object + */ + MessageStoragePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageStoragePolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageStoragePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.MessageStoragePolicy"; + }; + + return MessageStoragePolicy; + })(); + + v1.SchemaSettings = (function() { + + /** + * Properties of a SchemaSettings. + * @memberof google.pubsub.v1 + * @interface ISchemaSettings + * @property {string|null} [schema] SchemaSettings schema + * @property {google.pubsub.v1.Encoding|null} [encoding] SchemaSettings encoding + * @property {string|null} [firstRevisionId] SchemaSettings firstRevisionId + * @property {string|null} [lastRevisionId] SchemaSettings lastRevisionId + */ + + /** + * Constructs a new SchemaSettings. + * @memberof google.pubsub.v1 + * @classdesc Represents a SchemaSettings. + * @implements ISchemaSettings + * @constructor + * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set + */ + function SchemaSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchemaSettings schema. + * @member {string} schema + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.schema = ""; + + /** + * SchemaSettings encoding. + * @member {google.pubsub.v1.Encoding} encoding + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.encoding = 0; + + /** + * SchemaSettings firstRevisionId. + * @member {string} firstRevisionId + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.firstRevisionId = ""; + + /** + * SchemaSettings lastRevisionId. + * @member {string} lastRevisionId + * @memberof google.pubsub.v1.SchemaSettings + * @instance + */ + SchemaSettings.prototype.lastRevisionId = ""; + + /** + * Creates a new SchemaSettings instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings instance + */ + SchemaSettings.create = function create(properties) { + return new SchemaSettings(properties); + }; + + /** + * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encoding); + if (message.firstRevisionId != null && Object.hasOwnProperty.call(message, "firstRevisionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.firstRevisionId); + if (message.lastRevisionId != null && Object.hasOwnProperty.call(message, "lastRevisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.lastRevisionId); + return writer; + }; + + /** + * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SchemaSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.schema = reader.string(); + break; + } + case 2: { + message.encoding = reader.int32(); + break; + } + case 3: { + message.firstRevisionId = reader.string(); + break; + } + case 4: { + message.lastRevisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaSettings message. + * @function verify + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.firstRevisionId != null && message.hasOwnProperty("firstRevisionId")) + if (!$util.isString(message.firstRevisionId)) + return "firstRevisionId: string expected"; + if (message.lastRevisionId != null && message.hasOwnProperty("lastRevisionId")) + if (!$util.isString(message.lastRevisionId)) + return "lastRevisionId: string expected"; + return null; + }; + + /** + * Creates a SchemaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings + */ + SchemaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SchemaSettings) + return object; + var message = new $root.google.pubsub.v1.SchemaSettings(); + if (object.schema != null) + message.schema = String(object.schema); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "JSON": + case 1: + message.encoding = 1; + break; + case "BINARY": + case 2: + message.encoding = 2; + break; + } + if (object.firstRevisionId != null) + message.firstRevisionId = String(object.firstRevisionId); + if (object.lastRevisionId != null) + message.lastRevisionId = String(object.lastRevisionId); + return message; + }; + + /** + * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {google.pubsub.v1.SchemaSettings} message SchemaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schema = ""; + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.firstRevisionId = ""; + object.lastRevisionId = ""; + } + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] === undefined ? message.encoding : $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding; + if (message.firstRevisionId != null && message.hasOwnProperty("firstRevisionId")) + object.firstRevisionId = message.firstRevisionId; + if (message.lastRevisionId != null && message.hasOwnProperty("lastRevisionId")) + object.lastRevisionId = message.lastRevisionId; + return object; + }; + + /** + * Converts this SchemaSettings to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SchemaSettings + * @instance + * @returns {Object.} JSON object + */ + SchemaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaSettings + * @function getTypeUrl + * @memberof google.pubsub.v1.SchemaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.SchemaSettings"; + }; + + return SchemaSettings; + })(); + + v1.IngestionDataSourceSettings = (function() { + + /** + * Properties of an IngestionDataSourceSettings. + * @memberof google.pubsub.v1 + * @interface IIngestionDataSourceSettings + * @property {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null} [awsKinesis] IngestionDataSourceSettings awsKinesis + * @property {google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage|null} [cloudStorage] IngestionDataSourceSettings cloudStorage + * @property {google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs|null} [azureEventHubs] IngestionDataSourceSettings azureEventHubs + * @property {google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk|null} [awsMsk] IngestionDataSourceSettings awsMsk + * @property {google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud|null} [confluentCloud] IngestionDataSourceSettings confluentCloud + * @property {google.pubsub.v1.IPlatformLogsSettings|null} [platformLogsSettings] IngestionDataSourceSettings platformLogsSettings + */ + + /** + * Constructs a new IngestionDataSourceSettings. + * @memberof google.pubsub.v1 + * @classdesc Represents an IngestionDataSourceSettings. + * @implements IIngestionDataSourceSettings + * @constructor + * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set + */ + function IngestionDataSourceSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestionDataSourceSettings awsKinesis. + * @member {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null|undefined} awsKinesis + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.awsKinesis = null; + + /** + * IngestionDataSourceSettings cloudStorage. + * @member {google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage|null|undefined} cloudStorage + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.cloudStorage = null; + + /** + * IngestionDataSourceSettings azureEventHubs. + * @member {google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs|null|undefined} azureEventHubs + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.azureEventHubs = null; + + /** + * IngestionDataSourceSettings awsMsk. + * @member {google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk|null|undefined} awsMsk + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.awsMsk = null; + + /** + * IngestionDataSourceSettings confluentCloud. + * @member {google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud|null|undefined} confluentCloud + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.confluentCloud = null; + + /** + * IngestionDataSourceSettings platformLogsSettings. + * @member {google.pubsub.v1.IPlatformLogsSettings|null|undefined} platformLogsSettings + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.platformLogsSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngestionDataSourceSettings source. + * @member {"awsKinesis"|"cloudStorage"|"azureEventHubs"|"awsMsk"|"confluentCloud"|undefined} source + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + Object.defineProperty(IngestionDataSourceSettings.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["awsKinesis", "cloudStorage", "azureEventHubs", "awsMsk", "confluentCloud"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngestionDataSourceSettings instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings instance + */ + IngestionDataSourceSettings.create = function create(properties) { + return new IngestionDataSourceSettings(properties); + }; + + /** + * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionDataSourceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.awsKinesis != null && Object.hasOwnProperty.call(message, "awsKinesis")) + $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.encode(message.awsKinesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cloudStorage != null && Object.hasOwnProperty.call(message, "cloudStorage")) + $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.encode(message.cloudStorage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.azureEventHubs != null && Object.hasOwnProperty.call(message, "azureEventHubs")) + $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.encode(message.azureEventHubs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.platformLogsSettings != null && Object.hasOwnProperty.call(message, "platformLogsSettings")) + $root.google.pubsub.v1.PlatformLogsSettings.encode(message.platformLogsSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.awsMsk != null && Object.hasOwnProperty.call(message, "awsMsk")) + $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.encode(message.awsMsk, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.confluentCloud != null && Object.hasOwnProperty.call(message, "confluentCloud")) + $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.encode(message.confluentCloud, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionDataSourceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionDataSourceSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cloudStorage = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.azureEventHubs = $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.decode(reader, reader.uint32()); + break; + } + case 5: { + message.awsMsk = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.decode(reader, reader.uint32()); + break; + } + case 6: { + message.confluentCloud = $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.decode(reader, reader.uint32()); + break; + } + case 4: { + message.platformLogsSettings = $root.google.pubsub.v1.PlatformLogsSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionDataSourceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestionDataSourceSettings message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestionDataSourceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify(message.awsKinesis); + if (error) + return "awsKinesis." + error; + } + } + if (message.cloudStorage != null && message.hasOwnProperty("cloudStorage")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.verify(message.cloudStorage); + if (error) + return "cloudStorage." + error; + } + } + if (message.azureEventHubs != null && message.hasOwnProperty("azureEventHubs")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.verify(message.azureEventHubs); + if (error) + return "azureEventHubs." + error; + } + } + if (message.awsMsk != null && message.hasOwnProperty("awsMsk")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.verify(message.awsMsk); + if (error) + return "awsMsk." + error; + } + } + if (message.confluentCloud != null && message.hasOwnProperty("confluentCloud")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.verify(message.confluentCloud); + if (error) + return "confluentCloud." + error; + } + } + if (message.platformLogsSettings != null && message.hasOwnProperty("platformLogsSettings")) { + var error = $root.google.pubsub.v1.PlatformLogsSettings.verify(message.platformLogsSettings); + if (error) + return "platformLogsSettings." + error; + } + return null; + }; + + /** + * Creates an IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + */ + IngestionDataSourceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings(); + if (object.awsKinesis != null) { + if (typeof object.awsKinesis !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.awsKinesis: object expected"); + message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.fromObject(object.awsKinesis); + } + if (object.cloudStorage != null) { + if (typeof object.cloudStorage !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.cloudStorage: object expected"); + message.cloudStorage = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.fromObject(object.cloudStorage); + } + if (object.azureEventHubs != null) { + if (typeof object.azureEventHubs !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.azureEventHubs: object expected"); + message.azureEventHubs = $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.fromObject(object.azureEventHubs); + } + if (object.awsMsk != null) { + if (typeof object.awsMsk !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.awsMsk: object expected"); + message.awsMsk = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.fromObject(object.awsMsk); + } + if (object.confluentCloud != null) { + if (typeof object.confluentCloud !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.confluentCloud: object expected"); + message.confluentCloud = $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.fromObject(object.confluentCloud); + } + if (object.platformLogsSettings != null) { + if (typeof object.platformLogsSettings !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.platformLogsSettings: object expected"); + message.platformLogsSettings = $root.google.pubsub.v1.PlatformLogsSettings.fromObject(object.platformLogsSettings); + } + return message; + }; + + /** + * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings} message IngestionDataSourceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestionDataSourceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.platformLogsSettings = null; + if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { + object.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.toObject(message.awsKinesis, options); + if (options.oneofs) + object.source = "awsKinesis"; + } + if (message.cloudStorage != null && message.hasOwnProperty("cloudStorage")) { + object.cloudStorage = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.toObject(message.cloudStorage, options); + if (options.oneofs) + object.source = "cloudStorage"; + } + if (message.azureEventHubs != null && message.hasOwnProperty("azureEventHubs")) { + object.azureEventHubs = $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.toObject(message.azureEventHubs, options); + if (options.oneofs) + object.source = "azureEventHubs"; + } + if (message.platformLogsSettings != null && message.hasOwnProperty("platformLogsSettings")) + object.platformLogsSettings = $root.google.pubsub.v1.PlatformLogsSettings.toObject(message.platformLogsSettings, options); + if (message.awsMsk != null && message.hasOwnProperty("awsMsk")) { + object.awsMsk = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.toObject(message.awsMsk, options); + if (options.oneofs) + object.source = "awsMsk"; + } + if (message.confluentCloud != null && message.hasOwnProperty("confluentCloud")) { + object.confluentCloud = $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.toObject(message.confluentCloud, options); + if (options.oneofs) + object.source = "confluentCloud"; + } + return object; + }; + + /** + * Converts this IngestionDataSourceSettings to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + * @returns {Object.} JSON object + */ + IngestionDataSourceSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestionDataSourceSettings + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestionDataSourceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings"; + }; + + IngestionDataSourceSettings.AwsKinesis = (function() { + + /** + * Properties of an AwsKinesis. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface IAwsKinesis + * @property {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null} [state] AwsKinesis state + * @property {string|null} [streamArn] AwsKinesis streamArn + * @property {string|null} [consumerArn] AwsKinesis consumerArn + * @property {string|null} [awsRoleArn] AwsKinesis awsRoleArn + * @property {string|null} [gcpServiceAccount] AwsKinesis gcpServiceAccount + */ + + /** + * Constructs a new AwsKinesis. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents an AwsKinesis. + * @implements IAwsKinesis + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set + */ + function AwsKinesis(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsKinesis state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.state = 0; + + /** + * AwsKinesis streamArn. + * @member {string} streamArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.streamArn = ""; + + /** + * AwsKinesis consumerArn. + * @member {string} consumerArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.consumerArn = ""; + + /** + * AwsKinesis awsRoleArn. + * @member {string} awsRoleArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.awsRoleArn = ""; + + /** + * AwsKinesis gcpServiceAccount. + * @member {string} gcpServiceAccount + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.gcpServiceAccount = ""; + + /** + * Creates a new AwsKinesis instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis instance + */ + AwsKinesis.create = function create(properties) { + return new AwsKinesis(properties); + }; + + /** + * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.streamArn != null && Object.hasOwnProperty.call(message, "streamArn")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamArn); + if (message.consumerArn != null && Object.hasOwnProperty.call(message, "consumerArn")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.consumerArn); + if (message.awsRoleArn != null && Object.hasOwnProperty.call(message, "awsRoleArn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.awsRoleArn); + if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcpServiceAccount); + return writer; + }; + + /** + * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesis.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.streamArn = reader.string(); + break; + } + case 3: { + message.consumerArn = reader.string(); + break; + } + case 4: { + message.awsRoleArn = reader.string(); + break; + } + case 5: { + message.gcpServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsKinesis message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsKinesis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + if (!$util.isString(message.streamArn)) + return "streamArn: string expected"; + if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) + if (!$util.isString(message.consumerArn)) + return "consumerArn: string expected"; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + if (!$util.isString(message.awsRoleArn)) + return "awsRoleArn: string expected"; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + if (!$util.isString(message.gcpServiceAccount)) + return "gcpServiceAccount: string expected"; + return null; + }; + + /** + * Creates an AwsKinesis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + */ + AwsKinesis.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "KINESIS_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "STREAM_NOT_FOUND": + case 4: + message.state = 4; + break; + case "CONSUMER_NOT_FOUND": + case 5: + message.state = 5; + break; + } + if (object.streamArn != null) + message.streamArn = String(object.streamArn); + if (object.consumerArn != null) + message.consumerArn = String(object.consumerArn); + if (object.awsRoleArn != null) + message.awsRoleArn = String(object.awsRoleArn); + if (object.gcpServiceAccount != null) + message.gcpServiceAccount = String(object.gcpServiceAccount); + return message; + }; + + /** + * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} message AwsKinesis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsKinesis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.streamArn = ""; + object.consumerArn = ""; + object.awsRoleArn = ""; + object.gcpServiceAccount = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] : message.state; + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + object.streamArn = message.streamArn; + if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) + object.consumerArn = message.consumerArn; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + object.awsRoleArn = message.awsRoleArn; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + object.gcpServiceAccount = message.gcpServiceAccount; + return object; + }; + + /** + * Converts this AwsKinesis to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + * @returns {Object.} JSON object + */ + AwsKinesis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsKinesis + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsKinesis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} KINESIS_PERMISSION_DENIED=2 KINESIS_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} STREAM_NOT_FOUND=4 STREAM_NOT_FOUND value + * @property {number} CONSUMER_NOT_FOUND=5 CONSUMER_NOT_FOUND value + */ + AwsKinesis.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "KINESIS_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "STREAM_NOT_FOUND"] = 4; + values[valuesById[5] = "CONSUMER_NOT_FOUND"] = 5; + return values; + })(); + + return AwsKinesis; + })(); + + IngestionDataSourceSettings.CloudStorage = (function() { + + /** + * Properties of a CloudStorage. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface ICloudStorage + * @property {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State|null} [state] CloudStorage state + * @property {string|null} [bucket] CloudStorage bucket + * @property {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat|null} [textFormat] CloudStorage textFormat + * @property {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat|null} [avroFormat] CloudStorage avroFormat + * @property {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat|null} [pubsubAvroFormat] CloudStorage pubsubAvroFormat + * @property {google.protobuf.ITimestamp|null} [minimumObjectCreateTime] CloudStorage minimumObjectCreateTime + * @property {string|null} [matchGlob] CloudStorage matchGlob + */ + + /** + * Constructs a new CloudStorage. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents a CloudStorage. + * @implements ICloudStorage + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage=} [properties] Properties to set + */ + function CloudStorage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorage state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.state = 0; + + /** + * CloudStorage bucket. + * @member {string} bucket + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.bucket = ""; + + /** + * CloudStorage textFormat. + * @member {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat|null|undefined} textFormat + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.textFormat = null; + + /** + * CloudStorage avroFormat. + * @member {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat|null|undefined} avroFormat + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.avroFormat = null; + + /** + * CloudStorage pubsubAvroFormat. + * @member {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat|null|undefined} pubsubAvroFormat + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.pubsubAvroFormat = null; + + /** + * CloudStorage minimumObjectCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} minimumObjectCreateTime + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.minimumObjectCreateTime = null; + + /** + * CloudStorage matchGlob. + * @member {string} matchGlob + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + CloudStorage.prototype.matchGlob = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudStorage inputFormat. + * @member {"textFormat"|"avroFormat"|"pubsubAvroFormat"|undefined} inputFormat + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + */ + Object.defineProperty(CloudStorage.prototype, "inputFormat", { + get: $util.oneOfGetter($oneOfFields = ["textFormat", "avroFormat", "pubsubAvroFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudStorage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage} CloudStorage instance + */ + CloudStorage.create = function create(properties) { + return new CloudStorage(properties); + }; + + /** + * Encodes the specified CloudStorage message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage} message CloudStorage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucket); + if (message.textFormat != null && Object.hasOwnProperty.call(message, "textFormat")) + $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.encode(message.textFormat, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.avroFormat != null && Object.hasOwnProperty.call(message, "avroFormat")) + $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.encode(message.avroFormat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pubsubAvroFormat != null && Object.hasOwnProperty.call(message, "pubsubAvroFormat")) + $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.encode(message.pubsubAvroFormat, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.minimumObjectCreateTime != null && Object.hasOwnProperty.call(message, "minimumObjectCreateTime")) + $root.google.protobuf.Timestamp.encode(message.minimumObjectCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.matchGlob != null && Object.hasOwnProperty.call(message, "matchGlob")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.matchGlob); + return writer; + }; + + /** + * Encodes the specified CloudStorage message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.ICloudStorage} message CloudStorage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage} CloudStorage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.bucket = reader.string(); + break; + } + case 3: { + message.textFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.decode(reader, reader.uint32()); + break; + } + case 4: { + message.avroFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pubsubAvroFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.decode(reader, reader.uint32()); + break; + } + case 6: { + message.minimumObjectCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.matchGlob = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage} CloudStorage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorage message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.textFormat != null && message.hasOwnProperty("textFormat")) { + properties.inputFormat = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.verify(message.textFormat); + if (error) + return "textFormat." + error; + } + } + if (message.avroFormat != null && message.hasOwnProperty("avroFormat")) { + if (properties.inputFormat === 1) + return "inputFormat: multiple values"; + properties.inputFormat = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.verify(message.avroFormat); + if (error) + return "avroFormat." + error; + } + } + if (message.pubsubAvroFormat != null && message.hasOwnProperty("pubsubAvroFormat")) { + if (properties.inputFormat === 1) + return "inputFormat: multiple values"; + properties.inputFormat = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.verify(message.pubsubAvroFormat); + if (error) + return "pubsubAvroFormat." + error; + } + } + if (message.minimumObjectCreateTime != null && message.hasOwnProperty("minimumObjectCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.minimumObjectCreateTime); + if (error) + return "minimumObjectCreateTime." + error; + } + if (message.matchGlob != null && message.hasOwnProperty("matchGlob")) + if (!$util.isString(message.matchGlob)) + return "matchGlob: string expected"; + return null; + }; + + /** + * Creates a CloudStorage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage} CloudStorage + */ + CloudStorage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CLOUD_STORAGE_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "BUCKET_NOT_FOUND": + case 4: + message.state = 4; + break; + case "TOO_MANY_OBJECTS": + case 5: + message.state = 5; + break; + } + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.textFormat != null) { + if (typeof object.textFormat !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.textFormat: object expected"); + message.textFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.fromObject(object.textFormat); + } + if (object.avroFormat != null) { + if (typeof object.avroFormat !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.avroFormat: object expected"); + message.avroFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.fromObject(object.avroFormat); + } + if (object.pubsubAvroFormat != null) { + if (typeof object.pubsubAvroFormat !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.pubsubAvroFormat: object expected"); + message.pubsubAvroFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.fromObject(object.pubsubAvroFormat); + } + if (object.minimumObjectCreateTime != null) { + if (typeof object.minimumObjectCreateTime !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.minimumObjectCreateTime: object expected"); + message.minimumObjectCreateTime = $root.google.protobuf.Timestamp.fromObject(object.minimumObjectCreateTime); + } + if (object.matchGlob != null) + message.matchGlob = String(object.matchGlob); + return message; + }; + + /** + * Creates a plain object from a CloudStorage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage} message CloudStorage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.bucket = ""; + object.minimumObjectCreateTime = null; + object.matchGlob = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State[message.state] : message.state; + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.textFormat != null && message.hasOwnProperty("textFormat")) { + object.textFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.toObject(message.textFormat, options); + if (options.oneofs) + object.inputFormat = "textFormat"; + } + if (message.avroFormat != null && message.hasOwnProperty("avroFormat")) { + object.avroFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.toObject(message.avroFormat, options); + if (options.oneofs) + object.inputFormat = "avroFormat"; + } + if (message.pubsubAvroFormat != null && message.hasOwnProperty("pubsubAvroFormat")) { + object.pubsubAvroFormat = $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.toObject(message.pubsubAvroFormat, options); + if (options.oneofs) + object.inputFormat = "pubsubAvroFormat"; + } + if (message.minimumObjectCreateTime != null && message.hasOwnProperty("minimumObjectCreateTime")) + object.minimumObjectCreateTime = $root.google.protobuf.Timestamp.toObject(message.minimumObjectCreateTime, options); + if (message.matchGlob != null && message.hasOwnProperty("matchGlob")) + object.matchGlob = message.matchGlob; + return object; + }; + + /** + * Converts this CloudStorage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @instance + * @returns {Object.} JSON object + */ + CloudStorage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorage + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.CloudStorage"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CLOUD_STORAGE_PERMISSION_DENIED=2 CLOUD_STORAGE_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} BUCKET_NOT_FOUND=4 BUCKET_NOT_FOUND value + * @property {number} TOO_MANY_OBJECTS=5 TOO_MANY_OBJECTS value + */ + CloudStorage.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CLOUD_STORAGE_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "BUCKET_NOT_FOUND"] = 4; + values[valuesById[5] = "TOO_MANY_OBJECTS"] = 5; + return values; + })(); + + CloudStorage.TextFormat = (function() { + + /** + * Properties of a TextFormat. + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @interface ITextFormat + * @property {string|null} [delimiter] TextFormat delimiter + */ + + /** + * Constructs a new TextFormat. + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @classdesc Represents a TextFormat. + * @implements ITextFormat + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat=} [properties] Properties to set + */ + function TextFormat(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextFormat delimiter. + * @member {string|null|undefined} delimiter + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @instance + */ + TextFormat.prototype.delimiter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TextFormat.prototype, "_delimiter", { + get: $util.oneOfGetter($oneOfFields = ["delimiter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextFormat instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat} TextFormat instance + */ + TextFormat.create = function create(properties) { + return new TextFormat(properties); + }; + + /** + * Encodes the specified TextFormat message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat} message TextFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.delimiter); + return writer; + }; + + /** + * Encodes the specified TextFormat message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.ITextFormat} message TextFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextFormat message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat} TextFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFormat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.delimiter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat} TextFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextFormat message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) { + properties._delimiter = 1; + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + } + return null; + }; + + /** + * Creates a TextFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat} TextFormat + */ + TextFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat(); + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + return message; + }; + + /** + * Creates a plain object from a TextFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat} message TextFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextFormat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) { + object.delimiter = message.delimiter; + if (options.oneofs) + object._delimiter = "delimiter"; + } + return object; + }; + + /** + * Converts this TextFormat to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @instance + * @returns {Object.} JSON object + */ + TextFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextFormat + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat"; + }; + + return TextFormat; + })(); + + CloudStorage.AvroFormat = (function() { + + /** + * Properties of an AvroFormat. + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @interface IAvroFormat + */ + + /** + * Constructs a new AvroFormat. + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @classdesc Represents an AvroFormat. + * @implements IAvroFormat + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat=} [properties] Properties to set + */ + function AvroFormat(properties) { + if (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 AvroFormat instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat} AvroFormat instance + */ + AvroFormat.create = function create(properties) { + return new AvroFormat(properties); + }; + + /** + * Encodes the specified AvroFormat message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat} message AvroFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AvroFormat message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IAvroFormat} message AvroFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroFormat message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat} AvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroFormat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat} AvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroFormat message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AvroFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat} AvroFormat + */ + AvroFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat) + return object; + return new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat(); + }; + + /** + * Creates a plain object from an AvroFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat} message AvroFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroFormat.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AvroFormat to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @instance + * @returns {Object.} JSON object + */ + AvroFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvroFormat + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat"; + }; + + return AvroFormat; + })(); + + CloudStorage.PubSubAvroFormat = (function() { + + /** + * Properties of a PubSubAvroFormat. + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @interface IPubSubAvroFormat + */ + + /** + * Constructs a new PubSubAvroFormat. + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + * @classdesc Represents a PubSubAvroFormat. + * @implements IPubSubAvroFormat + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat=} [properties] Properties to set + */ + function PubSubAvroFormat(properties) { + if (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 PubSubAvroFormat instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat} PubSubAvroFormat instance + */ + PubSubAvroFormat.create = function create(properties) { + return new PubSubAvroFormat(properties); + }; + + /** + * Encodes the specified PubSubAvroFormat message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat} message PubSubAvroFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubSubAvroFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PubSubAvroFormat message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.IPubSubAvroFormat} message PubSubAvroFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubSubAvroFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubSubAvroFormat message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat} PubSubAvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubSubAvroFormat.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubSubAvroFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat} PubSubAvroFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubSubAvroFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubSubAvroFormat message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubSubAvroFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PubSubAvroFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat} PubSubAvroFormat + */ + PubSubAvroFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat) + return object; + return new $root.google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat(); + }; + + /** + * Creates a plain object from a PubSubAvroFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat} message PubSubAvroFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubSubAvroFormat.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PubSubAvroFormat to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @instance + * @returns {Object.} JSON object + */ + PubSubAvroFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubSubAvroFormat + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubSubAvroFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat"; + }; + + return PubSubAvroFormat; + })(); + + return CloudStorage; + })(); + + IngestionDataSourceSettings.AzureEventHubs = (function() { + + /** + * Properties of an AzureEventHubs. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface IAzureEventHubs + * @property {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State|null} [state] AzureEventHubs state + * @property {string|null} [resourceGroup] AzureEventHubs resourceGroup + * @property {string|null} [namespace] AzureEventHubs namespace + * @property {string|null} [eventHub] AzureEventHubs eventHub + * @property {string|null} [clientId] AzureEventHubs clientId + * @property {string|null} [tenantId] AzureEventHubs tenantId + * @property {string|null} [subscriptionId] AzureEventHubs subscriptionId + * @property {string|null} [gcpServiceAccount] AzureEventHubs gcpServiceAccount + */ + + /** + * Constructs a new AzureEventHubs. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents an AzureEventHubs. + * @implements IAzureEventHubs + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs=} [properties] Properties to set + */ + function AzureEventHubs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureEventHubs state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.state = 0; + + /** + * AzureEventHubs resourceGroup. + * @member {string} resourceGroup + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.resourceGroup = ""; + + /** + * AzureEventHubs namespace. + * @member {string} namespace + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.namespace = ""; + + /** + * AzureEventHubs eventHub. + * @member {string} eventHub + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.eventHub = ""; + + /** + * AzureEventHubs clientId. + * @member {string} clientId + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.clientId = ""; + + /** + * AzureEventHubs tenantId. + * @member {string} tenantId + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.tenantId = ""; + + /** + * AzureEventHubs subscriptionId. + * @member {string} subscriptionId + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.subscriptionId = ""; + + /** + * AzureEventHubs gcpServiceAccount. + * @member {string} gcpServiceAccount + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + */ + AzureEventHubs.prototype.gcpServiceAccount = ""; + + /** + * Creates a new AzureEventHubs instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs} AzureEventHubs instance + */ + AzureEventHubs.create = function create(properties) { + return new AzureEventHubs(properties); + }; + + /** + * Encodes the specified AzureEventHubs message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs} message AzureEventHubs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureEventHubs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.resourceGroup != null && Object.hasOwnProperty.call(message, "resourceGroup")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceGroup); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.namespace); + if (message.eventHub != null && Object.hasOwnProperty.call(message, "eventHub")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.eventHub); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientId); + if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.tenantId); + if (message.subscriptionId != null && Object.hasOwnProperty.call(message, "subscriptionId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.subscriptionId); + if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.gcpServiceAccount); + return writer; + }; + + /** + * Encodes the specified AzureEventHubs message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAzureEventHubs} message AzureEventHubs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureEventHubs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureEventHubs message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs} AzureEventHubs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureEventHubs.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.resourceGroup = reader.string(); + break; + } + case 3: { + message.namespace = reader.string(); + break; + } + case 4: { + message.eventHub = reader.string(); + break; + } + case 5: { + message.clientId = reader.string(); + break; + } + case 6: { + message.tenantId = reader.string(); + break; + } + case 7: { + message.subscriptionId = reader.string(); + break; + } + case 8: { + message.gcpServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureEventHubs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs} AzureEventHubs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureEventHubs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureEventHubs message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureEventHubs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) + if (!$util.isString(message.resourceGroup)) + return "resourceGroup: string expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.eventHub != null && message.hasOwnProperty("eventHub")) + if (!$util.isString(message.eventHub)) + return "eventHub: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.tenantId != null && message.hasOwnProperty("tenantId")) + if (!$util.isString(message.tenantId)) + return "tenantId: string expected"; + if (message.subscriptionId != null && message.hasOwnProperty("subscriptionId")) + if (!$util.isString(message.subscriptionId)) + return "subscriptionId: string expected"; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + if (!$util.isString(message.gcpServiceAccount)) + return "gcpServiceAccount: string expected"; + return null; + }; + + /** + * Creates an AzureEventHubs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs} AzureEventHubs + */ + AzureEventHubs.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "EVENT_HUBS_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "NAMESPACE_NOT_FOUND": + case 4: + message.state = 4; + break; + case "EVENT_HUB_NOT_FOUND": + case 5: + message.state = 5; + break; + case "SUBSCRIPTION_NOT_FOUND": + case 6: + message.state = 6; + break; + case "RESOURCE_GROUP_NOT_FOUND": + case 7: + message.state = 7; + break; + } + if (object.resourceGroup != null) + message.resourceGroup = String(object.resourceGroup); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.eventHub != null) + message.eventHub = String(object.eventHub); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.tenantId != null) + message.tenantId = String(object.tenantId); + if (object.subscriptionId != null) + message.subscriptionId = String(object.subscriptionId); + if (object.gcpServiceAccount != null) + message.gcpServiceAccount = String(object.gcpServiceAccount); + return message; + }; + + /** + * Creates a plain object from an AzureEventHubs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs} message AzureEventHubs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureEventHubs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceGroup = ""; + object.namespace = ""; + object.eventHub = ""; + object.clientId = ""; + object.tenantId = ""; + object.subscriptionId = ""; + object.gcpServiceAccount = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State[message.state] : message.state; + if (message.resourceGroup != null && message.hasOwnProperty("resourceGroup")) + object.resourceGroup = message.resourceGroup; + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.eventHub != null && message.hasOwnProperty("eventHub")) + object.eventHub = message.eventHub; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.tenantId != null && message.hasOwnProperty("tenantId")) + object.tenantId = message.tenantId; + if (message.subscriptionId != null && message.hasOwnProperty("subscriptionId")) + object.subscriptionId = message.subscriptionId; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + object.gcpServiceAccount = message.gcpServiceAccount; + return object; + }; + + /** + * Converts this AzureEventHubs to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @instance + * @returns {Object.} JSON object + */ + AzureEventHubs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureEventHubs + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureEventHubs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} EVENT_HUBS_PERMISSION_DENIED=2 EVENT_HUBS_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} NAMESPACE_NOT_FOUND=4 NAMESPACE_NOT_FOUND value + * @property {number} EVENT_HUB_NOT_FOUND=5 EVENT_HUB_NOT_FOUND value + * @property {number} SUBSCRIPTION_NOT_FOUND=6 SUBSCRIPTION_NOT_FOUND value + * @property {number} RESOURCE_GROUP_NOT_FOUND=7 RESOURCE_GROUP_NOT_FOUND value + */ + AzureEventHubs.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "EVENT_HUBS_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "NAMESPACE_NOT_FOUND"] = 4; + values[valuesById[5] = "EVENT_HUB_NOT_FOUND"] = 5; + values[valuesById[6] = "SUBSCRIPTION_NOT_FOUND"] = 6; + values[valuesById[7] = "RESOURCE_GROUP_NOT_FOUND"] = 7; + return values; + })(); + + return AzureEventHubs; + })(); + + IngestionDataSourceSettings.AwsMsk = (function() { + + /** + * Properties of an AwsMsk. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface IAwsMsk + * @property {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State|null} [state] AwsMsk state + * @property {string|null} [clusterArn] AwsMsk clusterArn + * @property {string|null} [topic] AwsMsk topic + * @property {string|null} [awsRoleArn] AwsMsk awsRoleArn + * @property {string|null} [gcpServiceAccount] AwsMsk gcpServiceAccount + */ + + /** + * Constructs a new AwsMsk. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents an AwsMsk. + * @implements IAwsMsk + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk=} [properties] Properties to set + */ + function AwsMsk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsMsk state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @instance + */ + AwsMsk.prototype.state = 0; + + /** + * AwsMsk clusterArn. + * @member {string} clusterArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @instance + */ + AwsMsk.prototype.clusterArn = ""; + + /** + * AwsMsk topic. + * @member {string} topic + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @instance + */ + AwsMsk.prototype.topic = ""; + + /** + * AwsMsk awsRoleArn. + * @member {string} awsRoleArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @instance + */ + AwsMsk.prototype.awsRoleArn = ""; + + /** + * AwsMsk gcpServiceAccount. + * @member {string} gcpServiceAccount + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @instance + */ + AwsMsk.prototype.gcpServiceAccount = ""; + + /** + * Creates a new AwsMsk instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk} AwsMsk instance + */ + AwsMsk.create = function create(properties) { + return new AwsMsk(properties); + }; + + /** + * Encodes the specified AwsMsk message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk} message AwsMsk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMsk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.clusterArn != null && Object.hasOwnProperty.call(message, "clusterArn")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterArn); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.topic); + if (message.awsRoleArn != null && Object.hasOwnProperty.call(message, "awsRoleArn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.awsRoleArn); + if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcpServiceAccount); + return writer; + }; + + /** + * Encodes the specified AwsMsk message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsMsk} message AwsMsk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMsk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsMsk message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk} AwsMsk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMsk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.clusterArn = reader.string(); + break; + } + case 3: { + message.topic = reader.string(); + break; + } + case 4: { + message.awsRoleArn = reader.string(); + break; + } + case 5: { + message.gcpServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsMsk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk} AwsMsk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMsk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsMsk message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsMsk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.clusterArn != null && message.hasOwnProperty("clusterArn")) + if (!$util.isString(message.clusterArn)) + return "clusterArn: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + if (!$util.isString(message.awsRoleArn)) + return "awsRoleArn: string expected"; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + if (!$util.isString(message.gcpServiceAccount)) + return "gcpServiceAccount: string expected"; + return null; + }; + + /** + * Creates an AwsMsk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk} AwsMsk + */ + AwsMsk.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "MSK_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "CLUSTER_NOT_FOUND": + case 4: + message.state = 4; + break; + case "TOPIC_NOT_FOUND": + case 5: + message.state = 5; + break; + } + if (object.clusterArn != null) + message.clusterArn = String(object.clusterArn); + if (object.topic != null) + message.topic = String(object.topic); + if (object.awsRoleArn != null) + message.awsRoleArn = String(object.awsRoleArn); + if (object.gcpServiceAccount != null) + message.gcpServiceAccount = String(object.gcpServiceAccount); + return message; + }; + + /** + * Creates a plain object from an AwsMsk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.AwsMsk} message AwsMsk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsMsk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.clusterArn = ""; + object.topic = ""; + object.awsRoleArn = ""; + object.gcpServiceAccount = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State[message.state] : message.state; + if (message.clusterArn != null && message.hasOwnProperty("clusterArn")) + object.clusterArn = message.clusterArn; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + object.awsRoleArn = message.awsRoleArn; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + object.gcpServiceAccount = message.gcpServiceAccount; + return object; + }; + + /** + * Converts this AwsMsk to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @instance + * @returns {Object.} JSON object + */ + AwsMsk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsMsk + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsMsk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsMsk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.AwsMsk"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.AwsMsk.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} MSK_PERMISSION_DENIED=2 MSK_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} CLUSTER_NOT_FOUND=4 CLUSTER_NOT_FOUND value + * @property {number} TOPIC_NOT_FOUND=5 TOPIC_NOT_FOUND value + */ + AwsMsk.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "MSK_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "CLUSTER_NOT_FOUND"] = 4; + values[valuesById[5] = "TOPIC_NOT_FOUND"] = 5; + return values; + })(); + + return AwsMsk; + })(); + + IngestionDataSourceSettings.ConfluentCloud = (function() { + + /** + * Properties of a ConfluentCloud. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface IConfluentCloud + * @property {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State|null} [state] ConfluentCloud state + * @property {string|null} [bootstrapServer] ConfluentCloud bootstrapServer + * @property {string|null} [clusterId] ConfluentCloud clusterId + * @property {string|null} [topic] ConfluentCloud topic + * @property {string|null} [identityPoolId] ConfluentCloud identityPoolId + * @property {string|null} [gcpServiceAccount] ConfluentCloud gcpServiceAccount + */ + + /** + * Constructs a new ConfluentCloud. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents a ConfluentCloud. + * @implements IConfluentCloud + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud=} [properties] Properties to set + */ + function ConfluentCloud(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfluentCloud state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + */ + ConfluentCloud.prototype.state = 0; + + /** + * ConfluentCloud bootstrapServer. + * @member {string} bootstrapServer + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + */ + ConfluentCloud.prototype.bootstrapServer = ""; + + /** + * ConfluentCloud clusterId. + * @member {string} clusterId + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + */ + ConfluentCloud.prototype.clusterId = ""; + + /** + * ConfluentCloud topic. + * @member {string} topic + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + */ + ConfluentCloud.prototype.topic = ""; + + /** + * ConfluentCloud identityPoolId. + * @member {string} identityPoolId + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + */ + ConfluentCloud.prototype.identityPoolId = ""; + + /** + * ConfluentCloud gcpServiceAccount. + * @member {string} gcpServiceAccount + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + */ + ConfluentCloud.prototype.gcpServiceAccount = ""; + + /** + * Creates a new ConfluentCloud instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud} ConfluentCloud instance + */ + ConfluentCloud.create = function create(properties) { + return new ConfluentCloud(properties); + }; + + /** + * Encodes the specified ConfluentCloud message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud} message ConfluentCloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfluentCloud.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.bootstrapServer != null && Object.hasOwnProperty.call(message, "bootstrapServer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bootstrapServer); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clusterId); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.topic); + if (message.identityPoolId != null && Object.hasOwnProperty.call(message, "identityPoolId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.identityPoolId); + if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.gcpServiceAccount); + return writer; + }; + + /** + * Encodes the specified ConfluentCloud message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IConfluentCloud} message ConfluentCloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfluentCloud.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfluentCloud message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud} ConfluentCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfluentCloud.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.bootstrapServer = reader.string(); + break; + } + case 3: { + message.clusterId = reader.string(); + break; + } + case 4: { + message.topic = reader.string(); + break; + } + case 5: { + message.identityPoolId = reader.string(); + break; + } + case 6: { + message.gcpServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfluentCloud message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud} ConfluentCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfluentCloud.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfluentCloud message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfluentCloud.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.bootstrapServer != null && message.hasOwnProperty("bootstrapServer")) + if (!$util.isString(message.bootstrapServer)) + return "bootstrapServer: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.identityPoolId != null && message.hasOwnProperty("identityPoolId")) + if (!$util.isString(message.identityPoolId)) + return "identityPoolId: string expected"; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + if (!$util.isString(message.gcpServiceAccount)) + return "gcpServiceAccount: string expected"; + return null; + }; + + /** + * Creates a ConfluentCloud message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud} ConfluentCloud + */ + ConfluentCloud.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CONFLUENT_CLOUD_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "UNREACHABLE_BOOTSTRAP_SERVER": + case 4: + message.state = 4; + break; + case "CLUSTER_NOT_FOUND": + case 5: + message.state = 5; + break; + case "TOPIC_NOT_FOUND": + case 6: + message.state = 6; + break; + } + if (object.bootstrapServer != null) + message.bootstrapServer = String(object.bootstrapServer); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.topic != null) + message.topic = String(object.topic); + if (object.identityPoolId != null) + message.identityPoolId = String(object.identityPoolId); + if (object.gcpServiceAccount != null) + message.gcpServiceAccount = String(object.gcpServiceAccount); + return message; + }; + + /** + * Creates a plain object from a ConfluentCloud message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud} message ConfluentCloud + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfluentCloud.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.bootstrapServer = ""; + object.clusterId = ""; + object.topic = ""; + object.identityPoolId = ""; + object.gcpServiceAccount = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State[message.state] : message.state; + if (message.bootstrapServer != null && message.hasOwnProperty("bootstrapServer")) + object.bootstrapServer = message.bootstrapServer; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.identityPoolId != null && message.hasOwnProperty("identityPoolId")) + object.identityPoolId = message.identityPoolId; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + object.gcpServiceAccount = message.gcpServiceAccount; + return object; + }; + + /** + * Converts this ConfluentCloud to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @instance + * @returns {Object.} JSON object + */ + ConfluentCloud.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfluentCloud + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfluentCloud.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CONFLUENT_CLOUD_PERMISSION_DENIED=2 CONFLUENT_CLOUD_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} UNREACHABLE_BOOTSTRAP_SERVER=4 UNREACHABLE_BOOTSTRAP_SERVER value + * @property {number} CLUSTER_NOT_FOUND=5 CLUSTER_NOT_FOUND value + * @property {number} TOPIC_NOT_FOUND=6 TOPIC_NOT_FOUND value + */ + ConfluentCloud.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CONFLUENT_CLOUD_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "UNREACHABLE_BOOTSTRAP_SERVER"] = 4; + values[valuesById[5] = "CLUSTER_NOT_FOUND"] = 5; + values[valuesById[6] = "TOPIC_NOT_FOUND"] = 6; + return values; + })(); + + return ConfluentCloud; + })(); + + return IngestionDataSourceSettings; + })(); + + v1.PlatformLogsSettings = (function() { + + /** + * Properties of a PlatformLogsSettings. + * @memberof google.pubsub.v1 + * @interface IPlatformLogsSettings + * @property {google.pubsub.v1.PlatformLogsSettings.Severity|null} [severity] PlatformLogsSettings severity + */ + + /** + * Constructs a new PlatformLogsSettings. + * @memberof google.pubsub.v1 + * @classdesc Represents a PlatformLogsSettings. + * @implements IPlatformLogsSettings + * @constructor + * @param {google.pubsub.v1.IPlatformLogsSettings=} [properties] Properties to set + */ + function PlatformLogsSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlatformLogsSettings severity. + * @member {google.pubsub.v1.PlatformLogsSettings.Severity} severity + * @memberof google.pubsub.v1.PlatformLogsSettings + * @instance + */ + PlatformLogsSettings.prototype.severity = 0; + + /** + * Creates a new PlatformLogsSettings instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {google.pubsub.v1.IPlatformLogsSettings=} [properties] Properties to set + * @returns {google.pubsub.v1.PlatformLogsSettings} PlatformLogsSettings instance + */ + PlatformLogsSettings.create = function create(properties) { + return new PlatformLogsSettings(properties); + }; + + /** + * Encodes the specified PlatformLogsSettings message. Does not implicitly {@link google.pubsub.v1.PlatformLogsSettings.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {google.pubsub.v1.IPlatformLogsSettings} message PlatformLogsSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlatformLogsSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); + return writer; + }; + + /** + * Encodes the specified PlatformLogsSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.PlatformLogsSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {google.pubsub.v1.IPlatformLogsSettings} message PlatformLogsSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlatformLogsSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlatformLogsSettings message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PlatformLogsSettings} PlatformLogsSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlatformLogsSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PlatformLogsSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.severity = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlatformLogsSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PlatformLogsSettings} PlatformLogsSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlatformLogsSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlatformLogsSettings message. + * @function verify + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlatformLogsSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a PlatformLogsSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PlatformLogsSettings} PlatformLogsSettings + */ + PlatformLogsSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PlatformLogsSettings) + return object; + var message = new $root.google.pubsub.v1.PlatformLogsSettings(); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "DISABLED": + case 1: + message.severity = 1; + break; + case "DEBUG": + case 2: + message.severity = 2; + break; + case "INFO": + case 3: + message.severity = 3; + break; + case "WARNING": + case 4: + message.severity = 4; + break; + case "ERROR": + case 5: + message.severity = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a PlatformLogsSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {google.pubsub.v1.PlatformLogsSettings} message PlatformLogsSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlatformLogsSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.pubsub.v1.PlatformLogsSettings.Severity[message.severity] === undefined ? message.severity : $root.google.pubsub.v1.PlatformLogsSettings.Severity[message.severity] : message.severity; + return object; + }; + + /** + * Converts this PlatformLogsSettings to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PlatformLogsSettings + * @instance + * @returns {Object.} JSON object + */ + PlatformLogsSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlatformLogsSettings + * @function getTypeUrl + * @memberof google.pubsub.v1.PlatformLogsSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlatformLogsSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PlatformLogsSettings"; + }; + + /** + * Severity enum. + * @name google.pubsub.v1.PlatformLogsSettings.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} DEBUG=2 DEBUG value + * @property {number} INFO=3 INFO value + * @property {number} WARNING=4 WARNING value + * @property {number} ERROR=5 ERROR value + */ + PlatformLogsSettings.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "DEBUG"] = 2; + values[valuesById[3] = "INFO"] = 3; + values[valuesById[4] = "WARNING"] = 4; + values[valuesById[5] = "ERROR"] = 5; + return values; + })(); + + return PlatformLogsSettings; + })(); + + v1.IngestionFailureEvent = (function() { + + /** + * Properties of an IngestionFailureEvent. + * @memberof google.pubsub.v1 + * @interface IIngestionFailureEvent + * @property {string|null} [topic] IngestionFailureEvent topic + * @property {string|null} [errorMessage] IngestionFailureEvent errorMessage + * @property {google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure|null} [cloudStorageFailure] IngestionFailureEvent cloudStorageFailure + * @property {google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason|null} [awsMskFailure] IngestionFailureEvent awsMskFailure + * @property {google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason|null} [azureEventHubsFailure] IngestionFailureEvent azureEventHubsFailure + * @property {google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason|null} [confluentCloudFailure] IngestionFailureEvent confluentCloudFailure + * @property {google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason|null} [awsKinesisFailure] IngestionFailureEvent awsKinesisFailure + */ + + /** + * Constructs a new IngestionFailureEvent. + * @memberof google.pubsub.v1 + * @classdesc Represents an IngestionFailureEvent. + * @implements IIngestionFailureEvent + * @constructor + * @param {google.pubsub.v1.IIngestionFailureEvent=} [properties] Properties to set + */ + function IngestionFailureEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestionFailureEvent topic. + * @member {string} topic + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.topic = ""; + + /** + * IngestionFailureEvent errorMessage. + * @member {string} errorMessage + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.errorMessage = ""; + + /** + * IngestionFailureEvent cloudStorageFailure. + * @member {google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure|null|undefined} cloudStorageFailure + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.cloudStorageFailure = null; + + /** + * IngestionFailureEvent awsMskFailure. + * @member {google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason|null|undefined} awsMskFailure + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.awsMskFailure = null; + + /** + * IngestionFailureEvent azureEventHubsFailure. + * @member {google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason|null|undefined} azureEventHubsFailure + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.azureEventHubsFailure = null; + + /** + * IngestionFailureEvent confluentCloudFailure. + * @member {google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason|null|undefined} confluentCloudFailure + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.confluentCloudFailure = null; + + /** + * IngestionFailureEvent awsKinesisFailure. + * @member {google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason|null|undefined} awsKinesisFailure + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + IngestionFailureEvent.prototype.awsKinesisFailure = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngestionFailureEvent failure. + * @member {"cloudStorageFailure"|"awsMskFailure"|"azureEventHubsFailure"|"confluentCloudFailure"|"awsKinesisFailure"|undefined} failure + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + */ + Object.defineProperty(IngestionFailureEvent.prototype, "failure", { + get: $util.oneOfGetter($oneOfFields = ["cloudStorageFailure", "awsMskFailure", "azureEventHubsFailure", "confluentCloudFailure", "awsKinesisFailure"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngestionFailureEvent instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {google.pubsub.v1.IIngestionFailureEvent=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent} IngestionFailureEvent instance + */ + IngestionFailureEvent.create = function create(properties) { + return new IngestionFailureEvent(properties); + }; + + /** + * Encodes the specified IngestionFailureEvent message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {google.pubsub.v1.IIngestionFailureEvent} message IngestionFailureEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionFailureEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + if (message.cloudStorageFailure != null && Object.hasOwnProperty.call(message, "cloudStorageFailure")) + $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.encode(message.cloudStorageFailure, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.awsMskFailure != null && Object.hasOwnProperty.call(message, "awsMskFailure")) + $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.encode(message.awsMskFailure, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.azureEventHubsFailure != null && Object.hasOwnProperty.call(message, "azureEventHubsFailure")) + $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.encode(message.azureEventHubsFailure, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.confluentCloudFailure != null && Object.hasOwnProperty.call(message, "confluentCloudFailure")) + $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.encode(message.confluentCloudFailure, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.awsKinesisFailure != null && Object.hasOwnProperty.call(message, "awsKinesisFailure")) + $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.encode(message.awsKinesisFailure, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestionFailureEvent message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {google.pubsub.v1.IIngestionFailureEvent} message IngestionFailureEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionFailureEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestionFailureEvent message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent} IngestionFailureEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionFailureEvent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + case 3: { + message.cloudStorageFailure = $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.decode(reader, reader.uint32()); + break; + } + case 4: { + message.awsMskFailure = $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.decode(reader, reader.uint32()); + break; + } + case 5: { + message.azureEventHubsFailure = $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.decode(reader, reader.uint32()); + break; + } + case 6: { + message.confluentCloudFailure = $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.decode(reader, reader.uint32()); + break; + } + case 7: { + message.awsKinesisFailure = $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestionFailureEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent} IngestionFailureEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionFailureEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestionFailureEvent message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestionFailureEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.cloudStorageFailure != null && message.hasOwnProperty("cloudStorageFailure")) { + properties.failure = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.verify(message.cloudStorageFailure); + if (error) + return "cloudStorageFailure." + error; + } + } + if (message.awsMskFailure != null && message.hasOwnProperty("awsMskFailure")) { + if (properties.failure === 1) + return "failure: multiple values"; + properties.failure = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.verify(message.awsMskFailure); + if (error) + return "awsMskFailure." + error; + } + } + if (message.azureEventHubsFailure != null && message.hasOwnProperty("azureEventHubsFailure")) { + if (properties.failure === 1) + return "failure: multiple values"; + properties.failure = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.verify(message.azureEventHubsFailure); + if (error) + return "azureEventHubsFailure." + error; + } + } + if (message.confluentCloudFailure != null && message.hasOwnProperty("confluentCloudFailure")) { + if (properties.failure === 1) + return "failure: multiple values"; + properties.failure = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.verify(message.confluentCloudFailure); + if (error) + return "confluentCloudFailure." + error; + } + } + if (message.awsKinesisFailure != null && message.hasOwnProperty("awsKinesisFailure")) { + if (properties.failure === 1) + return "failure: multiple values"; + properties.failure = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.verify(message.awsKinesisFailure); + if (error) + return "awsKinesisFailure." + error; + } + } + return null; + }; + + /** + * Creates an IngestionFailureEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent} IngestionFailureEvent + */ + IngestionFailureEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent) + return object; + var message = new $root.google.pubsub.v1.IngestionFailureEvent(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.cloudStorageFailure != null) { + if (typeof object.cloudStorageFailure !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.cloudStorageFailure: object expected"); + message.cloudStorageFailure = $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.fromObject(object.cloudStorageFailure); + } + if (object.awsMskFailure != null) { + if (typeof object.awsMskFailure !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.awsMskFailure: object expected"); + message.awsMskFailure = $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.fromObject(object.awsMskFailure); + } + if (object.azureEventHubsFailure != null) { + if (typeof object.azureEventHubsFailure !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.azureEventHubsFailure: object expected"); + message.azureEventHubsFailure = $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.fromObject(object.azureEventHubsFailure); + } + if (object.confluentCloudFailure != null) { + if (typeof object.confluentCloudFailure !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.confluentCloudFailure: object expected"); + message.confluentCloudFailure = $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.fromObject(object.confluentCloudFailure); + } + if (object.awsKinesisFailure != null) { + if (typeof object.awsKinesisFailure !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.awsKinesisFailure: object expected"); + message.awsKinesisFailure = $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.fromObject(object.awsKinesisFailure); + } + return message; + }; + + /** + * Creates a plain object from an IngestionFailureEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {google.pubsub.v1.IngestionFailureEvent} message IngestionFailureEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestionFailureEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.errorMessage = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.cloudStorageFailure != null && message.hasOwnProperty("cloudStorageFailure")) { + object.cloudStorageFailure = $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.toObject(message.cloudStorageFailure, options); + if (options.oneofs) + object.failure = "cloudStorageFailure"; + } + if (message.awsMskFailure != null && message.hasOwnProperty("awsMskFailure")) { + object.awsMskFailure = $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.toObject(message.awsMskFailure, options); + if (options.oneofs) + object.failure = "awsMskFailure"; + } + if (message.azureEventHubsFailure != null && message.hasOwnProperty("azureEventHubsFailure")) { + object.azureEventHubsFailure = $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.toObject(message.azureEventHubsFailure, options); + if (options.oneofs) + object.failure = "azureEventHubsFailure"; + } + if (message.confluentCloudFailure != null && message.hasOwnProperty("confluentCloudFailure")) { + object.confluentCloudFailure = $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.toObject(message.confluentCloudFailure, options); + if (options.oneofs) + object.failure = "confluentCloudFailure"; + } + if (message.awsKinesisFailure != null && message.hasOwnProperty("awsKinesisFailure")) { + object.awsKinesisFailure = $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.toObject(message.awsKinesisFailure, options); + if (options.oneofs) + object.failure = "awsKinesisFailure"; + } + return object; + }; + + /** + * Converts this IngestionFailureEvent to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent + * @instance + * @returns {Object.} JSON object + */ + IngestionFailureEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestionFailureEvent + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestionFailureEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent"; + }; + + IngestionFailureEvent.ApiViolationReason = (function() { + + /** + * Properties of an ApiViolationReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IApiViolationReason + */ + + /** + * Constructs a new ApiViolationReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents an ApiViolationReason. + * @implements IApiViolationReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason=} [properties] Properties to set + */ + function ApiViolationReason(properties) { + if (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 ApiViolationReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.ApiViolationReason} ApiViolationReason instance + */ + ApiViolationReason.create = function create(properties) { + return new ApiViolationReason(properties); + }; + + /** + * Encodes the specified ApiViolationReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason} message ApiViolationReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiViolationReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ApiViolationReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason} message ApiViolationReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiViolationReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiViolationReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.ApiViolationReason} ApiViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiViolationReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiViolationReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.ApiViolationReason} ApiViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiViolationReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiViolationReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiViolationReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ApiViolationReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.ApiViolationReason} ApiViolationReason + */ + ApiViolationReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) + return object; + return new $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason(); + }; + + /** + * Creates a plain object from an ApiViolationReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ApiViolationReason} message ApiViolationReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiViolationReason.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ApiViolationReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @instance + * @returns {Object.} JSON object + */ + ApiViolationReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiViolationReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiViolationReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.ApiViolationReason"; + }; + + return ApiViolationReason; + })(); + + IngestionFailureEvent.AvroFailureReason = (function() { + + /** + * Properties of an AvroFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IAvroFailureReason + */ + + /** + * Constructs a new AvroFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents an AvroFailureReason. + * @implements IAvroFailureReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason=} [properties] Properties to set + */ + function AvroFailureReason(properties) { + if (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 AvroFailureReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.AvroFailureReason} AvroFailureReason instance + */ + AvroFailureReason.create = function create(properties) { + return new AvroFailureReason(properties); + }; + + /** + * Encodes the specified AvroFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason} message AvroFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroFailureReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AvroFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason} message AvroFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroFailureReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroFailureReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.AvroFailureReason} AvroFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroFailureReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroFailureReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.AvroFailureReason} AvroFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroFailureReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroFailureReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroFailureReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AvroFailureReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.AvroFailureReason} AvroFailureReason + */ + AvroFailureReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) + return object; + return new $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason(); + }; + + /** + * Creates a plain object from an AvroFailureReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.AvroFailureReason} message AvroFailureReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroFailureReason.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AvroFailureReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @instance + * @returns {Object.} JSON object + */ + AvroFailureReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvroFailureReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroFailureReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.AvroFailureReason"; + }; + + return AvroFailureReason; + })(); + + IngestionFailureEvent.SchemaViolationReason = (function() { + + /** + * Properties of a SchemaViolationReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface ISchemaViolationReason + */ + + /** + * Constructs a new SchemaViolationReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents a SchemaViolationReason. + * @implements ISchemaViolationReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason=} [properties] Properties to set + */ + function SchemaViolationReason(properties) { + if (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 SchemaViolationReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason} SchemaViolationReason instance + */ + SchemaViolationReason.create = function create(properties) { + return new SchemaViolationReason(properties); + }; + + /** + * Encodes the specified SchemaViolationReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason} message SchemaViolationReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaViolationReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SchemaViolationReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason} message SchemaViolationReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaViolationReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaViolationReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason} SchemaViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaViolationReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaViolationReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason} SchemaViolationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaViolationReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaViolationReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaViolationReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SchemaViolationReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason} SchemaViolationReason + */ + SchemaViolationReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) + return object; + return new $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason(); + }; + + /** + * Creates a plain object from a SchemaViolationReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason} message SchemaViolationReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaViolationReason.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SchemaViolationReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @instance + * @returns {Object.} JSON object + */ + SchemaViolationReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaViolationReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaViolationReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason"; + }; + + return SchemaViolationReason; + })(); + + IngestionFailureEvent.MessageTransformationFailureReason = (function() { + + /** + * Properties of a MessageTransformationFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IMessageTransformationFailureReason + */ + + /** + * Constructs a new MessageTransformationFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents a MessageTransformationFailureReason. + * @implements IMessageTransformationFailureReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason=} [properties] Properties to set + */ + function MessageTransformationFailureReason(properties) { + if (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 MessageTransformationFailureReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason} MessageTransformationFailureReason instance + */ + MessageTransformationFailureReason.create = function create(properties) { + return new MessageTransformationFailureReason(properties); + }; + + /** + * Encodes the specified MessageTransformationFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason} message MessageTransformationFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageTransformationFailureReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MessageTransformationFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason} message MessageTransformationFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageTransformationFailureReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageTransformationFailureReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason} MessageTransformationFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageTransformationFailureReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageTransformationFailureReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason} MessageTransformationFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageTransformationFailureReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageTransformationFailureReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageTransformationFailureReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MessageTransformationFailureReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason} MessageTransformationFailureReason + */ + MessageTransformationFailureReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason) + return object; + return new $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason(); + }; + + /** + * Creates a plain object from a MessageTransformationFailureReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason} message MessageTransformationFailureReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageTransformationFailureReason.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MessageTransformationFailureReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @instance + * @returns {Object.} JSON object + */ + MessageTransformationFailureReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageTransformationFailureReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageTransformationFailureReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason"; + }; + + return MessageTransformationFailureReason; + })(); + + IngestionFailureEvent.CloudStorageFailure = (function() { + + /** + * Properties of a CloudStorageFailure. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface ICloudStorageFailure + * @property {string|null} [bucket] CloudStorageFailure bucket + * @property {string|null} [objectName] CloudStorageFailure objectName + * @property {number|Long|null} [objectGeneration] CloudStorageFailure objectGeneration + * @property {google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason|null} [avroFailureReason] CloudStorageFailure avroFailureReason + * @property {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null} [apiViolationReason] CloudStorageFailure apiViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null} [schemaViolationReason] CloudStorageFailure schemaViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null} [messageTransformationFailureReason] CloudStorageFailure messageTransformationFailureReason + */ + + /** + * Constructs a new CloudStorageFailure. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents a CloudStorageFailure. + * @implements ICloudStorageFailure + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure=} [properties] Properties to set + */ + function CloudStorageFailure(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageFailure bucket. + * @member {string} bucket + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.bucket = ""; + + /** + * CloudStorageFailure objectName. + * @member {string} objectName + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.objectName = ""; + + /** + * CloudStorageFailure objectGeneration. + * @member {number|Long} objectGeneration + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.objectGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudStorageFailure avroFailureReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IAvroFailureReason|null|undefined} avroFailureReason + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.avroFailureReason = null; + + /** + * CloudStorageFailure apiViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null|undefined} apiViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.apiViolationReason = null; + + /** + * CloudStorageFailure schemaViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null|undefined} schemaViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.schemaViolationReason = null; + + /** + * CloudStorageFailure messageTransformationFailureReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null|undefined} messageTransformationFailureReason + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + CloudStorageFailure.prototype.messageTransformationFailureReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudStorageFailure reason. + * @member {"avroFailureReason"|"apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"|undefined} reason + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + */ + Object.defineProperty(CloudStorageFailure.prototype, "reason", { + get: $util.oneOfGetter($oneOfFields = ["avroFailureReason", "apiViolationReason", "schemaViolationReason", "messageTransformationFailureReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudStorageFailure instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure} CloudStorageFailure instance + */ + CloudStorageFailure.create = function create(properties) { + return new CloudStorageFailure(properties); + }; + + /** + * Encodes the specified CloudStorageFailure message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure} message CloudStorageFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageFailure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.objectName != null && Object.hasOwnProperty.call(message, "objectName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.objectName); + if (message.objectGeneration != null && Object.hasOwnProperty.call(message, "objectGeneration")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.objectGeneration); + if (message.avroFailureReason != null && Object.hasOwnProperty.call(message, "avroFailureReason")) + $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.encode(message.avroFailureReason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.apiViolationReason != null && Object.hasOwnProperty.call(message, "apiViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.encode(message.apiViolationReason, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.schemaViolationReason != null && Object.hasOwnProperty.call(message, "schemaViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.encode(message.schemaViolationReason, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.messageTransformationFailureReason != null && Object.hasOwnProperty.call(message, "messageTransformationFailureReason")) + $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.encode(message.messageTransformationFailureReason, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudStorageFailure message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ICloudStorageFailure} message CloudStorageFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageFailure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageFailure message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure} CloudStorageFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageFailure.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.objectName = reader.string(); + break; + } + case 3: { + message.objectGeneration = reader.int64(); + break; + } + case 5: { + message.avroFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.decode(reader, reader.uint32()); + break; + } + case 6: { + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.decode(reader, reader.uint32()); + break; + } + case 7: { + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.decode(reader, reader.uint32()); + break; + } + case 8: { + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageFailure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure} CloudStorageFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageFailure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageFailure message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageFailure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.objectName != null && message.hasOwnProperty("objectName")) + if (!$util.isString(message.objectName)) + return "objectName: string expected"; + if (message.objectGeneration != null && message.hasOwnProperty("objectGeneration")) + if (!$util.isInteger(message.objectGeneration) && !(message.objectGeneration && $util.isInteger(message.objectGeneration.low) && $util.isInteger(message.objectGeneration.high))) + return "objectGeneration: integer|Long expected"; + if (message.avroFailureReason != null && message.hasOwnProperty("avroFailureReason")) { + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.verify(message.avroFailureReason); + if (error) + return "avroFailureReason." + error; + } + } + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify(message.apiViolationReason); + if (error) + return "apiViolationReason." + error; + } + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify(message.schemaViolationReason); + if (error) + return "schemaViolationReason." + error; + } + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify(message.messageTransformationFailureReason); + if (error) + return "messageTransformationFailureReason." + error; + } + } + return null; + }; + + /** + * Creates a CloudStorageFailure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure} CloudStorageFailure + */ + CloudStorageFailure.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) + return object; + var message = new $root.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.objectName != null) + message.objectName = String(object.objectName); + if (object.objectGeneration != null) + if ($util.Long) + (message.objectGeneration = $util.Long.fromValue(object.objectGeneration)).unsigned = false; + else if (typeof object.objectGeneration === "string") + message.objectGeneration = parseInt(object.objectGeneration, 10); + else if (typeof object.objectGeneration === "number") + message.objectGeneration = object.objectGeneration; + else if (typeof object.objectGeneration === "object") + message.objectGeneration = new $util.LongBits(object.objectGeneration.low >>> 0, object.objectGeneration.high >>> 0).toNumber(); + if (object.avroFailureReason != null) { + if (typeof object.avroFailureReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.avroFailureReason: object expected"); + message.avroFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.fromObject(object.avroFailureReason); + } + if (object.apiViolationReason != null) { + if (typeof object.apiViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.apiViolationReason: object expected"); + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.fromObject(object.apiViolationReason); + } + if (object.schemaViolationReason != null) { + if (typeof object.schemaViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.schemaViolationReason: object expected"); + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.fromObject(object.schemaViolationReason); + } + if (object.messageTransformationFailureReason != null) { + if (typeof object.messageTransformationFailureReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.messageTransformationFailureReason: object expected"); + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.fromObject(object.messageTransformationFailureReason); + } + return message; + }; + + /** + * Creates a plain object from a CloudStorageFailure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure} message CloudStorageFailure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageFailure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.objectName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectGeneration = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.objectName != null && message.hasOwnProperty("objectName")) + object.objectName = message.objectName; + if (message.objectGeneration != null && message.hasOwnProperty("objectGeneration")) + if (typeof message.objectGeneration === "number") + object.objectGeneration = options.longs === String ? String(message.objectGeneration) : message.objectGeneration; + else + object.objectGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.objectGeneration) : options.longs === Number ? new $util.LongBits(message.objectGeneration.low >>> 0, message.objectGeneration.high >>> 0).toNumber() : message.objectGeneration; + if (message.avroFailureReason != null && message.hasOwnProperty("avroFailureReason")) { + object.avroFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.toObject(message.avroFailureReason, options); + if (options.oneofs) + object.reason = "avroFailureReason"; + } + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + object.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.toObject(message.apiViolationReason, options); + if (options.oneofs) + object.reason = "apiViolationReason"; + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + object.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.toObject(message.schemaViolationReason, options); + if (options.oneofs) + object.reason = "schemaViolationReason"; + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + object.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.toObject(message.messageTransformationFailureReason, options); + if (options.oneofs) + object.reason = "messageTransformationFailureReason"; + } + return object; + }; + + /** + * Converts this CloudStorageFailure to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @instance + * @returns {Object.} JSON object + */ + CloudStorageFailure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageFailure + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageFailure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure"; + }; + + return CloudStorageFailure; + })(); + + IngestionFailureEvent.AwsMskFailureReason = (function() { + + /** + * Properties of an AwsMskFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IAwsMskFailureReason + * @property {string|null} [clusterArn] AwsMskFailureReason clusterArn + * @property {string|null} [kafkaTopic] AwsMskFailureReason kafkaTopic + * @property {number|Long|null} [partitionId] AwsMskFailureReason partitionId + * @property {number|Long|null} [offset] AwsMskFailureReason offset + * @property {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null} [apiViolationReason] AwsMskFailureReason apiViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null} [schemaViolationReason] AwsMskFailureReason schemaViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null} [messageTransformationFailureReason] AwsMskFailureReason messageTransformationFailureReason + */ + + /** + * Constructs a new AwsMskFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents an AwsMskFailureReason. + * @implements IAwsMskFailureReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason=} [properties] Properties to set + */ + function AwsMskFailureReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsMskFailureReason clusterArn. + * @member {string} clusterArn + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.clusterArn = ""; + + /** + * AwsMskFailureReason kafkaTopic. + * @member {string} kafkaTopic + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.kafkaTopic = ""; + + /** + * AwsMskFailureReason partitionId. + * @member {number|Long} partitionId + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.partitionId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AwsMskFailureReason offset. + * @member {number|Long} offset + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AwsMskFailureReason apiViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null|undefined} apiViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.apiViolationReason = null; + + /** + * AwsMskFailureReason schemaViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null|undefined} schemaViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.schemaViolationReason = null; + + /** + * AwsMskFailureReason messageTransformationFailureReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null|undefined} messageTransformationFailureReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + AwsMskFailureReason.prototype.messageTransformationFailureReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AwsMskFailureReason reason. + * @member {"apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"|undefined} reason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + */ + Object.defineProperty(AwsMskFailureReason.prototype, "reason", { + get: $util.oneOfGetter($oneOfFields = ["apiViolationReason", "schemaViolationReason", "messageTransformationFailureReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AwsMskFailureReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason} AwsMskFailureReason instance + */ + AwsMskFailureReason.create = function create(properties) { + return new AwsMskFailureReason(properties); + }; + + /** + * Encodes the specified AwsMskFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason} message AwsMskFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMskFailureReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterArn != null && Object.hasOwnProperty.call(message, "clusterArn")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterArn); + if (message.kafkaTopic != null && Object.hasOwnProperty.call(message, "kafkaTopic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kafkaTopic); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.partitionId); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.offset); + if (message.apiViolationReason != null && Object.hasOwnProperty.call(message, "apiViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.encode(message.apiViolationReason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.schemaViolationReason != null && Object.hasOwnProperty.call(message, "schemaViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.encode(message.schemaViolationReason, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messageTransformationFailureReason != null && Object.hasOwnProperty.call(message, "messageTransformationFailureReason")) + $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.encode(message.messageTransformationFailureReason, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AwsMskFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsMskFailureReason} message AwsMskFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsMskFailureReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsMskFailureReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason} AwsMskFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMskFailureReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterArn = reader.string(); + break; + } + case 2: { + message.kafkaTopic = reader.string(); + break; + } + case 3: { + message.partitionId = reader.int64(); + break; + } + case 4: { + message.offset = reader.int64(); + break; + } + case 5: { + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.decode(reader, reader.uint32()); + break; + } + case 6: { + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.decode(reader, reader.uint32()); + break; + } + case 7: { + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsMskFailureReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason} AwsMskFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsMskFailureReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsMskFailureReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsMskFailureReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clusterArn != null && message.hasOwnProperty("clusterArn")) + if (!$util.isString(message.clusterArn)) + return "clusterArn: string expected"; + if (message.kafkaTopic != null && message.hasOwnProperty("kafkaTopic")) + if (!$util.isString(message.kafkaTopic)) + return "kafkaTopic: string expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + if (!$util.isInteger(message.partitionId) && !(message.partitionId && $util.isInteger(message.partitionId.low) && $util.isInteger(message.partitionId.high))) + return "partitionId: integer|Long expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify(message.apiViolationReason); + if (error) + return "apiViolationReason." + error; + } + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify(message.schemaViolationReason); + if (error) + return "schemaViolationReason." + error; + } + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify(message.messageTransformationFailureReason); + if (error) + return "messageTransformationFailureReason." + error; + } + } + return null; + }; + + /** + * Creates an AwsMskFailureReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason} AwsMskFailureReason + */ + AwsMskFailureReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) + return object; + var message = new $root.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason(); + if (object.clusterArn != null) + message.clusterArn = String(object.clusterArn); + if (object.kafkaTopic != null) + message.kafkaTopic = String(object.kafkaTopic); + if (object.partitionId != null) + if ($util.Long) + (message.partitionId = $util.Long.fromValue(object.partitionId)).unsigned = false; + else if (typeof object.partitionId === "string") + message.partitionId = parseInt(object.partitionId, 10); + else if (typeof object.partitionId === "number") + message.partitionId = object.partitionId; + else if (typeof object.partitionId === "object") + message.partitionId = new $util.LongBits(object.partitionId.low >>> 0, object.partitionId.high >>> 0).toNumber(); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + if (object.apiViolationReason != null) { + if (typeof object.apiViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.apiViolationReason: object expected"); + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.fromObject(object.apiViolationReason); + } + if (object.schemaViolationReason != null) { + if (typeof object.schemaViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.schemaViolationReason: object expected"); + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.fromObject(object.schemaViolationReason); + } + if (object.messageTransformationFailureReason != null) { + if (typeof object.messageTransformationFailureReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.messageTransformationFailureReason: object expected"); + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.fromObject(object.messageTransformationFailureReason); + } + return message; + }; + + /** + * Creates a plain object from an AwsMskFailureReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason} message AwsMskFailureReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsMskFailureReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clusterArn = ""; + object.kafkaTopic = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.partitionId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + } + if (message.clusterArn != null && message.hasOwnProperty("clusterArn")) + object.clusterArn = message.clusterArn; + if (message.kafkaTopic != null && message.hasOwnProperty("kafkaTopic")) + object.kafkaTopic = message.kafkaTopic; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + if (typeof message.partitionId === "number") + object.partitionId = options.longs === String ? String(message.partitionId) : message.partitionId; + else + object.partitionId = options.longs === String ? $util.Long.prototype.toString.call(message.partitionId) : options.longs === Number ? new $util.LongBits(message.partitionId.low >>> 0, message.partitionId.high >>> 0).toNumber() : message.partitionId; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + object.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.toObject(message.apiViolationReason, options); + if (options.oneofs) + object.reason = "apiViolationReason"; + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + object.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.toObject(message.schemaViolationReason, options); + if (options.oneofs) + object.reason = "schemaViolationReason"; + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + object.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.toObject(message.messageTransformationFailureReason, options); + if (options.oneofs) + object.reason = "messageTransformationFailureReason"; + } + return object; + }; + + /** + * Converts this AwsMskFailureReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @instance + * @returns {Object.} JSON object + */ + AwsMskFailureReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsMskFailureReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsMskFailureReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason"; + }; + + return AwsMskFailureReason; + })(); + + IngestionFailureEvent.AzureEventHubsFailureReason = (function() { + + /** + * Properties of an AzureEventHubsFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IAzureEventHubsFailureReason + * @property {string|null} [namespace] AzureEventHubsFailureReason namespace + * @property {string|null} [eventHub] AzureEventHubsFailureReason eventHub + * @property {number|Long|null} [partitionId] AzureEventHubsFailureReason partitionId + * @property {number|Long|null} [offset] AzureEventHubsFailureReason offset + * @property {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null} [apiViolationReason] AzureEventHubsFailureReason apiViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null} [schemaViolationReason] AzureEventHubsFailureReason schemaViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null} [messageTransformationFailureReason] AzureEventHubsFailureReason messageTransformationFailureReason + */ + + /** + * Constructs a new AzureEventHubsFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents an AzureEventHubsFailureReason. + * @implements IAzureEventHubsFailureReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason=} [properties] Properties to set + */ + function AzureEventHubsFailureReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureEventHubsFailureReason namespace. + * @member {string} namespace + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.namespace = ""; + + /** + * AzureEventHubsFailureReason eventHub. + * @member {string} eventHub + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.eventHub = ""; + + /** + * AzureEventHubsFailureReason partitionId. + * @member {number|Long} partitionId + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.partitionId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AzureEventHubsFailureReason offset. + * @member {number|Long} offset + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AzureEventHubsFailureReason apiViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null|undefined} apiViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.apiViolationReason = null; + + /** + * AzureEventHubsFailureReason schemaViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null|undefined} schemaViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.schemaViolationReason = null; + + /** + * AzureEventHubsFailureReason messageTransformationFailureReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null|undefined} messageTransformationFailureReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + AzureEventHubsFailureReason.prototype.messageTransformationFailureReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AzureEventHubsFailureReason reason. + * @member {"apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"|undefined} reason + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + */ + Object.defineProperty(AzureEventHubsFailureReason.prototype, "reason", { + get: $util.oneOfGetter($oneOfFields = ["apiViolationReason", "schemaViolationReason", "messageTransformationFailureReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AzureEventHubsFailureReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason} AzureEventHubsFailureReason instance + */ + AzureEventHubsFailureReason.create = function create(properties) { + return new AzureEventHubsFailureReason(properties); + }; + + /** + * Encodes the specified AzureEventHubsFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason} message AzureEventHubsFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureEventHubsFailureReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespace); + if (message.eventHub != null && Object.hasOwnProperty.call(message, "eventHub")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.eventHub); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.partitionId); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.offset); + if (message.apiViolationReason != null && Object.hasOwnProperty.call(message, "apiViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.encode(message.apiViolationReason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.schemaViolationReason != null && Object.hasOwnProperty.call(message, "schemaViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.encode(message.schemaViolationReason, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messageTransformationFailureReason != null && Object.hasOwnProperty.call(message, "messageTransformationFailureReason")) + $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.encode(message.messageTransformationFailureReason, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AzureEventHubsFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAzureEventHubsFailureReason} message AzureEventHubsFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureEventHubsFailureReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureEventHubsFailureReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason} AzureEventHubsFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureEventHubsFailureReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namespace = reader.string(); + break; + } + case 2: { + message.eventHub = reader.string(); + break; + } + case 3: { + message.partitionId = reader.int64(); + break; + } + case 4: { + message.offset = reader.int64(); + break; + } + case 5: { + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.decode(reader, reader.uint32()); + break; + } + case 6: { + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.decode(reader, reader.uint32()); + break; + } + case 7: { + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureEventHubsFailureReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason} AzureEventHubsFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureEventHubsFailureReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureEventHubsFailureReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureEventHubsFailureReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.eventHub != null && message.hasOwnProperty("eventHub")) + if (!$util.isString(message.eventHub)) + return "eventHub: string expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + if (!$util.isInteger(message.partitionId) && !(message.partitionId && $util.isInteger(message.partitionId.low) && $util.isInteger(message.partitionId.high))) + return "partitionId: integer|Long expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify(message.apiViolationReason); + if (error) + return "apiViolationReason." + error; + } + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify(message.schemaViolationReason); + if (error) + return "schemaViolationReason." + error; + } + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify(message.messageTransformationFailureReason); + if (error) + return "messageTransformationFailureReason." + error; + } + } + return null; + }; + + /** + * Creates an AzureEventHubsFailureReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason} AzureEventHubsFailureReason + */ + AzureEventHubsFailureReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) + return object; + var message = new $root.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason(); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.eventHub != null) + message.eventHub = String(object.eventHub); + if (object.partitionId != null) + if ($util.Long) + (message.partitionId = $util.Long.fromValue(object.partitionId)).unsigned = false; + else if (typeof object.partitionId === "string") + message.partitionId = parseInt(object.partitionId, 10); + else if (typeof object.partitionId === "number") + message.partitionId = object.partitionId; + else if (typeof object.partitionId === "object") + message.partitionId = new $util.LongBits(object.partitionId.low >>> 0, object.partitionId.high >>> 0).toNumber(); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + if (object.apiViolationReason != null) { + if (typeof object.apiViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.apiViolationReason: object expected"); + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.fromObject(object.apiViolationReason); + } + if (object.schemaViolationReason != null) { + if (typeof object.schemaViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.schemaViolationReason: object expected"); + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.fromObject(object.schemaViolationReason); + } + if (object.messageTransformationFailureReason != null) { + if (typeof object.messageTransformationFailureReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.messageTransformationFailureReason: object expected"); + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.fromObject(object.messageTransformationFailureReason); + } + return message; + }; + + /** + * Creates a plain object from an AzureEventHubsFailureReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason} message AzureEventHubsFailureReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureEventHubsFailureReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namespace = ""; + object.eventHub = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.partitionId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.eventHub != null && message.hasOwnProperty("eventHub")) + object.eventHub = message.eventHub; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + if (typeof message.partitionId === "number") + object.partitionId = options.longs === String ? String(message.partitionId) : message.partitionId; + else + object.partitionId = options.longs === String ? $util.Long.prototype.toString.call(message.partitionId) : options.longs === Number ? new $util.LongBits(message.partitionId.low >>> 0, message.partitionId.high >>> 0).toNumber() : message.partitionId; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + object.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.toObject(message.apiViolationReason, options); + if (options.oneofs) + object.reason = "apiViolationReason"; + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + object.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.toObject(message.schemaViolationReason, options); + if (options.oneofs) + object.reason = "schemaViolationReason"; + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + object.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.toObject(message.messageTransformationFailureReason, options); + if (options.oneofs) + object.reason = "messageTransformationFailureReason"; + } + return object; + }; + + /** + * Converts this AzureEventHubsFailureReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @instance + * @returns {Object.} JSON object + */ + AzureEventHubsFailureReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureEventHubsFailureReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureEventHubsFailureReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason"; + }; + + return AzureEventHubsFailureReason; + })(); + + IngestionFailureEvent.ConfluentCloudFailureReason = (function() { + + /** + * Properties of a ConfluentCloudFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IConfluentCloudFailureReason + * @property {string|null} [clusterId] ConfluentCloudFailureReason clusterId + * @property {string|null} [kafkaTopic] ConfluentCloudFailureReason kafkaTopic + * @property {number|Long|null} [partitionId] ConfluentCloudFailureReason partitionId + * @property {number|Long|null} [offset] ConfluentCloudFailureReason offset + * @property {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null} [apiViolationReason] ConfluentCloudFailureReason apiViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null} [schemaViolationReason] ConfluentCloudFailureReason schemaViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null} [messageTransformationFailureReason] ConfluentCloudFailureReason messageTransformationFailureReason + */ + + /** + * Constructs a new ConfluentCloudFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents a ConfluentCloudFailureReason. + * @implements IConfluentCloudFailureReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason=} [properties] Properties to set + */ + function ConfluentCloudFailureReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfluentCloudFailureReason clusterId. + * @member {string} clusterId + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.clusterId = ""; + + /** + * ConfluentCloudFailureReason kafkaTopic. + * @member {string} kafkaTopic + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.kafkaTopic = ""; + + /** + * ConfluentCloudFailureReason partitionId. + * @member {number|Long} partitionId + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.partitionId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfluentCloudFailureReason offset. + * @member {number|Long} offset + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfluentCloudFailureReason apiViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null|undefined} apiViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.apiViolationReason = null; + + /** + * ConfluentCloudFailureReason schemaViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null|undefined} schemaViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.schemaViolationReason = null; + + /** + * ConfluentCloudFailureReason messageTransformationFailureReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null|undefined} messageTransformationFailureReason + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + ConfluentCloudFailureReason.prototype.messageTransformationFailureReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfluentCloudFailureReason reason. + * @member {"apiViolationReason"|"schemaViolationReason"|"messageTransformationFailureReason"|undefined} reason + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + */ + Object.defineProperty(ConfluentCloudFailureReason.prototype, "reason", { + get: $util.oneOfGetter($oneOfFields = ["apiViolationReason", "schemaViolationReason", "messageTransformationFailureReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfluentCloudFailureReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason} ConfluentCloudFailureReason instance + */ + ConfluentCloudFailureReason.create = function create(properties) { + return new ConfluentCloudFailureReason(properties); + }; + + /** + * Encodes the specified ConfluentCloudFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason} message ConfluentCloudFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfluentCloudFailureReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.kafkaTopic != null && Object.hasOwnProperty.call(message, "kafkaTopic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kafkaTopic); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.partitionId); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.offset); + if (message.apiViolationReason != null && Object.hasOwnProperty.call(message, "apiViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.encode(message.apiViolationReason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.schemaViolationReason != null && Object.hasOwnProperty.call(message, "schemaViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.encode(message.schemaViolationReason, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messageTransformationFailureReason != null && Object.hasOwnProperty.call(message, "messageTransformationFailureReason")) + $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.encode(message.messageTransformationFailureReason, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfluentCloudFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IConfluentCloudFailureReason} message ConfluentCloudFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfluentCloudFailureReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfluentCloudFailureReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason} ConfluentCloudFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfluentCloudFailureReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterId = reader.string(); + break; + } + case 2: { + message.kafkaTopic = reader.string(); + break; + } + case 3: { + message.partitionId = reader.int64(); + break; + } + case 4: { + message.offset = reader.int64(); + break; + } + case 5: { + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.decode(reader, reader.uint32()); + break; + } + case 6: { + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.decode(reader, reader.uint32()); + break; + } + case 7: { + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfluentCloudFailureReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason} ConfluentCloudFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfluentCloudFailureReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfluentCloudFailureReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfluentCloudFailureReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.kafkaTopic != null && message.hasOwnProperty("kafkaTopic")) + if (!$util.isString(message.kafkaTopic)) + return "kafkaTopic: string expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + if (!$util.isInteger(message.partitionId) && !(message.partitionId && $util.isInteger(message.partitionId.low) && $util.isInteger(message.partitionId.high))) + return "partitionId: integer|Long expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify(message.apiViolationReason); + if (error) + return "apiViolationReason." + error; + } + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify(message.schemaViolationReason); + if (error) + return "schemaViolationReason." + error; + } + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify(message.messageTransformationFailureReason); + if (error) + return "messageTransformationFailureReason." + error; + } + } + return null; + }; + + /** + * Creates a ConfluentCloudFailureReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason} ConfluentCloudFailureReason + */ + ConfluentCloudFailureReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) + return object; + var message = new $root.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason(); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.kafkaTopic != null) + message.kafkaTopic = String(object.kafkaTopic); + if (object.partitionId != null) + if ($util.Long) + (message.partitionId = $util.Long.fromValue(object.partitionId)).unsigned = false; + else if (typeof object.partitionId === "string") + message.partitionId = parseInt(object.partitionId, 10); + else if (typeof object.partitionId === "number") + message.partitionId = object.partitionId; + else if (typeof object.partitionId === "object") + message.partitionId = new $util.LongBits(object.partitionId.low >>> 0, object.partitionId.high >>> 0).toNumber(); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + if (object.apiViolationReason != null) { + if (typeof object.apiViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.apiViolationReason: object expected"); + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.fromObject(object.apiViolationReason); + } + if (object.schemaViolationReason != null) { + if (typeof object.schemaViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.schemaViolationReason: object expected"); + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.fromObject(object.schemaViolationReason); + } + if (object.messageTransformationFailureReason != null) { + if (typeof object.messageTransformationFailureReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.messageTransformationFailureReason: object expected"); + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.fromObject(object.messageTransformationFailureReason); + } + return message; + }; + + /** + * Creates a plain object from a ConfluentCloudFailureReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason} message ConfluentCloudFailureReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfluentCloudFailureReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clusterId = ""; + object.kafkaTopic = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.partitionId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.partitionId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.kafkaTopic != null && message.hasOwnProperty("kafkaTopic")) + object.kafkaTopic = message.kafkaTopic; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + if (typeof message.partitionId === "number") + object.partitionId = options.longs === String ? String(message.partitionId) : message.partitionId; + else + object.partitionId = options.longs === String ? $util.Long.prototype.toString.call(message.partitionId) : options.longs === Number ? new $util.LongBits(message.partitionId.low >>> 0, message.partitionId.high >>> 0).toNumber() : message.partitionId; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + object.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.toObject(message.apiViolationReason, options); + if (options.oneofs) + object.reason = "apiViolationReason"; + } + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + object.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.toObject(message.schemaViolationReason, options); + if (options.oneofs) + object.reason = "schemaViolationReason"; + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + object.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.toObject(message.messageTransformationFailureReason, options); + if (options.oneofs) + object.reason = "messageTransformationFailureReason"; + } + return object; + }; + + /** + * Converts this ConfluentCloudFailureReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @instance + * @returns {Object.} JSON object + */ + ConfluentCloudFailureReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfluentCloudFailureReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfluentCloudFailureReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason"; + }; + + return ConfluentCloudFailureReason; + })(); + + IngestionFailureEvent.AwsKinesisFailureReason = (function() { + + /** + * Properties of an AwsKinesisFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @interface IAwsKinesisFailureReason + * @property {string|null} [streamArn] AwsKinesisFailureReason streamArn + * @property {string|null} [partitionKey] AwsKinesisFailureReason partitionKey + * @property {string|null} [sequenceNumber] AwsKinesisFailureReason sequenceNumber + * @property {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null} [schemaViolationReason] AwsKinesisFailureReason schemaViolationReason + * @property {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null} [messageTransformationFailureReason] AwsKinesisFailureReason messageTransformationFailureReason + * @property {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null} [apiViolationReason] AwsKinesisFailureReason apiViolationReason + */ + + /** + * Constructs a new AwsKinesisFailureReason. + * @memberof google.pubsub.v1.IngestionFailureEvent + * @classdesc Represents an AwsKinesisFailureReason. + * @implements IAwsKinesisFailureReason + * @constructor + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason=} [properties] Properties to set + */ + function AwsKinesisFailureReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsKinesisFailureReason streamArn. + * @member {string} streamArn + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + AwsKinesisFailureReason.prototype.streamArn = ""; + + /** + * AwsKinesisFailureReason partitionKey. + * @member {string} partitionKey + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + AwsKinesisFailureReason.prototype.partitionKey = ""; + + /** + * AwsKinesisFailureReason sequenceNumber. + * @member {string} sequenceNumber + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + AwsKinesisFailureReason.prototype.sequenceNumber = ""; + + /** + * AwsKinesisFailureReason schemaViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.ISchemaViolationReason|null|undefined} schemaViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + AwsKinesisFailureReason.prototype.schemaViolationReason = null; + + /** + * AwsKinesisFailureReason messageTransformationFailureReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IMessageTransformationFailureReason|null|undefined} messageTransformationFailureReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + AwsKinesisFailureReason.prototype.messageTransformationFailureReason = null; + + /** + * AwsKinesisFailureReason apiViolationReason. + * @member {google.pubsub.v1.IngestionFailureEvent.IApiViolationReason|null|undefined} apiViolationReason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + AwsKinesisFailureReason.prototype.apiViolationReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AwsKinesisFailureReason reason. + * @member {"schemaViolationReason"|"messageTransformationFailureReason"|"apiViolationReason"|undefined} reason + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + */ + Object.defineProperty(AwsKinesisFailureReason.prototype, "reason", { + get: $util.oneOfGetter($oneOfFields = ["schemaViolationReason", "messageTransformationFailureReason", "apiViolationReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AwsKinesisFailureReason instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason} AwsKinesisFailureReason instance + */ + AwsKinesisFailureReason.create = function create(properties) { + return new AwsKinesisFailureReason(properties); + }; + + /** + * Encodes the specified AwsKinesisFailureReason message. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason} message AwsKinesisFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesisFailureReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamArn != null && Object.hasOwnProperty.call(message, "streamArn")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.streamArn); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.partitionKey); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sequenceNumber); + if (message.schemaViolationReason != null && Object.hasOwnProperty.call(message, "schemaViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.encode(message.schemaViolationReason, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.messageTransformationFailureReason != null && Object.hasOwnProperty.call(message, "messageTransformationFailureReason")) + $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.encode(message.messageTransformationFailureReason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.apiViolationReason != null && Object.hasOwnProperty.call(message, "apiViolationReason")) + $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.encode(message.apiViolationReason, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AwsKinesisFailureReason message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.IAwsKinesisFailureReason} message AwsKinesisFailureReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesisFailureReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsKinesisFailureReason message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason} AwsKinesisFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesisFailureReason.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.streamArn = reader.string(); + break; + } + case 2: { + message.partitionKey = reader.string(); + break; + } + case 3: { + message.sequenceNumber = reader.string(); + break; + } + case 4: { + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.decode(reader, reader.uint32()); + break; + } + case 5: { + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.decode(reader, reader.uint32()); + break; + } + case 6: { + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsKinesisFailureReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason} AwsKinesisFailureReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesisFailureReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsKinesisFailureReason message. + * @function verify + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsKinesisFailureReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + if (!$util.isString(message.streamArn)) + return "streamArn: string expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + if (!$util.isString(message.partitionKey)) + return "partitionKey: string expected"; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isString(message.sequenceNumber)) + return "sequenceNumber: string expected"; + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.verify(message.schemaViolationReason); + if (error) + return "schemaViolationReason." + error; + } + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.verify(message.messageTransformationFailureReason); + if (error) + return "messageTransformationFailureReason." + error; + } + } + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + if (properties.reason === 1) + return "reason: multiple values"; + properties.reason = 1; + { + var error = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.verify(message.apiViolationReason); + if (error) + return "apiViolationReason." + error; + } + } + return null; + }; + + /** + * Creates an AwsKinesisFailureReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason} AwsKinesisFailureReason + */ + AwsKinesisFailureReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) + return object; + var message = new $root.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason(); + if (object.streamArn != null) + message.streamArn = String(object.streamArn); + if (object.partitionKey != null) + message.partitionKey = String(object.partitionKey); + if (object.sequenceNumber != null) + message.sequenceNumber = String(object.sequenceNumber); + if (object.schemaViolationReason != null) { + if (typeof object.schemaViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.schemaViolationReason: object expected"); + message.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.fromObject(object.schemaViolationReason); + } + if (object.messageTransformationFailureReason != null) { + if (typeof object.messageTransformationFailureReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.messageTransformationFailureReason: object expected"); + message.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.fromObject(object.messageTransformationFailureReason); + } + if (object.apiViolationReason != null) { + if (typeof object.apiViolationReason !== "object") + throw TypeError(".google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.apiViolationReason: object expected"); + message.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.fromObject(object.apiViolationReason); + } + return message; + }; + + /** + * Creates a plain object from an AwsKinesisFailureReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason} message AwsKinesisFailureReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsKinesisFailureReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.streamArn = ""; + object.partitionKey = ""; + object.sequenceNumber = ""; + } + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + object.streamArn = message.streamArn; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = message.partitionKey; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + object.sequenceNumber = message.sequenceNumber; + if (message.schemaViolationReason != null && message.hasOwnProperty("schemaViolationReason")) { + object.schemaViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.toObject(message.schemaViolationReason, options); + if (options.oneofs) + object.reason = "schemaViolationReason"; + } + if (message.messageTransformationFailureReason != null && message.hasOwnProperty("messageTransformationFailureReason")) { + object.messageTransformationFailureReason = $root.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.toObject(message.messageTransformationFailureReason, options); + if (options.oneofs) + object.reason = "messageTransformationFailureReason"; + } + if (message.apiViolationReason != null && message.hasOwnProperty("apiViolationReason")) { + object.apiViolationReason = $root.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.toObject(message.apiViolationReason, options); + if (options.oneofs) + object.reason = "apiViolationReason"; + } + return object; + }; + + /** + * Converts this AwsKinesisFailureReason to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @instance + * @returns {Object.} JSON object + */ + AwsKinesisFailureReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsKinesisFailureReason + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsKinesisFailureReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason"; + }; + + return AwsKinesisFailureReason; + })(); + + return IngestionFailureEvent; + })(); + + v1.JavaScriptUDF = (function() { + + /** + * Properties of a JavaScriptUDF. + * @memberof google.pubsub.v1 + * @interface IJavaScriptUDF + * @property {string|null} [functionName] JavaScriptUDF functionName + * @property {string|null} [code] JavaScriptUDF code + */ + + /** + * Constructs a new JavaScriptUDF. + * @memberof google.pubsub.v1 + * @classdesc Represents a JavaScriptUDF. + * @implements IJavaScriptUDF + * @constructor + * @param {google.pubsub.v1.IJavaScriptUDF=} [properties] Properties to set + */ + function JavaScriptUDF(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaScriptUDF functionName. + * @member {string} functionName + * @memberof google.pubsub.v1.JavaScriptUDF + * @instance + */ + JavaScriptUDF.prototype.functionName = ""; + + /** + * JavaScriptUDF code. + * @member {string} code + * @memberof google.pubsub.v1.JavaScriptUDF + * @instance + */ + JavaScriptUDF.prototype.code = ""; + + /** + * Creates a new JavaScriptUDF instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {google.pubsub.v1.IJavaScriptUDF=} [properties] Properties to set + * @returns {google.pubsub.v1.JavaScriptUDF} JavaScriptUDF instance + */ + JavaScriptUDF.create = function create(properties) { + return new JavaScriptUDF(properties); + }; + + /** + * Encodes the specified JavaScriptUDF message. Does not implicitly {@link google.pubsub.v1.JavaScriptUDF.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {google.pubsub.v1.IJavaScriptUDF} message JavaScriptUDF message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaScriptUDF.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.functionName != null && Object.hasOwnProperty.call(message, "functionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.functionName); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.code); + return writer; + }; + + /** + * Encodes the specified JavaScriptUDF message, length delimited. Does not implicitly {@link google.pubsub.v1.JavaScriptUDF.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {google.pubsub.v1.IJavaScriptUDF} message JavaScriptUDF message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaScriptUDF.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaScriptUDF message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.JavaScriptUDF} JavaScriptUDF + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaScriptUDF.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.JavaScriptUDF(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.functionName = reader.string(); + break; + } + case 2: { + message.code = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaScriptUDF message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.JavaScriptUDF} JavaScriptUDF + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaScriptUDF.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaScriptUDF message. + * @function verify + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaScriptUDF.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.functionName != null && message.hasOwnProperty("functionName")) + if (!$util.isString(message.functionName)) + return "functionName: string expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + return null; + }; + + /** + * Creates a JavaScriptUDF message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.JavaScriptUDF} JavaScriptUDF + */ + JavaScriptUDF.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.JavaScriptUDF) + return object; + var message = new $root.google.pubsub.v1.JavaScriptUDF(); + if (object.functionName != null) + message.functionName = String(object.functionName); + if (object.code != null) + message.code = String(object.code); + return message; + }; + + /** + * Creates a plain object from a JavaScriptUDF message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {google.pubsub.v1.JavaScriptUDF} message JavaScriptUDF + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaScriptUDF.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.functionName = ""; + object.code = ""; + } + if (message.functionName != null && message.hasOwnProperty("functionName")) + object.functionName = message.functionName; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + return object; + }; + + /** + * Converts this JavaScriptUDF to JSON. + * @function toJSON + * @memberof google.pubsub.v1.JavaScriptUDF + * @instance + * @returns {Object.} JSON object + */ + JavaScriptUDF.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaScriptUDF + * @function getTypeUrl + * @memberof google.pubsub.v1.JavaScriptUDF + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaScriptUDF.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.JavaScriptUDF"; + }; + + return JavaScriptUDF; + })(); + + v1.MessageTransform = (function() { + + /** + * Properties of a MessageTransform. + * @memberof google.pubsub.v1 + * @interface IMessageTransform + * @property {google.pubsub.v1.IJavaScriptUDF|null} [javascriptUdf] MessageTransform javascriptUdf + * @property {boolean|null} [enabled] MessageTransform enabled + * @property {boolean|null} [disabled] MessageTransform disabled + */ + + /** + * Constructs a new MessageTransform. + * @memberof google.pubsub.v1 + * @classdesc Represents a MessageTransform. + * @implements IMessageTransform + * @constructor + * @param {google.pubsub.v1.IMessageTransform=} [properties] Properties to set + */ + function MessageTransform(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageTransform javascriptUdf. + * @member {google.pubsub.v1.IJavaScriptUDF|null|undefined} javascriptUdf + * @memberof google.pubsub.v1.MessageTransform + * @instance + */ + MessageTransform.prototype.javascriptUdf = null; + + /** + * MessageTransform enabled. + * @member {boolean} enabled + * @memberof google.pubsub.v1.MessageTransform + * @instance + */ + MessageTransform.prototype.enabled = false; + + /** + * MessageTransform disabled. + * @member {boolean} disabled + * @memberof google.pubsub.v1.MessageTransform + * @instance + */ + MessageTransform.prototype.disabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MessageTransform transform. + * @member {"javascriptUdf"|undefined} transform + * @memberof google.pubsub.v1.MessageTransform + * @instance + */ + Object.defineProperty(MessageTransform.prototype, "transform", { + get: $util.oneOfGetter($oneOfFields = ["javascriptUdf"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MessageTransform instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {google.pubsub.v1.IMessageTransform=} [properties] Properties to set + * @returns {google.pubsub.v1.MessageTransform} MessageTransform instance + */ + MessageTransform.create = function create(properties) { + return new MessageTransform(properties); + }; + + /** + * Encodes the specified MessageTransform message. Does not implicitly {@link google.pubsub.v1.MessageTransform.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {google.pubsub.v1.IMessageTransform} message MessageTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageTransform.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javascriptUdf != null && Object.hasOwnProperty.call(message, "javascriptUdf")) + $root.google.pubsub.v1.JavaScriptUDF.encode(message.javascriptUdf, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enabled); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified MessageTransform message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageTransform.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {google.pubsub.v1.IMessageTransform} message MessageTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageTransform.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageTransform message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.MessageTransform} MessageTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageTransform.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.MessageTransform(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.javascriptUdf = $root.google.pubsub.v1.JavaScriptUDF.decode(reader, reader.uint32()); + break; + } + case 3: { + message.enabled = reader.bool(); + break; + } + case 4: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageTransform message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.MessageTransform} MessageTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageTransform.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageTransform message. + * @function verify + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageTransform.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.javascriptUdf != null && message.hasOwnProperty("javascriptUdf")) { + properties.transform = 1; + { + var error = $root.google.pubsub.v1.JavaScriptUDF.verify(message.javascriptUdf); + if (error) + return "javascriptUdf." + error; + } + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a MessageTransform message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.MessageTransform} MessageTransform + */ + MessageTransform.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.MessageTransform) + return object; + var message = new $root.google.pubsub.v1.MessageTransform(); + if (object.javascriptUdf != null) { + if (typeof object.javascriptUdf !== "object") + throw TypeError(".google.pubsub.v1.MessageTransform.javascriptUdf: object expected"); + message.javascriptUdf = $root.google.pubsub.v1.JavaScriptUDF.fromObject(object.javascriptUdf); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a MessageTransform message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {google.pubsub.v1.MessageTransform} message MessageTransform + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageTransform.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.disabled = false; + } + if (message.javascriptUdf != null && message.hasOwnProperty("javascriptUdf")) { + object.javascriptUdf = $root.google.pubsub.v1.JavaScriptUDF.toObject(message.javascriptUdf, options); + if (options.oneofs) + object.transform = "javascriptUdf"; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this MessageTransform to JSON. + * @function toJSON + * @memberof google.pubsub.v1.MessageTransform + * @instance + * @returns {Object.} JSON object + */ + MessageTransform.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageTransform + * @function getTypeUrl + * @memberof google.pubsub.v1.MessageTransform + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageTransform.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.MessageTransform"; + }; + + return MessageTransform; + })(); + + v1.Topic = (function() { + + /** + * Properties of a Topic. + * @memberof google.pubsub.v1 + * @interface ITopic + * @property {string|null} [name] Topic name + * @property {Object.|null} [labels] Topic labels + * @property {google.pubsub.v1.IMessageStoragePolicy|null} [messageStoragePolicy] Topic messageStoragePolicy + * @property {string|null} [kmsKeyName] Topic kmsKeyName + * @property {google.pubsub.v1.ISchemaSettings|null} [schemaSettings] Topic schemaSettings + * @property {boolean|null} [satisfiesPzs] Topic satisfiesPzs + * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Topic messageRetentionDuration + * @property {google.pubsub.v1.Topic.State|null} [state] Topic state + * @property {google.pubsub.v1.IIngestionDataSourceSettings|null} [ingestionDataSourceSettings] Topic ingestionDataSourceSettings + * @property {Array.|null} [messageTransforms] Topic messageTransforms + * @property {Object.|null} [tags] Topic tags + */ + + /** + * Constructs a new Topic. + * @memberof google.pubsub.v1 + * @classdesc Represents a Topic. + * @implements ITopic + * @constructor + * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + */ + function Topic(properties) { + this.labels = {}; + this.messageTransforms = []; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Topic name. + * @member {string} name + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.name = ""; + + /** + * Topic labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.labels = $util.emptyObject; + + /** + * Topic messageStoragePolicy. + * @member {google.pubsub.v1.IMessageStoragePolicy|null|undefined} messageStoragePolicy + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.messageStoragePolicy = null; + + /** + * Topic kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.kmsKeyName = ""; + + /** + * Topic schemaSettings. + * @member {google.pubsub.v1.ISchemaSettings|null|undefined} schemaSettings + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.schemaSettings = null; + + /** + * Topic satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.satisfiesPzs = false; + + /** + * Topic messageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.messageRetentionDuration = null; + + /** + * Topic state. + * @member {google.pubsub.v1.Topic.State} state + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.state = 0; + + /** + * Topic ingestionDataSourceSettings. + * @member {google.pubsub.v1.IIngestionDataSourceSettings|null|undefined} ingestionDataSourceSettings + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.ingestionDataSourceSettings = null; + + /** + * Topic messageTransforms. + * @member {Array.} messageTransforms + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.messageTransforms = $util.emptyArray; + + /** + * Topic tags. + * @member {Object.} tags + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.tags = $util.emptyObject; + + /** + * Creates a new Topic instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + * @returns {google.pubsub.v1.Topic} Topic instance + */ + Topic.create = function create(properties) { + return new Topic(properties); + }; + + /** + * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Topic.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.messageStoragePolicy != null && Object.hasOwnProperty.call(message, "messageStoragePolicy")) + $root.google.pubsub.v1.MessageStoragePolicy.encode(message.messageStoragePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName); + if (message.schemaSettings != null && Object.hasOwnProperty.call(message, "schemaSettings")) + $root.google.pubsub.v1.SchemaSettings.encode(message.schemaSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.satisfiesPzs); + if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.ingestionDataSourceSettings != null && Object.hasOwnProperty.call(message, "ingestionDataSourceSettings")) + $root.google.pubsub.v1.IngestionDataSourceSettings.encode(message.ingestionDataSourceSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.messageTransforms != null && message.messageTransforms.length) + for (var i = 0; i < message.messageTransforms.length; ++i) + $root.google.pubsub.v1.MessageTransform.encode(message.messageTransforms[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Topic.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Topic message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Topic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Topic} Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Topic.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Topic(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 3: { + message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.kmsKeyName = reader.string(); + break; + } + case 6: { + message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.satisfiesPzs = reader.bool(); + break; + } + case 8: { + message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 10: { + message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.messageTransforms && message.messageTransforms.length)) + message.messageTransforms = []; + message.messageTransforms.push($root.google.pubsub.v1.MessageTransform.decode(reader, reader.uint32())); + break; + } + case 14: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Topic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Topic} Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Topic.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Topic message. + * @function verify + * @memberof google.pubsub.v1.Topic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Topic.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) { + var error = $root.google.pubsub.v1.MessageStoragePolicy.verify(message.messageStoragePolicy); + if (error) + return "messageStoragePolicy." + error; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) { + var error = $root.google.pubsub.v1.SchemaSettings.verify(message.schemaSettings); + if (error) + return "schemaSettings." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); + if (error) + return "messageRetentionDuration." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.verify(message.ingestionDataSourceSettings); + if (error) + return "ingestionDataSourceSettings." + error; + } + if (message.messageTransforms != null && message.hasOwnProperty("messageTransforms")) { + if (!Array.isArray(message.messageTransforms)) + return "messageTransforms: array expected"; + for (var i = 0; i < message.messageTransforms.length; ++i) { + var error = $root.google.pubsub.v1.MessageTransform.verify(message.messageTransforms[i]); + if (error) + return "messageTransforms." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Topic + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Topic} Topic + */ + Topic.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Topic) + return object; + var message = new $root.google.pubsub.v1.Topic(); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Topic.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.messageStoragePolicy != null) { + if (typeof object.messageStoragePolicy !== "object") + throw TypeError(".google.pubsub.v1.Topic.messageStoragePolicy: object expected"); + message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.fromObject(object.messageStoragePolicy); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.schemaSettings != null) { + if (typeof object.schemaSettings !== "object") + throw TypeError(".google.pubsub.v1.Topic.schemaSettings: object expected"); + message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.fromObject(object.schemaSettings); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.messageRetentionDuration != null) { + if (typeof object.messageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Topic.messageRetentionDuration: object expected"); + message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INGESTION_RESOURCE_ERROR": + case 2: + message.state = 2; + break; + } + if (object.ingestionDataSourceSettings != null) { + if (typeof object.ingestionDataSourceSettings !== "object") + throw TypeError(".google.pubsub.v1.Topic.ingestionDataSourceSettings: object expected"); + message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.fromObject(object.ingestionDataSourceSettings); + } + if (object.messageTransforms) { + if (!Array.isArray(object.messageTransforms)) + throw TypeError(".google.pubsub.v1.Topic.messageTransforms: array expected"); + message.messageTransforms = []; + for (var i = 0; i < object.messageTransforms.length; ++i) { + if (typeof object.messageTransforms[i] !== "object") + throw TypeError(".google.pubsub.v1.Topic.messageTransforms: object expected"); + message.messageTransforms[i] = $root.google.pubsub.v1.MessageTransform.fromObject(object.messageTransforms[i]); + } + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.pubsub.v1.Topic.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.Topic} message Topic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Topic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageTransforms = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.messageStoragePolicy = null; + object.kmsKeyName = ""; + object.schemaSettings = null; + object.satisfiesPzs = false; + object.messageRetentionDuration = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.ingestionDataSourceSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) + object.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.toObject(message.messageStoragePolicy, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) + object.schemaSettings = $root.google.pubsub.v1.SchemaSettings.toObject(message.schemaSettings, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) + object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.Topic.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Topic.State[message.state] : message.state; + if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) + object.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.toObject(message.ingestionDataSourceSettings, options); + if (message.messageTransforms && message.messageTransforms.length) { + object.messageTransforms = []; + for (var j = 0; j < message.messageTransforms.length; ++j) + object.messageTransforms[j] = $root.google.pubsub.v1.MessageTransform.toObject(message.messageTransforms[j], options); + } + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + return object; + }; + + /** + * Converts this Topic to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Topic + * @instance + * @returns {Object.} JSON object + */ + Topic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Topic + * @function getTypeUrl + * @memberof google.pubsub.v1.Topic + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Topic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Topic"; + }; + + /** + * State enum. + * @name google.pubsub.v1.Topic.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INGESTION_RESOURCE_ERROR=2 INGESTION_RESOURCE_ERROR value + */ + Topic.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INGESTION_RESOURCE_ERROR"] = 2; + return values; + })(); + + return Topic; + })(); + + v1.PubsubMessage = (function() { + + /** + * Properties of a PubsubMessage. + * @memberof google.pubsub.v1 + * @interface IPubsubMessage + * @property {Uint8Array|null} [data] PubsubMessage data + * @property {Object.|null} [attributes] PubsubMessage attributes + * @property {string|null} [messageId] PubsubMessage messageId + * @property {google.protobuf.ITimestamp|null} [publishTime] PubsubMessage publishTime + * @property {string|null} [orderingKey] PubsubMessage orderingKey + */ + + /** + * Constructs a new PubsubMessage. + * @memberof google.pubsub.v1 + * @classdesc Represents a PubsubMessage. + * @implements IPubsubMessage + * @constructor + * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + */ + function PubsubMessage(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubsubMessage data. + * @member {Uint8Array} data + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.data = $util.newBuffer([]); + + /** + * PubsubMessage attributes. + * @member {Object.} attributes + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.attributes = $util.emptyObject; + + /** + * PubsubMessage messageId. + * @member {string} messageId + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.messageId = ""; + + /** + * PubsubMessage publishTime. + * @member {google.protobuf.ITimestamp|null|undefined} publishTime + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.publishTime = null; + + /** + * PubsubMessage orderingKey. + * @member {string} orderingKey + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.orderingKey = ""; + + /** + * Creates a new PubsubMessage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage instance + */ + PubsubMessage.create = function create(properties) { + return new PubsubMessage(properties); + }; + + /** + * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageId); + if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) + $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orderingKey != null && Object.hasOwnProperty.call(message, "orderingKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderingKey); + return writer; + }; + + /** + * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PubsubMessage(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.data = reader.bytes(); + break; + } + case 2: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.attributes[key] = value; + break; + } + case 3: { + message.messageId = reader.string(); + break; + } + case 4: { + message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.orderingKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubMessage message. + * @function verify + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.attributes[key[i]])) + return "attributes: string{k:string} expected"; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + if (message.publishTime != null && message.hasOwnProperty("publishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (error) + return "publishTime." + error; + } + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + if (!$util.isString(message.orderingKey)) + return "orderingKey: string expected"; + return null; + }; + + /** + * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + */ + PubsubMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PubsubMessage) + return object; + var message = new $root.google.pubsub.v1.PubsubMessage(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.pubsub.v1.PubsubMessage.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) + message.attributes[keys[i]] = String(object.attributes[keys[i]]); + } + if (object.messageId != null) + message.messageId = String(object.messageId); + if (object.publishTime != null) { + if (typeof object.publishTime !== "object") + throw TypeError(".google.pubsub.v1.PubsubMessage.publishTime: object expected"); + message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + } + if (object.orderingKey != null) + message.orderingKey = String(object.orderingKey); + return message; + }; + + /** + * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.PubsubMessage} message PubsubMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.messageId = ""; + object.publishTime = null; + object.orderingKey = ""; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = message.attributes[keys2[j]]; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + object.orderingKey = message.orderingKey; + return object; + }; + + /** + * Converts this PubsubMessage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PubsubMessage + * @instance + * @returns {Object.} JSON object + */ + PubsubMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubMessage + * @function getTypeUrl + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PubsubMessage"; + }; + + return PubsubMessage; + })(); + + v1.GetTopicRequest = (function() { + + /** + * Properties of a GetTopicRequest. + * @memberof google.pubsub.v1 + * @interface IGetTopicRequest + * @property {string|null} [topic] GetTopicRequest topic + */ + + /** + * Constructs a new GetTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetTopicRequest. + * @implements IGetTopicRequest + * @constructor + * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + */ + function GetTopicRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTopicRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.GetTopicRequest + * @instance + */ + GetTopicRequest.prototype.topic = ""; + + /** + * Creates a new GetTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest instance + */ + GetTopicRequest.create = function create(properties) { + return new GetTopicRequest(properties); + }; + + /** + * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTopicRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + */ + GetTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetTopicRequest) + return object; + var message = new $root.google.pubsub.v1.GetTopicRequest(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.GetTopicRequest} message GetTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this GetTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetTopicRequest + * @instance + * @returns {Object.} JSON object + */ + GetTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTopicRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetTopicRequest"; + }; + + return GetTopicRequest; + })(); + + v1.UpdateTopicRequest = (function() { + + /** + * Properties of an UpdateTopicRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateTopicRequest + * @property {google.pubsub.v1.ITopic|null} [topic] UpdateTopicRequest topic + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTopicRequest updateMask + */ + + /** + * Constructs a new UpdateTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateTopicRequest. + * @implements IUpdateTopicRequest + * @constructor + * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + */ + function UpdateTopicRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTopicRequest topic. + * @member {google.pubsub.v1.ITopic|null|undefined} topic + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + */ + UpdateTopicRequest.prototype.topic = null; + + /** + * UpdateTopicRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + */ + UpdateTopicRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest instance + */ + UpdateTopicRequest.create = function create(properties) { + return new UpdateTopicRequest(properties); + }; + + /** + * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + $root.google.pubsub.v1.Topic.encode(message.topic, 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 UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTopicRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = $root.google.pubsub.v1.Topic.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 UpdateTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) { + var error = $root.google.pubsub.v1.Topic.verify(message.topic); + if (error) + return "topic." + 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 UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + */ + UpdateTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateTopicRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateTopicRequest(); + if (object.topic != null) { + if (typeof object.topic !== "object") + throw TypeError(".google.pubsub.v1.UpdateTopicRequest.topic: object expected"); + message.topic = $root.google.pubsub.v1.Topic.fromObject(object.topic); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateTopicRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.UpdateTopicRequest} message UpdateTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = null; + object.updateMask = null; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = $root.google.pubsub.v1.Topic.toObject(message.topic, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTopicRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.UpdateTopicRequest"; + }; + + return UpdateTopicRequest; + })(); + + v1.PublishRequest = (function() { + + /** + * Properties of a PublishRequest. + * @memberof google.pubsub.v1 + * @interface IPublishRequest + * @property {string|null} [topic] PublishRequest topic + * @property {Array.|null} [messages] PublishRequest messages + */ + + /** + * Constructs a new PublishRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a PublishRequest. + * @implements IPublishRequest + * @constructor + * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set + */ + function PublishRequest(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]]; + } + + /** + * PublishRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.topic = ""; + + /** + * PublishRequest messages. + * @member {Array.} messages + * @memberof google.pubsub.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.messages = $util.emptyArray; + + /** + * Creates a new PublishRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.PublishRequest} PublishRequest instance + */ + PublishRequest.create = function create(properties) { + return new PublishRequest(properties); + }; + + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.pubsub.v1.PubsubMessage.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishRequest message. + * @function verify + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.pubsub.v1.PubsubMessage.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PublishRequest} PublishRequest + */ + PublishRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PublishRequest) + return object; + var message = new $root.google.pubsub.v1.PublishRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.pubsub.v1.PublishRequest.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.pubsub.v1.PublishRequest.messages: object expected"); + message.messages[i] = $root.google.pubsub.v1.PubsubMessage.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {google.pubsub.v1.PublishRequest} message PublishRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.pubsub.v1.PubsubMessage.toObject(message.messages[j], options); + } + return object; + }; + + /** + * Converts this PublishRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PublishRequest + * @instance + * @returns {Object.} JSON object + */ + PublishRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.PublishRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PublishRequest"; + }; + + return PublishRequest; + })(); + + v1.PublishResponse = (function() { + + /** + * Properties of a PublishResponse. + * @memberof google.pubsub.v1 + * @interface IPublishResponse + * @property {Array.|null} [messageIds] PublishResponse messageIds + */ + + /** + * Constructs a new PublishResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a PublishResponse. + * @implements IPublishResponse + * @constructor + * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + */ + function PublishResponse(properties) { + this.messageIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublishResponse messageIds. + * @member {Array.} messageIds + * @memberof google.pubsub.v1.PublishResponse + * @instance + */ + PublishResponse.prototype.messageIds = $util.emptyArray; + + /** + * Creates a new PublishResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.PublishResponse} PublishResponse instance + */ + PublishResponse.create = function create(properties) { + return new PublishResponse(properties); + }; + + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageIds != null && message.messageIds.length) + for (var i = 0; i < message.messageIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageIds[i]); + return writer; + }; + + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messageIds && message.messageIds.length)) + message.messageIds = []; + message.messageIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishResponse message. + * @function verify + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageIds != null && message.hasOwnProperty("messageIds")) { + if (!Array.isArray(message.messageIds)) + return "messageIds: array expected"; + for (var i = 0; i < message.messageIds.length; ++i) + if (!$util.isString(message.messageIds[i])) + return "messageIds: string[] expected"; + } + return null; + }; + + /** + * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + */ + PublishResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PublishResponse) + return object; + var message = new $root.google.pubsub.v1.PublishResponse(); + if (object.messageIds) { + if (!Array.isArray(object.messageIds)) + throw TypeError(".google.pubsub.v1.PublishResponse.messageIds: array expected"); + message.messageIds = []; + for (var i = 0; i < object.messageIds.length; ++i) + message.messageIds[i] = String(object.messageIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.PublishResponse} message PublishResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageIds = []; + if (message.messageIds && message.messageIds.length) { + object.messageIds = []; + for (var j = 0; j < message.messageIds.length; ++j) + object.messageIds[j] = message.messageIds[j]; + } + return object; + }; + + /** + * Converts this PublishResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PublishResponse + * @instance + * @returns {Object.} JSON object + */ + PublishResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PublishResponse"; + }; + + return PublishResponse; + })(); + + v1.ListTopicsRequest = (function() { + + /** + * Properties of a ListTopicsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicsRequest + * @property {string|null} [project] ListTopicsRequest project + * @property {number|null} [pageSize] ListTopicsRequest pageSize + * @property {string|null} [pageToken] ListTopicsRequest pageToken + */ + + /** + * Constructs a new ListTopicsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicsRequest. + * @implements IListTopicsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + */ + function ListTopicsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTopicsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.project = ""; + + /** + * ListTopicsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.pageSize = 0; + + /** + * ListTopicsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest instance + */ + ListTopicsRequest.create = function create(properties) { + return new ListTopicsRequest(properties); + }; + + /** + * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + */ + ListTopicsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.ListTopicsRequest} message ListTopicsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicsRequest"; + }; + + return ListTopicsRequest; + })(); + + v1.ListTopicsResponse = (function() { + + /** + * Properties of a ListTopicsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicsResponse + * @property {Array.|null} [topics] ListTopicsResponse topics + * @property {string|null} [nextPageToken] ListTopicsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicsResponse. + * @implements IListTopicsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + */ + function ListTopicsResponse(properties) { + this.topics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTopicsResponse topics. + * @member {Array.} topics + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + */ + ListTopicsResponse.prototype.topics = $util.emptyArray; + + /** + * ListTopicsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + */ + ListTopicsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse instance + */ + ListTopicsResponse.create = function create(properties) { + return new ListTopicsResponse(properties); + }; + + /** + * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topics != null && message.topics.length) + for (var i = 0; i < message.topics.length; ++i) + $root.google.pubsub.v1.Topic.encode(message.topics[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 ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.topics && message.topics.length)) + message.topics = []; + message.topics.push($root.google.pubsub.v1.Topic.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topics != null && message.hasOwnProperty("topics")) { + if (!Array.isArray(message.topics)) + return "topics: array expected"; + for (var i = 0; i < message.topics.length; ++i) { + var error = $root.google.pubsub.v1.Topic.verify(message.topics[i]); + if (error) + return "topics." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + */ + ListTopicsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicsResponse(); + if (object.topics) { + if (!Array.isArray(object.topics)) + throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: array expected"); + message.topics = []; + for (var i = 0; i < object.topics.length; ++i) { + if (typeof object.topics[i] !== "object") + throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: object expected"); + message.topics[i] = $root.google.pubsub.v1.Topic.fromObject(object.topics[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.ListTopicsResponse} message ListTopicsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topics = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.topics && message.topics.length) { + object.topics = []; + for (var j = 0; j < message.topics.length; ++j) + object.topics[j] = $root.google.pubsub.v1.Topic.toObject(message.topics[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicsResponse"; + }; + + return ListTopicsResponse; + })(); + + v1.ListTopicSubscriptionsRequest = (function() { + + /** + * Properties of a ListTopicSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicSubscriptionsRequest + * @property {string|null} [topic] ListTopicSubscriptionsRequest topic + * @property {number|null} [pageSize] ListTopicSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListTopicSubscriptionsRequest pageToken + */ + + /** + * Constructs a new ListTopicSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSubscriptionsRequest. + * @implements IListTopicSubscriptionsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set + */ + function ListTopicSubscriptionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTopicSubscriptionsRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.topic = ""; + + /** + * ListTopicSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.pageSize = 0; + + /** + * ListTopicSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest instance + */ + ListTopicSubscriptionsRequest.create = function create(properties) { + return new ListTopicSubscriptionsRequest(properties); + }; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSubscriptionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSubscriptionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + */ + ListTopicSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.ListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSubscriptionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicSubscriptionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicSubscriptionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSubscriptionsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSubscriptionsRequest"; + }; + + return ListTopicSubscriptionsRequest; + })(); + + v1.ListTopicSubscriptionsResponse = (function() { + + /** + * Properties of a ListTopicSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListTopicSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListTopicSubscriptionsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSubscriptionsResponse. + * @implements IListTopicSubscriptionsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set + */ + function ListTopicSubscriptionsResponse(properties) { + this.subscriptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTopicSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + */ + ListTopicSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; + + /** + * ListTopicSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + */ + ListTopicSubscriptionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse instance + */ + ListTopicSubscriptionsResponse.create = function create(properties) { + return new ListTopicSubscriptionsResponse(properties); + }; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptions[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSubscriptionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSubscriptionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) + if (!$util.isString(message.subscriptions[i])) + return "subscriptions: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + */ + ListTopicSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) + message.subscriptions[i] = String(object.subscriptions[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSubscriptionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = message.subscriptions[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicSubscriptionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicSubscriptionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSubscriptionsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSubscriptionsResponse"; + }; + + return ListTopicSubscriptionsResponse; + })(); + + v1.ListTopicSnapshotsRequest = (function() { + + /** + * Properties of a ListTopicSnapshotsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicSnapshotsRequest + * @property {string|null} [topic] ListTopicSnapshotsRequest topic + * @property {number|null} [pageSize] ListTopicSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListTopicSnapshotsRequest pageToken + */ + + /** + * Constructs a new ListTopicSnapshotsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSnapshotsRequest. + * @implements IListTopicSnapshotsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set + */ + function ListTopicSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTopicSnapshotsRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.topic = ""; + + /** + * ListTopicSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListTopicSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest instance + */ + ListTopicSnapshotsRequest.create = function create(properties) { + return new ListTopicSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSnapshotsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + */ + ListTopicSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.ListTopicSnapshotsRequest} message ListTopicSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSnapshotsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSnapshotsRequest"; + }; + + return ListTopicSnapshotsRequest; + })(); + + v1.ListTopicSnapshotsResponse = (function() { + + /** + * Properties of a ListTopicSnapshotsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicSnapshotsResponse + * @property {Array.|null} [snapshots] ListTopicSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListTopicSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicSnapshotsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSnapshotsResponse. + * @implements IListTopicSnapshotsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set + */ + function ListTopicSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTopicSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + */ + ListTopicSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListTopicSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + */ + ListTopicSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse instance + */ + ListTopicSnapshotsResponse.create = function create(properties) { + return new ListTopicSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshots[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSnapshotsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) + if (!$util.isString(message.snapshots[i])) + return "snapshots: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + */ + ListTopicSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.pubsub.v1.ListTopicSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) + message.snapshots[i] = String(object.snapshots[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.ListTopicSnapshotsResponse} message ListTopicSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = message.snapshots[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTopicSnapshotsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTopicSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListTopicSnapshotsResponse"; + }; + + return ListTopicSnapshotsResponse; + })(); + + v1.DeleteTopicRequest = (function() { + + /** + * Properties of a DeleteTopicRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteTopicRequest + * @property {string|null} [topic] DeleteTopicRequest topic + */ + + /** + * Constructs a new DeleteTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteTopicRequest. + * @implements IDeleteTopicRequest + * @constructor + * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set + */ + function DeleteTopicRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTopicRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.DeleteTopicRequest + * @instance + */ + DeleteTopicRequest.prototype.topic = ""; + + /** + * Creates a new DeleteTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest instance + */ + DeleteTopicRequest.create = function create(properties) { + return new DeleteTopicRequest(properties); + }; + + /** + * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTopicRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + */ + DeleteTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteTopicRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteTopicRequest(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.DeleteTopicRequest} message DeleteTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this DeleteTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteTopicRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTopicRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTopicRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteTopicRequest"; + }; + + return DeleteTopicRequest; + })(); + + v1.DetachSubscriptionRequest = (function() { + + /** + * Properties of a DetachSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IDetachSubscriptionRequest + * @property {string|null} [subscription] DetachSubscriptionRequest subscription + */ + + /** + * Constructs a new DetachSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DetachSubscriptionRequest. + * @implements IDetachSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set + */ + function DetachSubscriptionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetachSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @instance + */ + DetachSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new DetachSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest instance + */ + DetachSubscriptionRequest.create = function create(properties) { + return new DetachSubscriptionRequest(properties); + }; + + /** + * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DetachSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest + */ + DetachSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DetachSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.DetachSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {google.pubsub.v1.DetachSubscriptionRequest} message DetachSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this DetachSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + DetachSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetachSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DetachSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetachSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DetachSubscriptionRequest"; + }; + + return DetachSubscriptionRequest; + })(); + + v1.DetachSubscriptionResponse = (function() { + + /** + * Properties of a DetachSubscriptionResponse. + * @memberof google.pubsub.v1 + * @interface IDetachSubscriptionResponse + */ + + /** + * Constructs a new DetachSubscriptionResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a DetachSubscriptionResponse. + * @implements IDetachSubscriptionResponse + * @constructor + * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set + */ + function DetachSubscriptionResponse(properties) { + if (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 DetachSubscriptionResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse instance + */ + DetachSubscriptionResponse.create = function create(properties) { + return new DetachSubscriptionResponse(properties); + }; + + /** + * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachSubscriptionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DetachSubscriptionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachSubscriptionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachSubscriptionResponse message. + * @function verify + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachSubscriptionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse + */ + DetachSubscriptionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DetachSubscriptionResponse) + return object; + return new $root.google.pubsub.v1.DetachSubscriptionResponse(); + }; + + /** + * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {google.pubsub.v1.DetachSubscriptionResponse} message DetachSubscriptionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachSubscriptionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DetachSubscriptionResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @instance + * @returns {Object.} JSON object + */ + DetachSubscriptionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetachSubscriptionResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.DetachSubscriptionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetachSubscriptionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DetachSubscriptionResponse"; + }; + + return DetachSubscriptionResponse; + })(); + + v1.Subscriber = (function() { + + /** + * Constructs a new Subscriber service. + * @memberof google.pubsub.v1 + * @classdesc Represents a Subscriber + * @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 Subscriber(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Subscriber.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subscriber; + + /** + * Creates new Subscriber service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.Subscriber + * @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 {Subscriber} RPC service. Useful where requests and/or responses are streamed. + */ + Subscriber.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef CreateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object + * @param {google.pubsub.v1.Subscriber.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.createSubscription = function createSubscription(request, callback) { + return this.rpcCall(createSubscription, $root.google.pubsub.v1.Subscription, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "CreateSubscription" }); + + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef GetSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls GetSubscription. + * @function getSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.GetSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.getSubscription = function getSubscription(request, callback) { + return this.rpcCall(getSubscription, $root.google.pubsub.v1.GetSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "GetSubscription" }); + + /** + * Calls GetSubscription. + * @function getSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef UpdateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.updateSubscription = function updateSubscription(request, callback) { + return this.rpcCall(updateSubscription, $root.google.pubsub.v1.UpdateSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "UpdateSubscription" }); + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ListSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSubscriptionsResponse} [response] ListSubscriptionsResponse + */ + + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.listSubscriptions = function listSubscriptions(request, callback) { + return this.rpcCall(listSubscriptions, $root.google.pubsub.v1.ListSubscriptionsRequest, $root.google.pubsub.v1.ListSubscriptionsResponse, request, callback); + }, "name", { value: "ListSubscriptions" }); + + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef DeleteSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.deleteSubscription = function deleteSubscription(request, callback) { + return this.rpcCall(deleteSubscription, $root.google.pubsub.v1.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSubscription" }); + + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ModifyAckDeadlineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ModifyAckDeadline. + * @function modifyAckDeadline + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.modifyAckDeadline = function modifyAckDeadline(request, callback) { + return this.rpcCall(modifyAckDeadline, $root.google.pubsub.v1.ModifyAckDeadlineRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ModifyAckDeadline" }); + + /** + * Calls ModifyAckDeadline. + * @function modifyAckDeadline + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}. + * @memberof google.pubsub.v1.Subscriber + * @typedef AcknowledgeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls Acknowledge. + * @function acknowledge + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object + * @param {google.pubsub.v1.Subscriber.AcknowledgeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.acknowledge = function acknowledge(request, callback) { + return this.rpcCall(acknowledge, $root.google.pubsub.v1.AcknowledgeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "Acknowledge" }); + + /** + * Calls Acknowledge. + * @function acknowledge + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|pull}. + * @memberof google.pubsub.v1.Subscriber + * @typedef PullCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.PullResponse} [response] PullResponse + */ + + /** + * Calls Pull. + * @function pull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object + * @param {google.pubsub.v1.Subscriber.PullCallback} callback Node-style callback called with the error, if any, and PullResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.pull = function pull(request, callback) { + return this.rpcCall(pull, $root.google.pubsub.v1.PullRequest, $root.google.pubsub.v1.PullResponse, request, callback); + }, "name", { value: "Pull" }); + + /** + * Calls Pull. + * @function pull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}. + * @memberof google.pubsub.v1.Subscriber + * @typedef StreamingPullCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.StreamingPullResponse} [response] StreamingPullResponse + */ + + /** + * Calls StreamingPull. + * @function streamingPull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object + * @param {google.pubsub.v1.Subscriber.StreamingPullCallback} callback Node-style callback called with the error, if any, and StreamingPullResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.streamingPull = function streamingPull(request, callback) { + return this.rpcCall(streamingPull, $root.google.pubsub.v1.StreamingPullRequest, $root.google.pubsub.v1.StreamingPullResponse, request, callback); + }, "name", { value: "StreamingPull" }); + + /** + * Calls StreamingPull. + * @function streamingPull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ModifyPushConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ModifyPushConfig. + * @function modifyPushConfig + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ModifyPushConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.modifyPushConfig = function modifyPushConfig(request, callback) { + return this.rpcCall(modifyPushConfig, $root.google.pubsub.v1.ModifyPushConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ModifyPushConfig" }); + + /** + * Calls ModifyPushConfig. + * @function modifyPushConfig + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.pubsub.v1.GetSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.pubsub.v1.ListSnapshotsRequest, $root.google.pubsub.v1.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef CreateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.createSnapshot = function createSnapshot(request, callback) { + return this.rpcCall(createSnapshot, $root.google.pubsub.v1.CreateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "CreateSnapshot" }); + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef UpdateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.updateSnapshot = function updateSnapshot(request, callback) { + return this.rpcCall(updateSnapshot, $root.google.pubsub.v1.UpdateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "UpdateSnapshot" }); + + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.pubsub.v1.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber|seek}. + * @memberof google.pubsub.v1.Subscriber + * @typedef SeekCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.SeekResponse} [response] SeekResponse + */ + + /** + * Calls Seek. + * @function seek + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object + * @param {google.pubsub.v1.Subscriber.SeekCallback} callback Node-style callback called with the error, if any, and SeekResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.seek = function seek(request, callback) { + return this.rpcCall(seek, $root.google.pubsub.v1.SeekRequest, $root.google.pubsub.v1.SeekResponse, request, callback); + }, "name", { value: "Seek" }); + + /** + * Calls Seek. + * @function seek + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Subscriber; + })(); + + v1.Subscription = (function() { + + /** + * Properties of a Subscription. + * @memberof google.pubsub.v1 + * @interface ISubscription + * @property {string|null} [name] Subscription name + * @property {string|null} [topic] Subscription topic + * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] Subscription pushConfig + * @property {google.pubsub.v1.IBigQueryConfig|null} [bigqueryConfig] Subscription bigqueryConfig + * @property {google.pubsub.v1.ICloudStorageConfig|null} [cloudStorageConfig] Subscription cloudStorageConfig + * @property {number|null} [ackDeadlineSeconds] Subscription ackDeadlineSeconds + * @property {boolean|null} [retainAckedMessages] Subscription retainAckedMessages + * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Subscription messageRetentionDuration + * @property {Object.|null} [labels] Subscription labels + * @property {boolean|null} [enableMessageOrdering] Subscription enableMessageOrdering + * @property {google.pubsub.v1.IExpirationPolicy|null} [expirationPolicy] Subscription expirationPolicy + * @property {string|null} [filter] Subscription filter + * @property {google.pubsub.v1.IDeadLetterPolicy|null} [deadLetterPolicy] Subscription deadLetterPolicy + * @property {google.pubsub.v1.IRetryPolicy|null} [retryPolicy] Subscription retryPolicy + * @property {boolean|null} [detached] Subscription detached + * @property {boolean|null} [enableExactlyOnceDelivery] Subscription enableExactlyOnceDelivery + * @property {google.protobuf.IDuration|null} [topicMessageRetentionDuration] Subscription topicMessageRetentionDuration + * @property {google.pubsub.v1.Subscription.State|null} [state] Subscription state + * @property {google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo|null} [analyticsHubSubscriptionInfo] Subscription analyticsHubSubscriptionInfo + * @property {Array.|null} [messageTransforms] Subscription messageTransforms + * @property {Object.|null} [tags] Subscription tags + */ + + /** + * Constructs a new Subscription. + * @memberof google.pubsub.v1 + * @classdesc Represents a Subscription. + * @implements ISubscription + * @constructor + * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set + */ + function Subscription(properties) { + this.labels = {}; + this.messageTransforms = []; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Subscription name. + * @member {string} name + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.name = ""; + + /** + * Subscription topic. + * @member {string} topic + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.topic = ""; + + /** + * Subscription pushConfig. + * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.pushConfig = null; + + /** + * Subscription bigqueryConfig. + * @member {google.pubsub.v1.IBigQueryConfig|null|undefined} bigqueryConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.bigqueryConfig = null; + + /** + * Subscription cloudStorageConfig. + * @member {google.pubsub.v1.ICloudStorageConfig|null|undefined} cloudStorageConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.cloudStorageConfig = null; + + /** + * Subscription ackDeadlineSeconds. + * @member {number} ackDeadlineSeconds + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.ackDeadlineSeconds = 0; + + /** + * Subscription retainAckedMessages. + * @member {boolean} retainAckedMessages + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.retainAckedMessages = false; + + /** + * Subscription messageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.messageRetentionDuration = null; + + /** + * Subscription labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.labels = $util.emptyObject; + + /** + * Subscription enableMessageOrdering. + * @member {boolean} enableMessageOrdering + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.enableMessageOrdering = false; + + /** + * Subscription expirationPolicy. + * @member {google.pubsub.v1.IExpirationPolicy|null|undefined} expirationPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.expirationPolicy = null; + + /** + * Subscription filter. + * @member {string} filter + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.filter = ""; + + /** + * Subscription deadLetterPolicy. + * @member {google.pubsub.v1.IDeadLetterPolicy|null|undefined} deadLetterPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.deadLetterPolicy = null; + + /** + * Subscription retryPolicy. + * @member {google.pubsub.v1.IRetryPolicy|null|undefined} retryPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.retryPolicy = null; + + /** + * Subscription detached. + * @member {boolean} detached + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.detached = false; + + /** + * Subscription enableExactlyOnceDelivery. + * @member {boolean} enableExactlyOnceDelivery + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.enableExactlyOnceDelivery = false; + + /** + * Subscription topicMessageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} topicMessageRetentionDuration + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.topicMessageRetentionDuration = null; + + /** + * Subscription state. + * @member {google.pubsub.v1.Subscription.State} state + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.state = 0; + + /** + * Subscription analyticsHubSubscriptionInfo. + * @member {google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo|null|undefined} analyticsHubSubscriptionInfo + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.analyticsHubSubscriptionInfo = null; + + /** + * Subscription messageTransforms. + * @member {Array.} messageTransforms + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.messageTransforms = $util.emptyArray; + + /** + * Subscription tags. + * @member {Object.} tags + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.tags = $util.emptyObject; + + /** + * Creates a new Subscription instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set + * @returns {google.pubsub.v1.Subscription} Subscription instance + */ + Subscription.create = function create(properties) { + return new Subscription(properties); + }; + + /** + * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subscription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig")) + $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackDeadlineSeconds); + if (message.retainAckedMessages != null && Object.hasOwnProperty.call(message, "retainAckedMessages")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retainAckedMessages); + if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.enableMessageOrdering != null && Object.hasOwnProperty.call(message, "enableMessageOrdering")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableMessageOrdering); + if (message.expirationPolicy != null && Object.hasOwnProperty.call(message, "expirationPolicy")) + $root.google.pubsub.v1.ExpirationPolicy.encode(message.expirationPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.filter); + if (message.deadLetterPolicy != null && Object.hasOwnProperty.call(message, "deadLetterPolicy")) + $root.google.pubsub.v1.DeadLetterPolicy.encode(message.deadLetterPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy")) + $root.google.pubsub.v1.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.detached != null && Object.hasOwnProperty.call(message, "detached")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.detached); + if (message.enableExactlyOnceDelivery != null && Object.hasOwnProperty.call(message, "enableExactlyOnceDelivery")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableExactlyOnceDelivery); + if (message.topicMessageRetentionDuration != null && Object.hasOwnProperty.call(message, "topicMessageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.topicMessageRetentionDuration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.bigqueryConfig != null && Object.hasOwnProperty.call(message, "bigqueryConfig")) + $root.google.pubsub.v1.BigQueryConfig.encode(message.bigqueryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.state); + if (message.cloudStorageConfig != null && Object.hasOwnProperty.call(message, "cloudStorageConfig")) + $root.google.pubsub.v1.CloudStorageConfig.encode(message.cloudStorageConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.analyticsHubSubscriptionInfo != null && Object.hasOwnProperty.call(message, "analyticsHubSubscriptionInfo")) + $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.encode(message.analyticsHubSubscriptionInfo, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.messageTransforms != null && message.messageTransforms.length) + for (var i = 0; i < message.messageTransforms.length; ++i) + $root.google.pubsub.v1.MessageTransform.encode(message.messageTransforms[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subscription message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Subscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Subscription} Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subscription.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Subscription(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.topic = reader.string(); + break; + } + case 4: { + message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ackDeadlineSeconds = reader.int32(); + break; + } + case 7: { + message.retainAckedMessages = reader.bool(); + break; + } + case 8: { + message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 10: { + message.enableMessageOrdering = reader.bool(); + break; + } + case 11: { + message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.decode(reader, reader.uint32()); + break; + } + case 12: { + message.filter = reader.string(); + break; + } + case 13: { + message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.decode(reader, reader.uint32()); + break; + } + case 15: { + message.detached = reader.bool(); + break; + } + case 16: { + message.enableExactlyOnceDelivery = reader.bool(); + break; + } + case 17: { + message.topicMessageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 19: { + message.state = reader.int32(); + break; + } + case 23: { + message.analyticsHubSubscriptionInfo = $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.decode(reader, reader.uint32()); + break; + } + case 25: { + if (!(message.messageTransforms && message.messageTransforms.length)) + message.messageTransforms = []; + message.messageTransforms.push($root.google.pubsub.v1.MessageTransform.decode(reader, reader.uint32())); + break; + } + case 26: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Subscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Subscription} Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subscription message. + * @function verify + * @memberof google.pubsub.v1.Subscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subscription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { + var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); + if (error) + return "pushConfig." + error; + } + if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) { + var error = $root.google.pubsub.v1.BigQueryConfig.verify(message.bigqueryConfig); + if (error) + return "bigqueryConfig." + error; + } + if (message.cloudStorageConfig != null && message.hasOwnProperty("cloudStorageConfig")) { + var error = $root.google.pubsub.v1.CloudStorageConfig.verify(message.cloudStorageConfig); + if (error) + return "cloudStorageConfig." + error; + } + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + if (!$util.isInteger(message.ackDeadlineSeconds)) + return "ackDeadlineSeconds: integer expected"; + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + if (typeof message.retainAckedMessages !== "boolean") + return "retainAckedMessages: boolean expected"; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); + if (error) + return "messageRetentionDuration." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + if (typeof message.enableMessageOrdering !== "boolean") + return "enableMessageOrdering: boolean expected"; + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) { + var error = $root.google.pubsub.v1.ExpirationPolicy.verify(message.expirationPolicy); + if (error) + return "expirationPolicy." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) { + var error = $root.google.pubsub.v1.DeadLetterPolicy.verify(message.deadLetterPolicy); + if (error) + return "deadLetterPolicy." + error; + } + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + var error = $root.google.pubsub.v1.RetryPolicy.verify(message.retryPolicy); + if (error) + return "retryPolicy." + error; + } + if (message.detached != null && message.hasOwnProperty("detached")) + if (typeof message.detached !== "boolean") + return "detached: boolean expected"; + if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery")) + if (typeof message.enableExactlyOnceDelivery !== "boolean") + return "enableExactlyOnceDelivery: boolean expected"; + if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.topicMessageRetentionDuration); + if (error) + return "topicMessageRetentionDuration." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.analyticsHubSubscriptionInfo != null && message.hasOwnProperty("analyticsHubSubscriptionInfo")) { + var error = $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.verify(message.analyticsHubSubscriptionInfo); + if (error) + return "analyticsHubSubscriptionInfo." + error; + } + if (message.messageTransforms != null && message.hasOwnProperty("messageTransforms")) { + if (!Array.isArray(message.messageTransforms)) + return "messageTransforms: array expected"; + for (var i = 0; i < message.messageTransforms.length; ++i) { + var error = $root.google.pubsub.v1.MessageTransform.verify(message.messageTransforms[i]); + if (error) + return "messageTransforms." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Subscription + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Subscription} Subscription + */ + Subscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Subscription) + return object; + var message = new $root.google.pubsub.v1.Subscription(); + if (object.name != null) + message.name = String(object.name); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pushConfig != null) { + if (typeof object.pushConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.pushConfig: object expected"); + message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); + } + if (object.bigqueryConfig != null) { + if (typeof object.bigqueryConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.bigqueryConfig: object expected"); + message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.fromObject(object.bigqueryConfig); + } + if (object.cloudStorageConfig != null) { + if (typeof object.cloudStorageConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.cloudStorageConfig: object expected"); + message.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.fromObject(object.cloudStorageConfig); + } + if (object.ackDeadlineSeconds != null) + message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; + if (object.retainAckedMessages != null) + message.retainAckedMessages = Boolean(object.retainAckedMessages); + if (object.messageRetentionDuration != null) { + if (typeof object.messageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Subscription.messageRetentionDuration: object expected"); + message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Subscription.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.enableMessageOrdering != null) + message.enableMessageOrdering = Boolean(object.enableMessageOrdering); + if (object.expirationPolicy != null) { + if (typeof object.expirationPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.expirationPolicy: object expected"); + message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.fromObject(object.expirationPolicy); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.deadLetterPolicy != null) { + if (typeof object.deadLetterPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.deadLetterPolicy: object expected"); + message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.fromObject(object.deadLetterPolicy); + } + if (object.retryPolicy != null) { + if (typeof object.retryPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.retryPolicy: object expected"); + message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.fromObject(object.retryPolicy); + } + if (object.detached != null) + message.detached = Boolean(object.detached); + if (object.enableExactlyOnceDelivery != null) + message.enableExactlyOnceDelivery = Boolean(object.enableExactlyOnceDelivery); + if (object.topicMessageRetentionDuration != null) { + if (typeof object.topicMessageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Subscription.topicMessageRetentionDuration: object expected"); + message.topicMessageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.topicMessageRetentionDuration); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "RESOURCE_ERROR": + case 2: + message.state = 2; + break; + } + if (object.analyticsHubSubscriptionInfo != null) { + if (typeof object.analyticsHubSubscriptionInfo !== "object") + throw TypeError(".google.pubsub.v1.Subscription.analyticsHubSubscriptionInfo: object expected"); + message.analyticsHubSubscriptionInfo = $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.fromObject(object.analyticsHubSubscriptionInfo); + } + if (object.messageTransforms) { + if (!Array.isArray(object.messageTransforms)) + throw TypeError(".google.pubsub.v1.Subscription.messageTransforms: array expected"); + message.messageTransforms = []; + for (var i = 0; i < object.messageTransforms.length; ++i) { + if (typeof object.messageTransforms[i] !== "object") + throw TypeError(".google.pubsub.v1.Subscription.messageTransforms: object expected"); + message.messageTransforms[i] = $root.google.pubsub.v1.MessageTransform.fromObject(object.messageTransforms[i]); + } + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.pubsub.v1.Subscription.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.Subscription} message Subscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageTransforms = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.topic = ""; + object.pushConfig = null; + object.ackDeadlineSeconds = 0; + object.retainAckedMessages = false; + object.messageRetentionDuration = null; + object.enableMessageOrdering = false; + object.expirationPolicy = null; + object.filter = ""; + object.deadLetterPolicy = null; + object.retryPolicy = null; + object.detached = false; + object.enableExactlyOnceDelivery = false; + object.topicMessageRetentionDuration = null; + object.bigqueryConfig = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.cloudStorageConfig = null; + object.analyticsHubSubscriptionInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + object.ackDeadlineSeconds = message.ackDeadlineSeconds; + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + object.retainAckedMessages = message.retainAckedMessages; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) + object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + object.enableMessageOrdering = message.enableMessageOrdering; + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) + object.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.toObject(message.expirationPolicy, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) + object.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.toObject(message.deadLetterPolicy, options); + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) + object.retryPolicy = $root.google.pubsub.v1.RetryPolicy.toObject(message.retryPolicy, options); + if (message.detached != null && message.hasOwnProperty("detached")) + object.detached = message.detached; + if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery")) + object.enableExactlyOnceDelivery = message.enableExactlyOnceDelivery; + if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) + object.topicMessageRetentionDuration = $root.google.protobuf.Duration.toObject(message.topicMessageRetentionDuration, options); + if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) + object.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.toObject(message.bigqueryConfig, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.Subscription.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Subscription.State[message.state] : message.state; + if (message.cloudStorageConfig != null && message.hasOwnProperty("cloudStorageConfig")) + object.cloudStorageConfig = $root.google.pubsub.v1.CloudStorageConfig.toObject(message.cloudStorageConfig, options); + if (message.analyticsHubSubscriptionInfo != null && message.hasOwnProperty("analyticsHubSubscriptionInfo")) + object.analyticsHubSubscriptionInfo = $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.toObject(message.analyticsHubSubscriptionInfo, options); + if (message.messageTransforms && message.messageTransforms.length) { + object.messageTransforms = []; + for (var j = 0; j < message.messageTransforms.length; ++j) + object.messageTransforms[j] = $root.google.pubsub.v1.MessageTransform.toObject(message.messageTransforms[j], options); + } + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + return object; + }; + + /** + * Converts this Subscription to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Subscription + * @instance + * @returns {Object.} JSON object + */ + Subscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subscription + * @function getTypeUrl + * @memberof google.pubsub.v1.Subscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Subscription"; + }; + + /** + * State enum. + * @name google.pubsub.v1.Subscription.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} RESOURCE_ERROR=2 RESOURCE_ERROR value + */ + Subscription.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "RESOURCE_ERROR"] = 2; + return values; + })(); + + Subscription.AnalyticsHubSubscriptionInfo = (function() { + + /** + * Properties of an AnalyticsHubSubscriptionInfo. + * @memberof google.pubsub.v1.Subscription + * @interface IAnalyticsHubSubscriptionInfo + * @property {string|null} [listing] AnalyticsHubSubscriptionInfo listing + * @property {string|null} [subscription] AnalyticsHubSubscriptionInfo subscription + */ + + /** + * Constructs a new AnalyticsHubSubscriptionInfo. + * @memberof google.pubsub.v1.Subscription + * @classdesc Represents an AnalyticsHubSubscriptionInfo. + * @implements IAnalyticsHubSubscriptionInfo + * @constructor + * @param {google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo=} [properties] Properties to set + */ + function AnalyticsHubSubscriptionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyticsHubSubscriptionInfo listing. + * @member {string} listing + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @instance + */ + AnalyticsHubSubscriptionInfo.prototype.listing = ""; + + /** + * AnalyticsHubSubscriptionInfo subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @instance + */ + AnalyticsHubSubscriptionInfo.prototype.subscription = ""; + + /** + * Creates a new AnalyticsHubSubscriptionInfo instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo=} [properties] Properties to set + * @returns {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} AnalyticsHubSubscriptionInfo instance + */ + AnalyticsHubSubscriptionInfo.create = function create(properties) { + return new AnalyticsHubSubscriptionInfo(properties); + }; + + /** + * Encodes the specified AnalyticsHubSubscriptionInfo message. Does not implicitly {@link google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo} message AnalyticsHubSubscriptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyticsHubSubscriptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listing != null && Object.hasOwnProperty.call(message, "listing")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.listing); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified AnalyticsHubSubscriptionInfo message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {google.pubsub.v1.Subscription.IAnalyticsHubSubscriptionInfo} message AnalyticsHubSubscriptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyticsHubSubscriptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyticsHubSubscriptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} AnalyticsHubSubscriptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyticsHubSubscriptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.listing = reader.string(); + break; + } + case 2: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyticsHubSubscriptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} AnalyticsHubSubscriptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyticsHubSubscriptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyticsHubSubscriptionInfo message. + * @function verify + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyticsHubSubscriptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listing != null && message.hasOwnProperty("listing")) + if (!$util.isString(message.listing)) + return "listing: string expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates an AnalyticsHubSubscriptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} AnalyticsHubSubscriptionInfo + */ + AnalyticsHubSubscriptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo) + return object; + var message = new $root.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo(); + if (object.listing != null) + message.listing = String(object.listing); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from an AnalyticsHubSubscriptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} message AnalyticsHubSubscriptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyticsHubSubscriptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.listing = ""; + object.subscription = ""; + } + if (message.listing != null && message.hasOwnProperty("listing")) + object.listing = message.listing; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this AnalyticsHubSubscriptionInfo to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @instance + * @returns {Object.} JSON object + */ + AnalyticsHubSubscriptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyticsHubSubscriptionInfo + * @function getTypeUrl + * @memberof google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyticsHubSubscriptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo"; + }; + + return AnalyticsHubSubscriptionInfo; + })(); + + return Subscription; + })(); + + v1.RetryPolicy = (function() { + + /** + * Properties of a RetryPolicy. + * @memberof google.pubsub.v1 + * @interface IRetryPolicy + * @property {google.protobuf.IDuration|null} [minimumBackoff] RetryPolicy minimumBackoff + * @property {google.protobuf.IDuration|null} [maximumBackoff] RetryPolicy maximumBackoff + */ + + /** + * Constructs a new RetryPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a RetryPolicy. + * @implements IRetryPolicy + * @constructor + * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set + */ + function RetryPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetryPolicy minimumBackoff. + * @member {google.protobuf.IDuration|null|undefined} minimumBackoff + * @memberof google.pubsub.v1.RetryPolicy + * @instance + */ + RetryPolicy.prototype.minimumBackoff = null; + + /** + * RetryPolicy maximumBackoff. + * @member {google.protobuf.IDuration|null|undefined} maximumBackoff + * @memberof google.pubsub.v1.RetryPolicy + * @instance + */ + RetryPolicy.prototype.maximumBackoff = null; + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy instance + */ + RetryPolicy.create = function create(properties) { + return new RetryPolicy(properties); + }; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minimumBackoff != null && Object.hasOwnProperty.call(message, "minimumBackoff")) + $root.google.protobuf.Duration.encode(message.minimumBackoff, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maximumBackoff != null && Object.hasOwnProperty.call(message, "maximumBackoff")) + $root.google.protobuf.Duration.encode(message.maximumBackoff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.RetryPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minimumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maximumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryPolicy message. + * @function verify + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) { + var error = $root.google.protobuf.Duration.verify(message.minimumBackoff); + if (error) + return "minimumBackoff." + error; + } + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) { + var error = $root.google.protobuf.Duration.verify(message.maximumBackoff); + if (error) + return "maximumBackoff." + error; + } + return null; + }; + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + */ + RetryPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.RetryPolicy) + return object; + var message = new $root.google.pubsub.v1.RetryPolicy(); + if (object.minimumBackoff != null) { + if (typeof object.minimumBackoff !== "object") + throw TypeError(".google.pubsub.v1.RetryPolicy.minimumBackoff: object expected"); + message.minimumBackoff = $root.google.protobuf.Duration.fromObject(object.minimumBackoff); + } + if (object.maximumBackoff != null) { + if (typeof object.maximumBackoff !== "object") + throw TypeError(".google.pubsub.v1.RetryPolicy.maximumBackoff: object expected"); + message.maximumBackoff = $root.google.protobuf.Duration.fromObject(object.maximumBackoff); + } + return message; + }; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.RetryPolicy} message RetryPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minimumBackoff = null; + object.maximumBackoff = null; + } + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) + object.minimumBackoff = $root.google.protobuf.Duration.toObject(message.minimumBackoff, options); + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) + object.maximumBackoff = $root.google.protobuf.Duration.toObject(message.maximumBackoff, options); + return object; + }; + + /** + * Converts this RetryPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.RetryPolicy + * @instance + * @returns {Object.} JSON object + */ + RetryPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryPolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.RetryPolicy"; + }; + + return RetryPolicy; + })(); + + v1.DeadLetterPolicy = (function() { + + /** + * Properties of a DeadLetterPolicy. + * @memberof google.pubsub.v1 + * @interface IDeadLetterPolicy + * @property {string|null} [deadLetterTopic] DeadLetterPolicy deadLetterTopic + * @property {number|null} [maxDeliveryAttempts] DeadLetterPolicy maxDeliveryAttempts + */ + + /** + * Constructs a new DeadLetterPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeadLetterPolicy. + * @implements IDeadLetterPolicy + * @constructor + * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set + */ + function DeadLetterPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeadLetterPolicy deadLetterTopic. + * @member {string} deadLetterTopic + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + */ + DeadLetterPolicy.prototype.deadLetterTopic = ""; + + /** + * DeadLetterPolicy maxDeliveryAttempts. + * @member {number} maxDeliveryAttempts + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + */ + DeadLetterPolicy.prototype.maxDeliveryAttempts = 0; + + /** + * Creates a new DeadLetterPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy instance + */ + DeadLetterPolicy.create = function create(properties) { + return new DeadLetterPolicy(properties); + }; + + /** + * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeadLetterPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deadLetterTopic != null && Object.hasOwnProperty.call(message, "deadLetterTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deadLetterTopic); + if (message.maxDeliveryAttempts != null && Object.hasOwnProperty.call(message, "maxDeliveryAttempts")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDeliveryAttempts); + return writer; + }; + + /** + * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeadLetterPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeadLetterPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeadLetterPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deadLetterTopic = reader.string(); + break; + } + case 2: { + message.maxDeliveryAttempts = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeadLetterPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeadLetterPolicy message. + * @function verify + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeadLetterPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + if (!$util.isString(message.deadLetterTopic)) + return "deadLetterTopic: string expected"; + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + if (!$util.isInteger(message.maxDeliveryAttempts)) + return "maxDeliveryAttempts: integer expected"; + return null; + }; + + /** + * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + */ + DeadLetterPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeadLetterPolicy) + return object; + var message = new $root.google.pubsub.v1.DeadLetterPolicy(); + if (object.deadLetterTopic != null) + message.deadLetterTopic = String(object.deadLetterTopic); + if (object.maxDeliveryAttempts != null) + message.maxDeliveryAttempts = object.maxDeliveryAttempts | 0; + return message; + }; + + /** + * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.DeadLetterPolicy} message DeadLetterPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeadLetterPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deadLetterTopic = ""; + object.maxDeliveryAttempts = 0; + } + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + object.deadLetterTopic = message.deadLetterTopic; + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + object.maxDeliveryAttempts = message.maxDeliveryAttempts; + return object; + }; + + /** + * Converts this DeadLetterPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + * @returns {Object.} JSON object + */ + DeadLetterPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeadLetterPolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeadLetterPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeadLetterPolicy"; + }; + + return DeadLetterPolicy; + })(); + + v1.ExpirationPolicy = (function() { + + /** + * Properties of an ExpirationPolicy. + * @memberof google.pubsub.v1 + * @interface IExpirationPolicy + * @property {google.protobuf.IDuration|null} [ttl] ExpirationPolicy ttl + */ + + /** + * Constructs a new ExpirationPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents an ExpirationPolicy. + * @implements IExpirationPolicy + * @constructor + * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set + */ + function ExpirationPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpirationPolicy ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.pubsub.v1.ExpirationPolicy + * @instance + */ + ExpirationPolicy.prototype.ttl = null; + + /** + * Creates a new ExpirationPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy instance + */ + ExpirationPolicy.create = function create(properties) { + return new ExpirationPolicy(properties); + }; + + /** + * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpirationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpirationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpirationPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ExpirationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpirationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpirationPolicy message. + * @function verify + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpirationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + return null; + }; + + /** + * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + */ + ExpirationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ExpirationPolicy) + return object; + var message = new $root.google.pubsub.v1.ExpirationPolicy(); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.pubsub.v1.ExpirationPolicy.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + return message; + }; + + /** + * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.ExpirationPolicy} message ExpirationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpirationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ttl = null; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + return object; + }; + + /** + * Converts this ExpirationPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ExpirationPolicy + * @instance + * @returns {Object.} JSON object + */ + ExpirationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpirationPolicy + * @function getTypeUrl + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpirationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ExpirationPolicy"; + }; + + return ExpirationPolicy; + })(); + + v1.PushConfig = (function() { + + /** + * Properties of a PushConfig. + * @memberof google.pubsub.v1 + * @interface IPushConfig + * @property {string|null} [pushEndpoint] PushConfig pushEndpoint + * @property {Object.|null} [attributes] PushConfig attributes + * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken + * @property {google.pubsub.v1.PushConfig.IPubsubWrapper|null} [pubsubWrapper] PushConfig pubsubWrapper + * @property {google.pubsub.v1.PushConfig.INoWrapper|null} [noWrapper] PushConfig noWrapper + */ + + /** + * Constructs a new PushConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a PushConfig. + * @implements IPushConfig + * @constructor + * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set + */ + function PushConfig(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PushConfig pushEndpoint. + * @member {string} pushEndpoint + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.pushEndpoint = ""; + + /** + * PushConfig attributes. + * @member {Object.} attributes + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.attributes = $util.emptyObject; + + /** + * PushConfig oidcToken. + * @member {google.pubsub.v1.PushConfig.IOidcToken|null|undefined} oidcToken + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.oidcToken = null; + + /** + * PushConfig pubsubWrapper. + * @member {google.pubsub.v1.PushConfig.IPubsubWrapper|null|undefined} pubsubWrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.pubsubWrapper = null; + + /** + * PushConfig noWrapper. + * @member {google.pubsub.v1.PushConfig.INoWrapper|null|undefined} noWrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.noWrapper = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PushConfig authenticationMethod. + * @member {"oidcToken"|undefined} authenticationMethod + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + Object.defineProperty(PushConfig.prototype, "authenticationMethod", { + get: $util.oneOfGetter($oneOfFields = ["oidcToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PushConfig wrapper. + * @member {"pubsubWrapper"|"noWrapper"|undefined} wrapper + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + Object.defineProperty(PushConfig.prototype, "wrapper", { + get: $util.oneOfGetter($oneOfFields = ["pubsubWrapper", "noWrapper"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PushConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig} PushConfig instance + */ + PushConfig.create = function create(properties) { + return new PushConfig(properties); + }; + + /** + * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pushEndpoint != null && Object.hasOwnProperty.call(message, "pushEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pushEndpoint); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); + if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken")) + $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pubsubWrapper != null && Object.hasOwnProperty.call(message, "pubsubWrapper")) + $root.google.pubsub.v1.PushConfig.PubsubWrapper.encode(message.pubsubWrapper, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.noWrapper != null && Object.hasOwnProperty.call(message, "noWrapper")) + $root.google.pubsub.v1.PushConfig.NoWrapper.encode(message.noWrapper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PushConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig} PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pushEndpoint = reader.string(); + break; + } + case 2: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.attributes[key] = value; + break; + } + case 3: { + message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.decode(reader, reader.uint32()); + break; + } + case 5: { + message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PushConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig} PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PushConfig message. + * @function verify + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PushConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + if (!$util.isString(message.pushEndpoint)) + return "pushEndpoint: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.attributes[key[i]])) + return "attributes: string{k:string} expected"; + } + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { + properties.authenticationMethod = 1; + { + var error = $root.google.pubsub.v1.PushConfig.OidcToken.verify(message.oidcToken); + if (error) + return "oidcToken." + error; + } + } + if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { + properties.wrapper = 1; + { + var error = $root.google.pubsub.v1.PushConfig.PubsubWrapper.verify(message.pubsubWrapper); + if (error) + return "pubsubWrapper." + error; + } + } + if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { + if (properties.wrapper === 1) + return "wrapper: multiple values"; + properties.wrapper = 1; + { + var error = $root.google.pubsub.v1.PushConfig.NoWrapper.verify(message.noWrapper); + if (error) + return "noWrapper." + error; + } + } + return null; + }; + + /** + * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig} PushConfig + */ + PushConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig) + return object; + var message = new $root.google.pubsub.v1.PushConfig(); + if (object.pushEndpoint != null) + message.pushEndpoint = String(object.pushEndpoint); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) + message.attributes[keys[i]] = String(object.attributes[keys[i]]); + } + if (object.oidcToken != null) { + if (typeof object.oidcToken !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected"); + message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken); + } + if (object.pubsubWrapper != null) { + if (typeof object.pubsubWrapper !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.pubsubWrapper: object expected"); + message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.fromObject(object.pubsubWrapper); + } + if (object.noWrapper != null) { + if (typeof object.noWrapper !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.noWrapper: object expected"); + message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.fromObject(object.noWrapper); + } + return message; + }; + + /** + * Creates a plain object from a PushConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.PushConfig} message PushConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PushConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) + object.pushEndpoint = ""; + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + object.pushEndpoint = message.pushEndpoint; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = message.attributes[keys2[j]]; + } + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { + object.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.toObject(message.oidcToken, options); + if (options.oneofs) + object.authenticationMethod = "oidcToken"; + } + if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) { + object.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.toObject(message.pubsubWrapper, options); + if (options.oneofs) + object.wrapper = "pubsubWrapper"; + } + if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) { + object.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.toObject(message.noWrapper, options); + if (options.oneofs) + object.wrapper = "noWrapper"; + } + return object; + }; + + /** + * Converts this PushConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig + * @instance + * @returns {Object.} JSON object + */ + PushConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PushConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PushConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig"; + }; + + PushConfig.OidcToken = (function() { + + /** + * Properties of an OidcToken. + * @memberof google.pubsub.v1.PushConfig + * @interface IOidcToken + * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail + * @property {string|null} [audience] OidcToken audience + */ + + /** + * Constructs a new OidcToken. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents an OidcToken. + * @implements IOidcToken + * @constructor + * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set + */ + function OidcToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OidcToken serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + */ + OidcToken.prototype.serviceAccountEmail = ""; + + /** + * OidcToken audience. + * @member {string} audience + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + */ + OidcToken.prototype.audience = ""; + + /** + * Creates a new OidcToken instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken instance + */ + OidcToken.create = function create(properties) { + return new OidcToken(properties); + }; + + /** + * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidcToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); + return writer; + }; + + /** + * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidcToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OidcToken message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidcToken.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.OidcToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccountEmail = reader.string(); + break; + } + case 2: { + message.audience = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OidcToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidcToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OidcToken message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OidcToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; + + /** + * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + */ + OidcToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.OidcToken) + return object; + var message = new $root.google.pubsub.v1.PushConfig.OidcToken(); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; + + /** + * Creates a plain object from an OidcToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.OidcToken} message OidcToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OidcToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceAccountEmail = ""; + object.audience = ""; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; + return object; + }; + + /** + * Converts this OidcToken to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + * @returns {Object.} JSON object + */ + OidcToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OidcToken + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OidcToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.OidcToken"; + }; + + return OidcToken; + })(); + + PushConfig.PubsubWrapper = (function() { + + /** + * Properties of a PubsubWrapper. + * @memberof google.pubsub.v1.PushConfig + * @interface IPubsubWrapper + */ + + /** + * Constructs a new PubsubWrapper. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents a PubsubWrapper. + * @implements IPubsubWrapper + * @constructor + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set + */ + function PubsubWrapper(properties) { + if (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 PubsubWrapper instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper instance + */ + PubsubWrapper.create = function create(properties) { + return new PubsubWrapper(properties); + }; + + /** + * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubWrapper.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.PubsubWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubWrapper message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper + */ + PubsubWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.PubsubWrapper) + return object; + return new $root.google.pubsub.v1.PushConfig.PubsubWrapper(); + }; + + /** + * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {google.pubsub.v1.PushConfig.PubsubWrapper} message PubsubWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubWrapper.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PubsubWrapper to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @instance + * @returns {Object.} JSON object + */ + PubsubWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubWrapper + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.PubsubWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.PubsubWrapper"; + }; + + return PubsubWrapper; + })(); + + PushConfig.NoWrapper = (function() { + + /** + * Properties of a NoWrapper. + * @memberof google.pubsub.v1.PushConfig + * @interface INoWrapper + * @property {boolean|null} [writeMetadata] NoWrapper writeMetadata + */ + + /** + * Constructs a new NoWrapper. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents a NoWrapper. + * @implements INoWrapper + * @constructor + * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set + */ + function NoWrapper(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NoWrapper writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @instance + */ + NoWrapper.prototype.writeMetadata = false; + + /** + * Creates a new NoWrapper instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper instance + */ + NoWrapper.create = function create(properties) { + return new NoWrapper(properties); + }; + + /** + * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NoWrapper.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); + return writer; + }; + + /** + * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NoWrapper.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NoWrapper message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NoWrapper.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.NoWrapper(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.writeMetadata = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NoWrapper message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NoWrapper.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NoWrapper message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NoWrapper.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + return null; + }; + + /** + * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper + */ + NoWrapper.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.NoWrapper) + return object; + var message = new $root.google.pubsub.v1.PushConfig.NoWrapper(); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + return message; + }; + + /** + * Creates a plain object from a NoWrapper message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {google.pubsub.v1.PushConfig.NoWrapper} message NoWrapper + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NoWrapper.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.writeMetadata = false; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + return object; + }; + + /** + * Converts this NoWrapper to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @instance + * @returns {Object.} JSON object + */ + NoWrapper.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NoWrapper + * @function getTypeUrl + * @memberof google.pubsub.v1.PushConfig.NoWrapper + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NoWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PushConfig.NoWrapper"; + }; + + return NoWrapper; + })(); + + return PushConfig; + })(); + + v1.BigQueryConfig = (function() { + + /** + * Properties of a BigQueryConfig. + * @memberof google.pubsub.v1 + * @interface IBigQueryConfig + * @property {string|null} [table] BigQueryConfig table + * @property {boolean|null} [useTopicSchema] BigQueryConfig useTopicSchema + * @property {boolean|null} [writeMetadata] BigQueryConfig writeMetadata + * @property {boolean|null} [dropUnknownFields] BigQueryConfig dropUnknownFields + * @property {google.pubsub.v1.BigQueryConfig.State|null} [state] BigQueryConfig state + * @property {boolean|null} [useTableSchema] BigQueryConfig useTableSchema + * @property {string|null} [serviceAccountEmail] BigQueryConfig serviceAccountEmail + */ + + /** + * Constructs a new BigQueryConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a BigQueryConfig. + * @implements IBigQueryConfig + * @constructor + * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set + */ + function BigQueryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryConfig table. + * @member {string} table + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.table = ""; + + /** + * BigQueryConfig useTopicSchema. + * @member {boolean} useTopicSchema + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.useTopicSchema = false; + + /** + * BigQueryConfig writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.writeMetadata = false; + + /** + * BigQueryConfig dropUnknownFields. + * @member {boolean} dropUnknownFields + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.dropUnknownFields = false; + + /** + * BigQueryConfig state. + * @member {google.pubsub.v1.BigQueryConfig.State} state + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.state = 0; + + /** + * BigQueryConfig useTableSchema. + * @member {boolean} useTableSchema + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.useTableSchema = false; + + /** + * BigQueryConfig serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.serviceAccountEmail = ""; + + /** + * Creates a new BigQueryConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig instance + */ + BigQueryConfig.create = function create(properties) { + return new BigQueryConfig(properties); + }; + + /** + * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.writeMetadata); + if (message.dropUnknownFields != null && Object.hasOwnProperty.call(message, "dropUnknownFields")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dropUnknownFields); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.useTableSchema != null && Object.hasOwnProperty.call(message, "useTableSchema")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useTableSchema); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccountEmail); + return writer; + }; + + /** + * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.BigQueryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.useTopicSchema = reader.bool(); + break; + } + case 3: { + message.writeMetadata = reader.bool(); + break; + } + case 4: { + message.dropUnknownFields = reader.bool(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.useTableSchema = reader.bool(); + break; + } + case 7: { + message.serviceAccountEmail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryConfig message. + * @function verify + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + if (typeof message.useTopicSchema !== "boolean") + return "useTopicSchema: boolean expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields")) + if (typeof message.dropUnknownFields !== "boolean") + return "dropUnknownFields: boolean expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) + if (typeof message.useTableSchema !== "boolean") + return "useTableSchema: boolean expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + return null; + }; + + /** + * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig + */ + BigQueryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.BigQueryConfig) + return object; + var message = new $root.google.pubsub.v1.BigQueryConfig(); + if (object.table != null) + message.table = String(object.table); + if (object.useTopicSchema != null) + message.useTopicSchema = Boolean(object.useTopicSchema); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + if (object.dropUnknownFields != null) + message.dropUnknownFields = Boolean(object.dropUnknownFields); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "NOT_FOUND": + case 3: + message.state = 3; + break; + case "SCHEMA_MISMATCH": + case 4: + message.state = 4; + break; + case "IN_TRANSIT_LOCATION_RESTRICTION": + case 5: + message.state = 5; + break; + } + if (object.useTableSchema != null) + message.useTableSchema = Boolean(object.useTableSchema); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + return message; + }; + + /** + * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {google.pubsub.v1.BigQueryConfig} message BigQueryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = ""; + object.useTopicSchema = false; + object.writeMetadata = false; + object.dropUnknownFields = false; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.useTableSchema = false; + object.serviceAccountEmail = ""; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + object.useTopicSchema = message.useTopicSchema; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields")) + object.dropUnknownFields = message.dropUnknownFields; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.BigQueryConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.BigQueryConfig.State[message.state] : message.state; + if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) + object.useTableSchema = message.useTableSchema; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + return object; + }; + + /** + * Converts this BigQueryConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + * @returns {Object.} JSON object + */ + BigQueryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.BigQueryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.BigQueryConfig"; + }; + + /** + * State enum. + * @name google.pubsub.v1.BigQueryConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} NOT_FOUND=3 NOT_FOUND value + * @property {number} SCHEMA_MISMATCH=4 SCHEMA_MISMATCH value + * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=5 IN_TRANSIT_LOCATION_RESTRICTION value + */ + BigQueryConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "NOT_FOUND"] = 3; + values[valuesById[4] = "SCHEMA_MISMATCH"] = 4; + values[valuesById[5] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 5; + return values; + })(); + + return BigQueryConfig; + })(); + + v1.CloudStorageConfig = (function() { + + /** + * Properties of a CloudStorageConfig. + * @memberof google.pubsub.v1 + * @interface ICloudStorageConfig + * @property {string|null} [bucket] CloudStorageConfig bucket + * @property {string|null} [filenamePrefix] CloudStorageConfig filenamePrefix + * @property {string|null} [filenameSuffix] CloudStorageConfig filenameSuffix + * @property {string|null} [filenameDatetimeFormat] CloudStorageConfig filenameDatetimeFormat + * @property {google.pubsub.v1.CloudStorageConfig.ITextConfig|null} [textConfig] CloudStorageConfig textConfig + * @property {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null} [avroConfig] CloudStorageConfig avroConfig + * @property {google.protobuf.IDuration|null} [maxDuration] CloudStorageConfig maxDuration + * @property {number|Long|null} [maxBytes] CloudStorageConfig maxBytes + * @property {number|Long|null} [maxMessages] CloudStorageConfig maxMessages + * @property {google.pubsub.v1.CloudStorageConfig.State|null} [state] CloudStorageConfig state + * @property {string|null} [serviceAccountEmail] CloudStorageConfig serviceAccountEmail + */ + + /** + * Constructs a new CloudStorageConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a CloudStorageConfig. + * @implements ICloudStorageConfig + * @constructor + * @param {google.pubsub.v1.ICloudStorageConfig=} [properties] Properties to set + */ + function CloudStorageConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageConfig bucket. + * @member {string} bucket + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.bucket = ""; + + /** + * CloudStorageConfig filenamePrefix. + * @member {string} filenamePrefix + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.filenamePrefix = ""; + + /** + * CloudStorageConfig filenameSuffix. + * @member {string} filenameSuffix + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.filenameSuffix = ""; + + /** + * CloudStorageConfig filenameDatetimeFormat. + * @member {string} filenameDatetimeFormat + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.filenameDatetimeFormat = ""; + + /** + * CloudStorageConfig textConfig. + * @member {google.pubsub.v1.CloudStorageConfig.ITextConfig|null|undefined} textConfig + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.textConfig = null; + + /** + * CloudStorageConfig avroConfig. + * @member {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null|undefined} avroConfig + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.avroConfig = null; + + /** + * CloudStorageConfig maxDuration. + * @member {google.protobuf.IDuration|null|undefined} maxDuration + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.maxDuration = null; + + /** + * CloudStorageConfig maxBytes. + * @member {number|Long} maxBytes + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudStorageConfig maxMessages. + * @member {number|Long} maxMessages + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.maxMessages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloudStorageConfig state. + * @member {google.pubsub.v1.CloudStorageConfig.State} state + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.state = 0; + + /** + * CloudStorageConfig serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + CloudStorageConfig.prototype.serviceAccountEmail = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudStorageConfig outputFormat. + * @member {"textConfig"|"avroConfig"|undefined} outputFormat + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + */ + Object.defineProperty(CloudStorageConfig.prototype, "outputFormat", { + get: $util.oneOfGetter($oneOfFields = ["textConfig", "avroConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudStorageConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.ICloudStorageConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig instance + */ + CloudStorageConfig.create = function create(properties) { + return new CloudStorageConfig(properties); + }; + + /** + * Encodes the specified CloudStorageConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.ICloudStorageConfig} message CloudStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.filenamePrefix != null && Object.hasOwnProperty.call(message, "filenamePrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filenamePrefix); + if (message.filenameSuffix != null && Object.hasOwnProperty.call(message, "filenameSuffix")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filenameSuffix); + if (message.textConfig != null && Object.hasOwnProperty.call(message, "textConfig")) + $root.google.pubsub.v1.CloudStorageConfig.TextConfig.encode(message.textConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.avroConfig != null && Object.hasOwnProperty.call(message, "avroConfig")) + $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.encode(message.avroConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.maxDuration != null && Object.hasOwnProperty.call(message, "maxDuration")) + $root.google.protobuf.Duration.encode(message.maxDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxBytes); + if (message.maxMessages != null && Object.hasOwnProperty.call(message, "maxMessages")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.maxMessages); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.filenameDatetimeFormat != null && Object.hasOwnProperty.call(message, "filenameDatetimeFormat")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.filenameDatetimeFormat); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.serviceAccountEmail); + return writer; + }; + + /** + * Encodes the specified CloudStorageConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.ICloudStorageConfig} message CloudStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CloudStorageConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.filenamePrefix = reader.string(); + break; + } + case 3: { + message.filenameSuffix = reader.string(); + break; + } + case 10: { + message.filenameDatetimeFormat = reader.string(); + break; + } + case 4: { + message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.maxDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.maxBytes = reader.int64(); + break; + } + case 8: { + message.maxMessages = reader.int64(); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 11: { + message.serviceAccountEmail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageConfig message. + * @function verify + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.filenamePrefix != null && message.hasOwnProperty("filenamePrefix")) + if (!$util.isString(message.filenamePrefix)) + return "filenamePrefix: string expected"; + if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix")) + if (!$util.isString(message.filenameSuffix)) + return "filenameSuffix: string expected"; + if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat")) + if (!$util.isString(message.filenameDatetimeFormat)) + return "filenameDatetimeFormat: string expected"; + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + properties.outputFormat = 1; + { + var error = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.verify(message.textConfig); + if (error) + return "textConfig." + error; + } + } + if (message.avroConfig != null && message.hasOwnProperty("avroConfig")) { + if (properties.outputFormat === 1) + return "outputFormat: multiple values"; + properties.outputFormat = 1; + { + var error = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.verify(message.avroConfig); + if (error) + return "avroConfig." + error; + } + } + if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxDuration); + if (error) + return "maxDuration." + error; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high))) + return "maxBytes: integer|Long expected"; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + if (!$util.isInteger(message.maxMessages) && !(message.maxMessages && $util.isInteger(message.maxMessages.low) && $util.isInteger(message.maxMessages.high))) + return "maxMessages: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + return null; + }; + + /** + * Creates a CloudStorageConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CloudStorageConfig} CloudStorageConfig + */ + CloudStorageConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CloudStorageConfig) + return object; + var message = new $root.google.pubsub.v1.CloudStorageConfig(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.filenamePrefix != null) + message.filenamePrefix = String(object.filenamePrefix); + if (object.filenameSuffix != null) + message.filenameSuffix = String(object.filenameSuffix); + if (object.filenameDatetimeFormat != null) + message.filenameDatetimeFormat = String(object.filenameDatetimeFormat); + if (object.textConfig != null) { + if (typeof object.textConfig !== "object") + throw TypeError(".google.pubsub.v1.CloudStorageConfig.textConfig: object expected"); + message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.fromObject(object.textConfig); + } + if (object.avroConfig != null) { + if (typeof object.avroConfig !== "object") + throw TypeError(".google.pubsub.v1.CloudStorageConfig.avroConfig: object expected"); + message.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.fromObject(object.avroConfig); + } + if (object.maxDuration != null) { + if (typeof object.maxDuration !== "object") + throw TypeError(".google.pubsub.v1.CloudStorageConfig.maxDuration: object expected"); + message.maxDuration = $root.google.protobuf.Duration.fromObject(object.maxDuration); + } + if (object.maxBytes != null) + if ($util.Long) + (message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false; + else if (typeof object.maxBytes === "string") + message.maxBytes = parseInt(object.maxBytes, 10); + else if (typeof object.maxBytes === "number") + message.maxBytes = object.maxBytes; + else if (typeof object.maxBytes === "object") + message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber(); + if (object.maxMessages != null) + if ($util.Long) + (message.maxMessages = $util.Long.fromValue(object.maxMessages)).unsigned = false; + else if (typeof object.maxMessages === "string") + message.maxMessages = parseInt(object.maxMessages, 10); + else if (typeof object.maxMessages === "number") + message.maxMessages = object.maxMessages; + else if (typeof object.maxMessages === "object") + message.maxMessages = new $util.LongBits(object.maxMessages.low >>> 0, object.maxMessages.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "NOT_FOUND": + case 3: + message.state = 3; + break; + case "IN_TRANSIT_LOCATION_RESTRICTION": + case 4: + message.state = 4; + break; + case "SCHEMA_MISMATCH": + case 5: + message.state = 5; + break; + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + return message; + }; + + /** + * Creates a plain object from a CloudStorageConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig} message CloudStorageConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.filenamePrefix = ""; + object.filenameSuffix = ""; + object.maxDuration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxMessages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxMessages = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.filenameDatetimeFormat = ""; + object.serviceAccountEmail = ""; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.filenamePrefix != null && message.hasOwnProperty("filenamePrefix")) + object.filenamePrefix = message.filenamePrefix; + if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix")) + object.filenameSuffix = message.filenameSuffix; + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + object.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.toObject(message.textConfig, options); + if (options.oneofs) + object.outputFormat = "textConfig"; + } + if (message.avroConfig != null && message.hasOwnProperty("avroConfig")) { + object.avroConfig = $root.google.pubsub.v1.CloudStorageConfig.AvroConfig.toObject(message.avroConfig, options); + if (options.oneofs) + object.outputFormat = "avroConfig"; + } + if (message.maxDuration != null && message.hasOwnProperty("maxDuration")) + object.maxDuration = $root.google.protobuf.Duration.toObject(message.maxDuration, options); + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (typeof message.maxBytes === "number") + object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes; + else + object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + if (typeof message.maxMessages === "number") + object.maxMessages = options.longs === String ? String(message.maxMessages) : message.maxMessages; + else + object.maxMessages = options.longs === String ? $util.Long.prototype.toString.call(message.maxMessages) : options.longs === Number ? new $util.LongBits(message.maxMessages.low >>> 0, message.maxMessages.high >>> 0).toNumber() : message.maxMessages; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.CloudStorageConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.CloudStorageConfig.State[message.state] : message.state; + if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat")) + object.filenameDatetimeFormat = message.filenameDatetimeFormat; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + return object; + }; + + /** + * Converts this CloudStorageConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CloudStorageConfig + * @instance + * @returns {Object.} JSON object + */ + CloudStorageConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.CloudStorageConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig"; + }; + + CloudStorageConfig.TextConfig = (function() { + + /** + * Properties of a TextConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @interface ITextConfig + */ + + /** + * Constructs a new TextConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @classdesc Represents a TextConfig. + * @implements ITextConfig + * @constructor + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig=} [properties] Properties to set + */ + function TextConfig(properties) { + if (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 TextConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig instance + */ + TextConfig.create = function create(properties) { + return new TextConfig(properties); + }; + + /** + * Encodes the specified TextConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig} message TextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.TextConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.ITextConfig} message TextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CloudStorageConfig.TextConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextConfig message. + * @function verify + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CloudStorageConfig.TextConfig} TextConfig + */ + TextConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CloudStorageConfig.TextConfig) + return object; + return new $root.google.pubsub.v1.CloudStorageConfig.TextConfig(); + }; + + /** + * Creates a plain object from a TextConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.TextConfig} message TextConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @instance + * @returns {Object.} JSON object + */ + TextConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.CloudStorageConfig.TextConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig.TextConfig"; + }; + + return TextConfig; + })(); + + CloudStorageConfig.AvroConfig = (function() { + + /** + * Properties of an AvroConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @interface IAvroConfig + * @property {boolean|null} [writeMetadata] AvroConfig writeMetadata + * @property {boolean|null} [useTopicSchema] AvroConfig useTopicSchema + */ + + /** + * Constructs a new AvroConfig. + * @memberof google.pubsub.v1.CloudStorageConfig + * @classdesc Represents an AvroConfig. + * @implements IAvroConfig + * @constructor + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig=} [properties] Properties to set + */ + function AvroConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroConfig writeMetadata. + * @member {boolean} writeMetadata + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + */ + AvroConfig.prototype.writeMetadata = false; + + /** + * AvroConfig useTopicSchema. + * @member {boolean} useTopicSchema + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + */ + AvroConfig.prototype.useTopicSchema = false; + + /** + * Creates a new AvroConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig instance + */ + AvroConfig.create = function create(properties) { + return new AvroConfig(properties); + }; + + /** + * Encodes the specified AvroConfig message. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig} message AvroConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata); + if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema); + return writer; + }; + + /** + * Encodes the specified AvroConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.CloudStorageConfig.AvroConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.IAvroConfig} message AvroConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CloudStorageConfig.AvroConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.writeMetadata = reader.bool(); + break; + } + case 2: { + message.useTopicSchema = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroConfig message. + * @function verify + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + if (typeof message.writeMetadata !== "boolean") + return "writeMetadata: boolean expected"; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + if (typeof message.useTopicSchema !== "boolean") + return "useTopicSchema: boolean expected"; + return null; + }; + + /** + * Creates an AvroConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CloudStorageConfig.AvroConfig} AvroConfig + */ + AvroConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CloudStorageConfig.AvroConfig) + return object; + var message = new $root.google.pubsub.v1.CloudStorageConfig.AvroConfig(); + if (object.writeMetadata != null) + message.writeMetadata = Boolean(object.writeMetadata); + if (object.useTopicSchema != null) + message.useTopicSchema = Boolean(object.useTopicSchema); + return message; + }; + + /** + * Creates a plain object from an AvroConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {google.pubsub.v1.CloudStorageConfig.AvroConfig} message AvroConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.writeMetadata = false; + object.useTopicSchema = false; + } + if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata")) + object.writeMetadata = message.writeMetadata; + if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema")) + object.useTopicSchema = message.useTopicSchema; + return object; + }; + + /** + * Converts this AvroConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @instance + * @returns {Object.} JSON object + */ + AvroConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvroConfig + * @function getTypeUrl + * @memberof google.pubsub.v1.CloudStorageConfig.AvroConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CloudStorageConfig.AvroConfig"; + }; + + return AvroConfig; + })(); + + /** + * State enum. + * @name google.pubsub.v1.CloudStorageConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} NOT_FOUND=3 NOT_FOUND value + * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=4 IN_TRANSIT_LOCATION_RESTRICTION value + * @property {number} SCHEMA_MISMATCH=5 SCHEMA_MISMATCH value + */ + CloudStorageConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "NOT_FOUND"] = 3; + values[valuesById[4] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 4; + values[valuesById[5] = "SCHEMA_MISMATCH"] = 5; + return values; + })(); + + return CloudStorageConfig; + })(); + + v1.ReceivedMessage = (function() { + + /** + * Properties of a ReceivedMessage. + * @memberof google.pubsub.v1 + * @interface IReceivedMessage + * @property {string|null} [ackId] ReceivedMessage ackId + * @property {google.pubsub.v1.IPubsubMessage|null} [message] ReceivedMessage message + * @property {number|null} [deliveryAttempt] ReceivedMessage deliveryAttempt + */ + + /** + * Constructs a new ReceivedMessage. + * @memberof google.pubsub.v1 + * @classdesc Represents a ReceivedMessage. + * @implements IReceivedMessage + * @constructor + * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set + */ + function ReceivedMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceivedMessage ackId. + * @member {string} ackId + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.ackId = ""; + + /** + * ReceivedMessage message. + * @member {google.pubsub.v1.IPubsubMessage|null|undefined} message + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.message = null; + + /** + * ReceivedMessage deliveryAttempt. + * @member {number} deliveryAttempt + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.deliveryAttempt = 0; + + /** + * Creates a new ReceivedMessage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage instance + */ + ReceivedMessage.create = function create(properties) { + return new ReceivedMessage(properties); + }; + + /** + * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackId); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.pubsub.v1.PubsubMessage.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deliveryAttempt != null && Object.hasOwnProperty.call(message, "deliveryAttempt")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deliveryAttempt); + return writer; + }; + + /** + * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivedMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ReceivedMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ackId = reader.string(); + break; + } + case 2: { + message.message = $root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deliveryAttempt = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceivedMessage message. + * @function verify + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceivedMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (!$util.isString(message.ackId)) + return "ackId: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.pubsub.v1.PubsubMessage.verify(message.message); + if (error) + return "message." + error; + } + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + if (!$util.isInteger(message.deliveryAttempt)) + return "deliveryAttempt: integer expected"; + return null; + }; + + /** + * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + */ + ReceivedMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ReceivedMessage) + return object; + var message = new $root.google.pubsub.v1.ReceivedMessage(); + if (object.ackId != null) + message.ackId = String(object.ackId); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.pubsub.v1.ReceivedMessage.message: object expected"); + message.message = $root.google.pubsub.v1.PubsubMessage.fromObject(object.message); + } + if (object.deliveryAttempt != null) + message.deliveryAttempt = object.deliveryAttempt | 0; + return message; + }; + + /** + * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.ReceivedMessage} message ReceivedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceivedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ackId = ""; + object.message = null; + object.deliveryAttempt = 0; + } + if (message.ackId != null && message.hasOwnProperty("ackId")) + object.ackId = message.ackId; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.pubsub.v1.PubsubMessage.toObject(message.message, options); + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + object.deliveryAttempt = message.deliveryAttempt; + return object; + }; + + /** + * Converts this ReceivedMessage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + * @returns {Object.} JSON object + */ + ReceivedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceivedMessage + * @function getTypeUrl + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceivedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ReceivedMessage"; + }; + + return ReceivedMessage; + })(); + + v1.GetSubscriptionRequest = (function() { + + /** + * Properties of a GetSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IGetSubscriptionRequest + * @property {string|null} [subscription] GetSubscriptionRequest subscription + */ + + /** + * Constructs a new GetSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSubscriptionRequest. + * @implements IGetSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set + */ + function GetSubscriptionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @instance + */ + GetSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new GetSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest instance + */ + GetSubscriptionRequest.create = function create(properties) { + return new GetSubscriptionRequest(properties); + }; + + /** + * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubscriptionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + */ + GetSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.GetSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.GetSubscriptionRequest} message GetSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this GetSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetSubscriptionRequest"; + }; + + return GetSubscriptionRequest; + })(); + + v1.UpdateSubscriptionRequest = (function() { + + /** + * Properties of an UpdateSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateSubscriptionRequest + * @property {google.pubsub.v1.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask + */ + + /** + * Constructs a new UpdateSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateSubscriptionRequest. + * @implements IUpdateSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set + */ + function UpdateSubscriptionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSubscriptionRequest subscription. + * @member {google.pubsub.v1.ISubscription|null|undefined} subscription + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.subscription = null; + + /** + * UpdateSubscriptionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance + */ + UpdateSubscriptionRequest.create = function create(properties) { + return new UpdateSubscriptionRequest(properties); + }; + + /** + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + $root.google.pubsub.v1.Subscription.encode(message.subscription, 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 UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriptionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = $root.google.pubsub.v1.Subscription.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 UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.pubsub.v1.Subscription.verify(message.subscription); + if (error) + return "subscription." + 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 UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + */ + UpdateSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.subscription: object expected"); + message.subscription = $root.google.pubsub.v1.Subscription.fromObject(object.subscription); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.UpdateSubscriptionRequest} message UpdateSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = null; + object.updateMask = null; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.pubsub.v1.Subscription.toObject(message.subscription, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.UpdateSubscriptionRequest"; + }; + + return UpdateSubscriptionRequest; + })(); + + v1.ListSubscriptionsRequest = (function() { + + /** + * Properties of a ListSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @interface IListSubscriptionsRequest + * @property {string|null} [project] ListSubscriptionsRequest project + * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken + */ + + /** + * Constructs a new ListSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSubscriptionsRequest. + * @implements IListSubscriptionsRequest + * @constructor + * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set + */ + function ListSubscriptionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubscriptionsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.project = ""; + + /** + * ListSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageSize = 0; + + /** + * ListSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest instance + */ + ListSubscriptionsRequest.create = function create(properties) { + return new ListSubscriptionsRequest(properties); + }; + + /** + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscriptionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscriptionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + */ + ListSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSubscriptionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {google.pubsub.v1.ListSubscriptionsRequest} message ListSubscriptionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubscriptionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSubscriptionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSubscriptionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscriptionsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscriptionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSubscriptionsRequest"; + }; + + return ListSubscriptionsRequest; + })(); + + v1.ListSubscriptionsResponse = (function() { + + /** + * Properties of a ListSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @interface IListSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken + */ + + /** + * Constructs a new ListSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSubscriptionsResponse. + * @implements IListSubscriptionsResponse + * @constructor + * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set + */ + function ListSubscriptionsResponse(properties) { + this.subscriptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @instance + */ + ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; + + /** + * ListSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @instance + */ + ListSubscriptionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSubscriptionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse instance + */ + ListSubscriptionsResponse.create = function create(properties) { + return new ListSubscriptionsResponse(properties); + }; + + /** + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + $root.google.pubsub.v1.Subscription.encode(message.subscriptions[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 ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push($root.google.pubsub.v1.Subscription.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscriptionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscriptionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) { + var error = $root.google.pubsub.v1.Subscription.verify(message.subscriptions[i]); + if (error) + return "subscriptions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + */ + ListSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSubscriptionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) { + if (typeof object.subscriptions[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: object expected"); + message.subscriptions[i] = $root.google.pubsub.v1.Subscription.fromObject(object.subscriptions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {google.pubsub.v1.ListSubscriptionsResponse} message ListSubscriptionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubscriptionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = $root.google.pubsub.v1.Subscription.toObject(message.subscriptions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSubscriptionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSubscriptionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscriptionsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscriptionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSubscriptionsResponse"; + }; + + return ListSubscriptionsResponse; + })(); + + v1.DeleteSubscriptionRequest = (function() { + + /** + * Properties of a DeleteSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSubscriptionRequest + * @property {string|null} [subscription] DeleteSubscriptionRequest subscription + */ + + /** + * Constructs a new DeleteSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSubscriptionRequest. + * @implements IDeleteSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set + */ + function DeleteSubscriptionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @instance + */ + DeleteSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new DeleteSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance + */ + DeleteSubscriptionRequest.create = function create(properties) { + return new DeleteSubscriptionRequest(properties); + }; + + /** + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubscriptionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + */ + DeleteSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.DeleteSubscriptionRequest} message DeleteSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this DeleteSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSubscriptionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSubscriptionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSubscriptionRequest"; + }; + + return DeleteSubscriptionRequest; + })(); + + v1.ModifyPushConfigRequest = (function() { + + /** + * Properties of a ModifyPushConfigRequest. + * @memberof google.pubsub.v1 + * @interface IModifyPushConfigRequest + * @property {string|null} [subscription] ModifyPushConfigRequest subscription + * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] ModifyPushConfigRequest pushConfig + */ + + /** + * Constructs a new ModifyPushConfigRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ModifyPushConfigRequest. + * @implements IModifyPushConfigRequest + * @constructor + * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set + */ + function ModifyPushConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModifyPushConfigRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + */ + ModifyPushConfigRequest.prototype.subscription = ""; + + /** + * ModifyPushConfigRequest pushConfig. + * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + */ + ModifyPushConfigRequest.prototype.pushConfig = null; + + /** + * Creates a new ModifyPushConfigRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest instance + */ + ModifyPushConfigRequest.create = function create(properties) { + return new ModifyPushConfigRequest(properties); + }; + + /** + * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyPushConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig")) + $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyPushConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyPushConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyPushConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyPushConfigRequest message. + * @function verify + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyPushConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { + var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); + if (error) + return "pushConfig." + error; + } + return null; + }; + + /** + * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + */ + ModifyPushConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ModifyPushConfigRequest) + return object; + var message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.pushConfig != null) { + if (typeof object.pushConfig !== "object") + throw TypeError(".google.pubsub.v1.ModifyPushConfigRequest.pushConfig: object expected"); + message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.ModifyPushConfigRequest} message ModifyPushConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyPushConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.pushConfig = null; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + return object; + }; + + /** + * Converts this ModifyPushConfigRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyPushConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyPushConfigRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyPushConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ModifyPushConfigRequest"; + }; + + return ModifyPushConfigRequest; + })(); + + v1.PullRequest = (function() { + + /** + * Properties of a PullRequest. + * @memberof google.pubsub.v1 + * @interface IPullRequest + * @property {string|null} [subscription] PullRequest subscription + * @property {boolean|null} [returnImmediately] PullRequest returnImmediately + * @property {number|null} [maxMessages] PullRequest maxMessages + */ + + /** + * Constructs a new PullRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a PullRequest. + * @implements IPullRequest + * @constructor + * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set + */ + function PullRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PullRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.subscription = ""; + + /** + * PullRequest returnImmediately. + * @member {boolean} returnImmediately + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.returnImmediately = false; + + /** + * PullRequest maxMessages. + * @member {number} maxMessages + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.maxMessages = 0; + + /** + * Creates a new PullRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.PullRequest} PullRequest instance + */ + PullRequest.create = function create(properties) { + return new PullRequest(properties); + }; + + /** + * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.returnImmediately != null && Object.hasOwnProperty.call(message, "returnImmediately")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImmediately); + if (message.maxMessages != null && Object.hasOwnProperty.call(message, "maxMessages")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxMessages); + return writer; + }; + + /** + * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PullRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PullRequest} PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.returnImmediately = reader.bool(); + break; + } + case 3: { + message.maxMessages = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PullRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PullRequest} PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PullRequest message. + * @function verify + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + if (typeof message.returnImmediately !== "boolean") + return "returnImmediately: boolean expected"; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + if (!$util.isInteger(message.maxMessages)) + return "maxMessages: integer expected"; + return null; + }; + + /** + * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PullRequest} PullRequest + */ + PullRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PullRequest) + return object; + var message = new $root.google.pubsub.v1.PullRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.returnImmediately != null) + message.returnImmediately = Boolean(object.returnImmediately); + if (object.maxMessages != null) + message.maxMessages = object.maxMessages | 0; + return message; + }; + + /** + * Creates a plain object from a PullRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.PullRequest} message PullRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.returnImmediately = false; + object.maxMessages = 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + object.returnImmediately = message.returnImmediately; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + object.maxMessages = message.maxMessages; + return object; + }; + + /** + * Converts this PullRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PullRequest + * @instance + * @returns {Object.} JSON object + */ + PullRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PullRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PullRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PullRequest"; + }; + + return PullRequest; + })(); + + v1.PullResponse = (function() { + + /** + * Properties of a PullResponse. + * @memberof google.pubsub.v1 + * @interface IPullResponse + * @property {Array.|null} [receivedMessages] PullResponse receivedMessages + */ + + /** + * Constructs a new PullResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a PullResponse. + * @implements IPullResponse + * @constructor + * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set + */ + function PullResponse(properties) { + this.receivedMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PullResponse receivedMessages. + * @member {Array.} receivedMessages + * @memberof google.pubsub.v1.PullResponse + * @instance + */ + PullResponse.prototype.receivedMessages = $util.emptyArray; + + /** + * Creates a new PullResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.PullResponse} PullResponse instance + */ + PullResponse.create = function create(properties) { + return new PullResponse(properties); + }; + + /** + * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.receivedMessages != null && message.receivedMessages.length) + for (var i = 0; i < message.receivedMessages.length; ++i) + $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PullResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PullResponse} PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.receivedMessages && message.receivedMessages.length)) + message.receivedMessages = []; + message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PullResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PullResponse} PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PullResponse message. + * @function verify + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { + if (!Array.isArray(message.receivedMessages)) + return "receivedMessages: array expected"; + for (var i = 0; i < message.receivedMessages.length; ++i) { + var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); + if (error) + return "receivedMessages." + error; + } + } + return null; + }; + + /** + * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PullResponse} PullResponse + */ + PullResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PullResponse) + return object; + var message = new $root.google.pubsub.v1.PullResponse(); + if (object.receivedMessages) { + if (!Array.isArray(object.receivedMessages)) + throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: array expected"); + message.receivedMessages = []; + for (var i = 0; i < object.receivedMessages.length; ++i) { + if (typeof object.receivedMessages[i] !== "object") + throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: object expected"); + message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PullResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.PullResponse} message PullResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.receivedMessages = []; + if (message.receivedMessages && message.receivedMessages.length) { + object.receivedMessages = []; + for (var j = 0; j < message.receivedMessages.length; ++j) + object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); + } + return object; + }; + + /** + * Converts this PullResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PullResponse + * @instance + * @returns {Object.} JSON object + */ + PullResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PullResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PullResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.PullResponse"; + }; + + return PullResponse; + })(); + + v1.ModifyAckDeadlineRequest = (function() { + + /** + * Properties of a ModifyAckDeadlineRequest. + * @memberof google.pubsub.v1 + * @interface IModifyAckDeadlineRequest + * @property {string|null} [subscription] ModifyAckDeadlineRequest subscription + * @property {Array.|null} [ackIds] ModifyAckDeadlineRequest ackIds + * @property {number|null} [ackDeadlineSeconds] ModifyAckDeadlineRequest ackDeadlineSeconds + */ + + /** + * Constructs a new ModifyAckDeadlineRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ModifyAckDeadlineRequest. + * @implements IModifyAckDeadlineRequest + * @constructor + * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set + */ + function ModifyAckDeadlineRequest(properties) { + this.ackIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModifyAckDeadlineRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.subscription = ""; + + /** + * ModifyAckDeadlineRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.ackIds = $util.emptyArray; + + /** + * ModifyAckDeadlineRequest ackDeadlineSeconds. + * @member {number} ackDeadlineSeconds + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.ackDeadlineSeconds = 0; + + /** + * Creates a new ModifyAckDeadlineRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest instance + */ + ModifyAckDeadlineRequest.create = function create(properties) { + return new ModifyAckDeadlineRequest(properties); + }; + + /** + * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ackDeadlineSeconds); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ackIds[i]); + return writer; + }; + + /** + * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 4: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 3: { + message.ackDeadlineSeconds = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyAckDeadlineRequest message. + * @function verify + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyAckDeadlineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + if (!$util.isInteger(message.ackDeadlineSeconds)) + return "ackDeadlineSeconds: integer expected"; + return null; + }; + + /** + * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + */ + ModifyAckDeadlineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ModifyAckDeadlineRequest) + return object; + var message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.ModifyAckDeadlineRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.ackDeadlineSeconds != null) + message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; + return message; + }; + + /** + * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.ModifyAckDeadlineRequest} message ModifyAckDeadlineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyAckDeadlineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ackIds = []; + if (options.defaults) { + object.subscription = ""; + object.ackDeadlineSeconds = 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + object.ackDeadlineSeconds = message.ackDeadlineSeconds; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + return object; + }; + + /** + * Converts this ModifyAckDeadlineRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyAckDeadlineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyAckDeadlineRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyAckDeadlineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ModifyAckDeadlineRequest"; + }; + + return ModifyAckDeadlineRequest; + })(); + + v1.AcknowledgeRequest = (function() { + + /** + * Properties of an AcknowledgeRequest. + * @memberof google.pubsub.v1 + * @interface IAcknowledgeRequest + * @property {string|null} [subscription] AcknowledgeRequest subscription + * @property {Array.|null} [ackIds] AcknowledgeRequest ackIds + */ + + /** + * Constructs a new AcknowledgeRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an AcknowledgeRequest. + * @implements IAcknowledgeRequest + * @constructor + * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + */ + function AcknowledgeRequest(properties) { + this.ackIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcknowledgeRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + */ + AcknowledgeRequest.prototype.subscription = ""; + + /** + * AcknowledgeRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + */ + AcknowledgeRequest.prototype.ackIds = $util.emptyArray; + + /** + * Creates a new AcknowledgeRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest instance + */ + AcknowledgeRequest.create = function create(properties) { + return new AcknowledgeRequest(properties); + }; + + /** + * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + return writer; + }; + + /** + * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.AcknowledgeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcknowledgeRequest message. + * @function verify + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcknowledgeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + */ + AcknowledgeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.AcknowledgeRequest) + return object; + var message = new $root.google.pubsub.v1.AcknowledgeRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.AcknowledgeRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.AcknowledgeRequest} message AcknowledgeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcknowledgeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ackIds = []; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + return object; + }; + + /** + * Converts this AcknowledgeRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + * @returns {Object.} JSON object + */ + AcknowledgeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcknowledgeRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcknowledgeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.AcknowledgeRequest"; + }; + + return AcknowledgeRequest; + })(); + + v1.StreamingPullRequest = (function() { + + /** + * Properties of a StreamingPullRequest. + * @memberof google.pubsub.v1 + * @interface IStreamingPullRequest + * @property {string|null} [subscription] StreamingPullRequest subscription + * @property {Array.|null} [ackIds] StreamingPullRequest ackIds + * @property {Array.|null} [modifyDeadlineSeconds] StreamingPullRequest modifyDeadlineSeconds + * @property {Array.|null} [modifyDeadlineAckIds] StreamingPullRequest modifyDeadlineAckIds + * @property {number|null} [streamAckDeadlineSeconds] StreamingPullRequest streamAckDeadlineSeconds + * @property {string|null} [clientId] StreamingPullRequest clientId + * @property {number|Long|null} [maxOutstandingMessages] StreamingPullRequest maxOutstandingMessages + * @property {number|Long|null} [maxOutstandingBytes] StreamingPullRequest maxOutstandingBytes + * @property {number|Long|null} [protocolVersion] StreamingPullRequest protocolVersion + */ + + /** + * Constructs a new StreamingPullRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a StreamingPullRequest. + * @implements IStreamingPullRequest + * @constructor + * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set + */ + function StreamingPullRequest(properties) { + this.ackIds = []; + this.modifyDeadlineSeconds = []; + this.modifyDeadlineAckIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingPullRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.subscription = ""; + + /** + * StreamingPullRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.ackIds = $util.emptyArray; + + /** + * StreamingPullRequest modifyDeadlineSeconds. + * @member {Array.} modifyDeadlineSeconds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.modifyDeadlineSeconds = $util.emptyArray; + + /** + * StreamingPullRequest modifyDeadlineAckIds. + * @member {Array.} modifyDeadlineAckIds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.modifyDeadlineAckIds = $util.emptyArray; + + /** + * StreamingPullRequest streamAckDeadlineSeconds. + * @member {number} streamAckDeadlineSeconds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.streamAckDeadlineSeconds = 0; + + /** + * StreamingPullRequest clientId. + * @member {string} clientId + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.clientId = ""; + + /** + * StreamingPullRequest maxOutstandingMessages. + * @member {number|Long} maxOutstandingMessages + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.maxOutstandingMessages = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StreamingPullRequest maxOutstandingBytes. + * @member {number|Long} maxOutstandingBytes + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.maxOutstandingBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StreamingPullRequest protocolVersion. + * @member {number|Long} protocolVersion + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + */ + StreamingPullRequest.prototype.protocolVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StreamingPullRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest instance + */ + StreamingPullRequest.create = function create(properties) { + return new StreamingPullRequest(properties); + }; + + /** + * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + if (message.modifyDeadlineSeconds != null && message.modifyDeadlineSeconds.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) + writer.int32(message.modifyDeadlineSeconds[i]); + writer.ldelim(); + } + if (message.modifyDeadlineAckIds != null && message.modifyDeadlineAckIds.length) + for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modifyDeadlineAckIds[i]); + if (message.streamAckDeadlineSeconds != null && Object.hasOwnProperty.call(message, "streamAckDeadlineSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.streamAckDeadlineSeconds); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientId); + if (message.maxOutstandingMessages != null && Object.hasOwnProperty.call(message, "maxOutstandingMessages")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxOutstandingMessages); + if (message.maxOutstandingBytes != null && Object.hasOwnProperty.call(message, "maxOutstandingBytes")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.maxOutstandingBytes); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.protocolVersion); + return writer; + }; + + /** + * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 3: { + if (!(message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length)) + message.modifyDeadlineSeconds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modifyDeadlineSeconds.push(reader.int32()); + } else + message.modifyDeadlineSeconds.push(reader.int32()); + break; + } + case 4: { + if (!(message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length)) + message.modifyDeadlineAckIds = []; + message.modifyDeadlineAckIds.push(reader.string()); + break; + } + case 5: { + message.streamAckDeadlineSeconds = reader.int32(); + break; + } + case 6: { + message.clientId = reader.string(); + break; + } + case 7: { + message.maxOutstandingMessages = reader.int64(); + break; + } + case 8: { + message.maxOutstandingBytes = reader.int64(); + break; + } + case 10: { + message.protocolVersion = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingPullRequest message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingPullRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.modifyDeadlineSeconds != null && message.hasOwnProperty("modifyDeadlineSeconds")) { + if (!Array.isArray(message.modifyDeadlineSeconds)) + return "modifyDeadlineSeconds: array expected"; + for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) + if (!$util.isInteger(message.modifyDeadlineSeconds[i])) + return "modifyDeadlineSeconds: integer[] expected"; + } + if (message.modifyDeadlineAckIds != null && message.hasOwnProperty("modifyDeadlineAckIds")) { + if (!Array.isArray(message.modifyDeadlineAckIds)) + return "modifyDeadlineAckIds: array expected"; + for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) + if (!$util.isString(message.modifyDeadlineAckIds[i])) + return "modifyDeadlineAckIds: string[] expected"; + } + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + if (!$util.isInteger(message.streamAckDeadlineSeconds)) + return "streamAckDeadlineSeconds: integer expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages")) + if (!$util.isInteger(message.maxOutstandingMessages) && !(message.maxOutstandingMessages && $util.isInteger(message.maxOutstandingMessages.low) && $util.isInteger(message.maxOutstandingMessages.high))) + return "maxOutstandingMessages: integer|Long expected"; + if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes")) + if (!$util.isInteger(message.maxOutstandingBytes) && !(message.maxOutstandingBytes && $util.isInteger(message.maxOutstandingBytes.low) && $util.isInteger(message.maxOutstandingBytes.high))) + return "maxOutstandingBytes: integer|Long expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion) && !(message.protocolVersion && $util.isInteger(message.protocolVersion.low) && $util.isInteger(message.protocolVersion.high))) + return "protocolVersion: integer|Long expected"; + return null; + }; + + /** + * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest + */ + StreamingPullRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullRequest) + return object; + var message = new $root.google.pubsub.v1.StreamingPullRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.modifyDeadlineSeconds) { + if (!Array.isArray(object.modifyDeadlineSeconds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineSeconds: array expected"); + message.modifyDeadlineSeconds = []; + for (var i = 0; i < object.modifyDeadlineSeconds.length; ++i) + message.modifyDeadlineSeconds[i] = object.modifyDeadlineSeconds[i] | 0; + } + if (object.modifyDeadlineAckIds) { + if (!Array.isArray(object.modifyDeadlineAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineAckIds: array expected"); + message.modifyDeadlineAckIds = []; + for (var i = 0; i < object.modifyDeadlineAckIds.length; ++i) + message.modifyDeadlineAckIds[i] = String(object.modifyDeadlineAckIds[i]); + } + if (object.streamAckDeadlineSeconds != null) + message.streamAckDeadlineSeconds = object.streamAckDeadlineSeconds | 0; + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.maxOutstandingMessages != null) + if ($util.Long) + (message.maxOutstandingMessages = $util.Long.fromValue(object.maxOutstandingMessages)).unsigned = false; + else if (typeof object.maxOutstandingMessages === "string") + message.maxOutstandingMessages = parseInt(object.maxOutstandingMessages, 10); + else if (typeof object.maxOutstandingMessages === "number") + message.maxOutstandingMessages = object.maxOutstandingMessages; + else if (typeof object.maxOutstandingMessages === "object") + message.maxOutstandingMessages = new $util.LongBits(object.maxOutstandingMessages.low >>> 0, object.maxOutstandingMessages.high >>> 0).toNumber(); + if (object.maxOutstandingBytes != null) + if ($util.Long) + (message.maxOutstandingBytes = $util.Long.fromValue(object.maxOutstandingBytes)).unsigned = false; + else if (typeof object.maxOutstandingBytes === "string") + message.maxOutstandingBytes = parseInt(object.maxOutstandingBytes, 10); + else if (typeof object.maxOutstandingBytes === "number") + message.maxOutstandingBytes = object.maxOutstandingBytes; + else if (typeof object.maxOutstandingBytes === "object") + message.maxOutstandingBytes = new $util.LongBits(object.maxOutstandingBytes.low >>> 0, object.maxOutstandingBytes.high >>> 0).toNumber(); + if (object.protocolVersion != null) + if ($util.Long) + (message.protocolVersion = $util.Long.fromValue(object.protocolVersion)).unsigned = false; + else if (typeof object.protocolVersion === "string") + message.protocolVersion = parseInt(object.protocolVersion, 10); + else if (typeof object.protocolVersion === "number") + message.protocolVersion = object.protocolVersion; + else if (typeof object.protocolVersion === "object") + message.protocolVersion = new $util.LongBits(object.protocolVersion.low >>> 0, object.protocolVersion.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {google.pubsub.v1.StreamingPullRequest} message StreamingPullRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingPullRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.modifyDeadlineSeconds = []; + object.modifyDeadlineAckIds = []; + } + if (options.defaults) { + object.subscription = ""; + object.streamAckDeadlineSeconds = 0; + object.clientId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxOutstandingMessages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxOutstandingMessages = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxOutstandingBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxOutstandingBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.protocolVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.protocolVersion = options.longs === String ? "0" : 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length) { + object.modifyDeadlineSeconds = []; + for (var j = 0; j < message.modifyDeadlineSeconds.length; ++j) + object.modifyDeadlineSeconds[j] = message.modifyDeadlineSeconds[j]; + } + if (message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length) { + object.modifyDeadlineAckIds = []; + for (var j = 0; j < message.modifyDeadlineAckIds.length; ++j) + object.modifyDeadlineAckIds[j] = message.modifyDeadlineAckIds[j]; + } + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + object.streamAckDeadlineSeconds = message.streamAckDeadlineSeconds; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages")) + if (typeof message.maxOutstandingMessages === "number") + object.maxOutstandingMessages = options.longs === String ? String(message.maxOutstandingMessages) : message.maxOutstandingMessages; + else + object.maxOutstandingMessages = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingMessages) : options.longs === Number ? new $util.LongBits(message.maxOutstandingMessages.low >>> 0, message.maxOutstandingMessages.high >>> 0).toNumber() : message.maxOutstandingMessages; + if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes")) + if (typeof message.maxOutstandingBytes === "number") + object.maxOutstandingBytes = options.longs === String ? String(message.maxOutstandingBytes) : message.maxOutstandingBytes; + else + object.maxOutstandingBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingBytes) : options.longs === Number ? new $util.LongBits(message.maxOutstandingBytes.low >>> 0, message.maxOutstandingBytes.high >>> 0).toNumber() : message.maxOutstandingBytes; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (typeof message.protocolVersion === "number") + object.protocolVersion = options.longs === String ? String(message.protocolVersion) : message.protocolVersion; + else + object.protocolVersion = options.longs === String ? $util.Long.prototype.toString.call(message.protocolVersion) : options.longs === Number ? new $util.LongBits(message.protocolVersion.low >>> 0, message.protocolVersion.high >>> 0).toNumber() : message.protocolVersion; + return object; + }; + + /** + * Converts this StreamingPullRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingPullRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingPullRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingPullRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullRequest"; + }; + + return StreamingPullRequest; + })(); + + v1.StreamingPullResponse = (function() { + + /** + * Properties of a StreamingPullResponse. + * @memberof google.pubsub.v1 + * @interface IStreamingPullResponse + * @property {Array.|null} [receivedMessages] StreamingPullResponse receivedMessages + * @property {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null} [acknowledgeConfirmation] StreamingPullResponse acknowledgeConfirmation + * @property {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null} [modifyAckDeadlineConfirmation] StreamingPullResponse modifyAckDeadlineConfirmation + * @property {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null} [subscriptionProperties] StreamingPullResponse subscriptionProperties + */ + + /** + * Constructs a new StreamingPullResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a StreamingPullResponse. + * @implements IStreamingPullResponse + * @constructor + * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set + */ + function StreamingPullResponse(properties) { + this.receivedMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingPullResponse receivedMessages. + * @member {Array.} receivedMessages + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.receivedMessages = $util.emptyArray; + + /** + * StreamingPullResponse acknowledgeConfirmation. + * @member {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null|undefined} acknowledgeConfirmation + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.acknowledgeConfirmation = null; + + /** + * StreamingPullResponse modifyAckDeadlineConfirmation. + * @member {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null|undefined} modifyAckDeadlineConfirmation + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.modifyAckDeadlineConfirmation = null; + + /** + * StreamingPullResponse subscriptionProperties. + * @member {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null|undefined} subscriptionProperties + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + */ + StreamingPullResponse.prototype.subscriptionProperties = null; + + /** + * Creates a new StreamingPullResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse instance + */ + StreamingPullResponse.create = function create(properties) { + return new StreamingPullResponse(properties); + }; + + /** + * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.receivedMessages != null && message.receivedMessages.length) + for (var i = 0; i < message.receivedMessages.length; ++i) + $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modifyAckDeadlineConfirmation != null && Object.hasOwnProperty.call(message, "modifyAckDeadlineConfirmation")) + $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.encode(message.modifyAckDeadlineConfirmation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subscriptionProperties != null && Object.hasOwnProperty.call(message, "subscriptionProperties")) + $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.encode(message.subscriptionProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.acknowledgeConfirmation != null && Object.hasOwnProperty.call(message, "acknowledgeConfirmation")) + $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.encode(message.acknowledgeConfirmation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingPullResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.receivedMessages && message.receivedMessages.length)) + message.receivedMessages = []; + message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); + break; + } + case 5: { + message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingPullResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingPullResponse message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingPullResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { + if (!Array.isArray(message.receivedMessages)) + return "receivedMessages: array expected"; + for (var i = 0; i < message.receivedMessages.length; ++i) { + var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); + if (error) + return "receivedMessages." + error; + } + } + if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) { + var error = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify(message.acknowledgeConfirmation); + if (error) + return "acknowledgeConfirmation." + error; + } + if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) { + var error = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify(message.modifyAckDeadlineConfirmation); + if (error) + return "modifyAckDeadlineConfirmation." + error; + } + if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) { + var error = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify(message.subscriptionProperties); + if (error) + return "subscriptionProperties." + error; + } + return null; + }; + + /** + * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse + */ + StreamingPullResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse(); + if (object.receivedMessages) { + if (!Array.isArray(object.receivedMessages)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: array expected"); + message.receivedMessages = []; + for (var i = 0; i < object.receivedMessages.length; ++i) { + if (typeof object.receivedMessages[i] !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: object expected"); + message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); + } + } + if (object.acknowledgeConfirmation != null) { + if (typeof object.acknowledgeConfirmation !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.acknowledgeConfirmation: object expected"); + message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.fromObject(object.acknowledgeConfirmation); + } + if (object.modifyAckDeadlineConfirmation != null) { + if (typeof object.modifyAckDeadlineConfirmation !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.modifyAckDeadlineConfirmation: object expected"); + message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.fromObject(object.modifyAckDeadlineConfirmation); + } + if (object.subscriptionProperties != null) { + if (typeof object.subscriptionProperties !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.subscriptionProperties: object expected"); + message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.fromObject(object.subscriptionProperties); + } + return message; + }; + + /** + * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {google.pubsub.v1.StreamingPullResponse} message StreamingPullResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingPullResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.receivedMessages = []; + if (options.defaults) { + object.modifyAckDeadlineConfirmation = null; + object.subscriptionProperties = null; + object.acknowledgeConfirmation = null; + } + if (message.receivedMessages && message.receivedMessages.length) { + object.receivedMessages = []; + for (var j = 0; j < message.receivedMessages.length; ++j) + object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); + } + if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) + object.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.toObject(message.modifyAckDeadlineConfirmation, options); + if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) + object.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.toObject(message.subscriptionProperties, options); + if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) + object.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.toObject(message.acknowledgeConfirmation, options); + return object; + }; + + /** + * Converts this StreamingPullResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingPullResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingPullResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingPullResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse"; + }; + + StreamingPullResponse.AcknowledgeConfirmation = (function() { + + /** + * Properties of an AcknowledgeConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @interface IAcknowledgeConfirmation + * @property {Array.|null} [ackIds] AcknowledgeConfirmation ackIds + * @property {Array.|null} [invalidAckIds] AcknowledgeConfirmation invalidAckIds + * @property {Array.|null} [unorderedAckIds] AcknowledgeConfirmation unorderedAckIds + * @property {Array.|null} [temporaryFailedAckIds] AcknowledgeConfirmation temporaryFailedAckIds + */ + + /** + * Constructs a new AcknowledgeConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @classdesc Represents an AcknowledgeConfirmation. + * @implements IAcknowledgeConfirmation + * @constructor + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set + */ + function AcknowledgeConfirmation(properties) { + this.ackIds = []; + this.invalidAckIds = []; + this.unorderedAckIds = []; + this.temporaryFailedAckIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcknowledgeConfirmation ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.ackIds = $util.emptyArray; + + /** + * AcknowledgeConfirmation invalidAckIds. + * @member {Array.} invalidAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.invalidAckIds = $util.emptyArray; + + /** + * AcknowledgeConfirmation unorderedAckIds. + * @member {Array.} unorderedAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.unorderedAckIds = $util.emptyArray; + + /** + * AcknowledgeConfirmation temporaryFailedAckIds. + * @member {Array.} temporaryFailedAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + */ + AcknowledgeConfirmation.prototype.temporaryFailedAckIds = $util.emptyArray; + + /** + * Creates a new AcknowledgeConfirmation instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation instance + */ + AcknowledgeConfirmation.create = function create(properties) { + return new AcknowledgeConfirmation(properties); + }; + + /** + * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeConfirmation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]); + if (message.invalidAckIds != null && message.invalidAckIds.length) + for (var i = 0; i < message.invalidAckIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]); + if (message.unorderedAckIds != null && message.unorderedAckIds.length) + for (var i = 0; i < message.unorderedAckIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unorderedAckIds[i]); + if (message.temporaryFailedAckIds != null && message.temporaryFailedAckIds.length) + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.temporaryFailedAckIds[i]); + return writer; + }; + + /** + * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeConfirmation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeConfirmation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 2: { + if (!(message.invalidAckIds && message.invalidAckIds.length)) + message.invalidAckIds = []; + message.invalidAckIds.push(reader.string()); + break; + } + case 3: { + if (!(message.unorderedAckIds && message.unorderedAckIds.length)) + message.unorderedAckIds = []; + message.unorderedAckIds.push(reader.string()); + break; + } + case 4: { + if (!(message.temporaryFailedAckIds && message.temporaryFailedAckIds.length)) + message.temporaryFailedAckIds = []; + message.temporaryFailedAckIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeConfirmation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcknowledgeConfirmation message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcknowledgeConfirmation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) { + if (!Array.isArray(message.invalidAckIds)) + return "invalidAckIds: array expected"; + for (var i = 0; i < message.invalidAckIds.length; ++i) + if (!$util.isString(message.invalidAckIds[i])) + return "invalidAckIds: string[] expected"; + } + if (message.unorderedAckIds != null && message.hasOwnProperty("unorderedAckIds")) { + if (!Array.isArray(message.unorderedAckIds)) + return "unorderedAckIds: array expected"; + for (var i = 0; i < message.unorderedAckIds.length; ++i) + if (!$util.isString(message.unorderedAckIds[i])) + return "unorderedAckIds: string[] expected"; + } + if (message.temporaryFailedAckIds != null && message.hasOwnProperty("temporaryFailedAckIds")) { + if (!Array.isArray(message.temporaryFailedAckIds)) + return "temporaryFailedAckIds: array expected"; + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + if (!$util.isString(message.temporaryFailedAckIds[i])) + return "temporaryFailedAckIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation + */ + AcknowledgeConfirmation.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.invalidAckIds) { + if (!Array.isArray(object.invalidAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.invalidAckIds: array expected"); + message.invalidAckIds = []; + for (var i = 0; i < object.invalidAckIds.length; ++i) + message.invalidAckIds[i] = String(object.invalidAckIds[i]); + } + if (object.unorderedAckIds) { + if (!Array.isArray(object.unorderedAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.unorderedAckIds: array expected"); + message.unorderedAckIds = []; + for (var i = 0; i < object.unorderedAckIds.length; ++i) + message.unorderedAckIds[i] = String(object.unorderedAckIds[i]); + } + if (object.temporaryFailedAckIds) { + if (!Array.isArray(object.temporaryFailedAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.temporaryFailedAckIds: array expected"); + message.temporaryFailedAckIds = []; + for (var i = 0; i < object.temporaryFailedAckIds.length; ++i) + message.temporaryFailedAckIds[i] = String(object.temporaryFailedAckIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} message AcknowledgeConfirmation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcknowledgeConfirmation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.invalidAckIds = []; + object.unorderedAckIds = []; + object.temporaryFailedAckIds = []; + } + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.invalidAckIds && message.invalidAckIds.length) { + object.invalidAckIds = []; + for (var j = 0; j < message.invalidAckIds.length; ++j) + object.invalidAckIds[j] = message.invalidAckIds[j]; + } + if (message.unorderedAckIds && message.unorderedAckIds.length) { + object.unorderedAckIds = []; + for (var j = 0; j < message.unorderedAckIds.length; ++j) + object.unorderedAckIds[j] = message.unorderedAckIds[j]; + } + if (message.temporaryFailedAckIds && message.temporaryFailedAckIds.length) { + object.temporaryFailedAckIds = []; + for (var j = 0; j < message.temporaryFailedAckIds.length; ++j) + object.temporaryFailedAckIds[j] = message.temporaryFailedAckIds[j]; + } + return object; + }; + + /** + * Converts this AcknowledgeConfirmation to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @instance + * @returns {Object.} JSON object + */ + AcknowledgeConfirmation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcknowledgeConfirmation + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcknowledgeConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation"; + }; + + return AcknowledgeConfirmation; + })(); + + StreamingPullResponse.ModifyAckDeadlineConfirmation = (function() { + + /** + * Properties of a ModifyAckDeadlineConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @interface IModifyAckDeadlineConfirmation + * @property {Array.|null} [ackIds] ModifyAckDeadlineConfirmation ackIds + * @property {Array.|null} [invalidAckIds] ModifyAckDeadlineConfirmation invalidAckIds + * @property {Array.|null} [temporaryFailedAckIds] ModifyAckDeadlineConfirmation temporaryFailedAckIds + */ + + /** + * Constructs a new ModifyAckDeadlineConfirmation. + * @memberof google.pubsub.v1.StreamingPullResponse + * @classdesc Represents a ModifyAckDeadlineConfirmation. + * @implements IModifyAckDeadlineConfirmation + * @constructor + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set + */ + function ModifyAckDeadlineConfirmation(properties) { + this.ackIds = []; + this.invalidAckIds = []; + this.temporaryFailedAckIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModifyAckDeadlineConfirmation ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + */ + ModifyAckDeadlineConfirmation.prototype.ackIds = $util.emptyArray; + + /** + * ModifyAckDeadlineConfirmation invalidAckIds. + * @member {Array.} invalidAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + */ + ModifyAckDeadlineConfirmation.prototype.invalidAckIds = $util.emptyArray; + + /** + * ModifyAckDeadlineConfirmation temporaryFailedAckIds. + * @member {Array.} temporaryFailedAckIds + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + */ + ModifyAckDeadlineConfirmation.prototype.temporaryFailedAckIds = $util.emptyArray; + + /** + * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation instance + */ + ModifyAckDeadlineConfirmation.create = function create(properties) { + return new ModifyAckDeadlineConfirmation(properties); + }; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineConfirmation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]); + if (message.invalidAckIds != null && message.invalidAckIds.length) + for (var i = 0; i < message.invalidAckIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]); + if (message.temporaryFailedAckIds != null && message.temporaryFailedAckIds.length) + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.temporaryFailedAckIds[i]); + return writer; + }; + + /** + * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineConfirmation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineConfirmation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + } + case 2: { + if (!(message.invalidAckIds && message.invalidAckIds.length)) + message.invalidAckIds = []; + message.invalidAckIds.push(reader.string()); + break; + } + case 3: { + if (!(message.temporaryFailedAckIds && message.temporaryFailedAckIds.length)) + message.temporaryFailedAckIds = []; + message.temporaryFailedAckIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineConfirmation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModifyAckDeadlineConfirmation message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyAckDeadlineConfirmation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) { + if (!Array.isArray(message.invalidAckIds)) + return "invalidAckIds: array expected"; + for (var i = 0; i < message.invalidAckIds.length; ++i) + if (!$util.isString(message.invalidAckIds[i])) + return "invalidAckIds: string[] expected"; + } + if (message.temporaryFailedAckIds != null && message.hasOwnProperty("temporaryFailedAckIds")) { + if (!Array.isArray(message.temporaryFailedAckIds)) + return "temporaryFailedAckIds: array expected"; + for (var i = 0; i < message.temporaryFailedAckIds.length; ++i) + if (!$util.isString(message.temporaryFailedAckIds[i])) + return "temporaryFailedAckIds: string[] expected"; + } + return null; + }; + + /** + * Creates a ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation + */ + ModifyAckDeadlineConfirmation.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.invalidAckIds) { + if (!Array.isArray(object.invalidAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.invalidAckIds: array expected"); + message.invalidAckIds = []; + for (var i = 0; i < object.invalidAckIds.length; ++i) + message.invalidAckIds[i] = String(object.invalidAckIds[i]); + } + if (object.temporaryFailedAckIds) { + if (!Array.isArray(object.temporaryFailedAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.temporaryFailedAckIds: array expected"); + message.temporaryFailedAckIds = []; + for (var i = 0; i < object.temporaryFailedAckIds.length; ++i) + message.temporaryFailedAckIds[i] = String(object.temporaryFailedAckIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyAckDeadlineConfirmation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.invalidAckIds = []; + object.temporaryFailedAckIds = []; + } + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.invalidAckIds && message.invalidAckIds.length) { + object.invalidAckIds = []; + for (var j = 0; j < message.invalidAckIds.length; ++j) + object.invalidAckIds[j] = message.invalidAckIds[j]; + } + if (message.temporaryFailedAckIds && message.temporaryFailedAckIds.length) { + object.temporaryFailedAckIds = []; + for (var j = 0; j < message.temporaryFailedAckIds.length; ++j) + object.temporaryFailedAckIds[j] = message.temporaryFailedAckIds[j]; + } + return object; + }; + + /** + * Converts this ModifyAckDeadlineConfirmation to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @instance + * @returns {Object.} JSON object + */ + ModifyAckDeadlineConfirmation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModifyAckDeadlineConfirmation + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModifyAckDeadlineConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation"; + }; + + return ModifyAckDeadlineConfirmation; + })(); + + StreamingPullResponse.SubscriptionProperties = (function() { + + /** + * Properties of a SubscriptionProperties. + * @memberof google.pubsub.v1.StreamingPullResponse + * @interface ISubscriptionProperties + * @property {boolean|null} [exactlyOnceDeliveryEnabled] SubscriptionProperties exactlyOnceDeliveryEnabled + * @property {boolean|null} [messageOrderingEnabled] SubscriptionProperties messageOrderingEnabled + */ + + /** + * Constructs a new SubscriptionProperties. + * @memberof google.pubsub.v1.StreamingPullResponse + * @classdesc Represents a SubscriptionProperties. + * @implements ISubscriptionProperties + * @constructor + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set + */ + function SubscriptionProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriptionProperties exactlyOnceDeliveryEnabled. + * @member {boolean} exactlyOnceDeliveryEnabled + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @instance + */ + SubscriptionProperties.prototype.exactlyOnceDeliveryEnabled = false; + + /** + * SubscriptionProperties messageOrderingEnabled. + * @member {boolean} messageOrderingEnabled + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @instance + */ + SubscriptionProperties.prototype.messageOrderingEnabled = false; + + /** + * Creates a new SubscriptionProperties instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties instance + */ + SubscriptionProperties.create = function create(properties) { + return new SubscriptionProperties(properties); + }; + + /** + * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptionProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exactlyOnceDeliveryEnabled != null && Object.hasOwnProperty.call(message, "exactlyOnceDeliveryEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.exactlyOnceDeliveryEnabled); + if (message.messageOrderingEnabled != null && Object.hasOwnProperty.call(message, "messageOrderingEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.messageOrderingEnabled); + return writer; + }; + + /** + * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptionProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptionProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.exactlyOnceDeliveryEnabled = reader.bool(); + break; + } + case 2: { + message.messageOrderingEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptionProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriptionProperties message. + * @function verify + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriptionProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled")) + if (typeof message.exactlyOnceDeliveryEnabled !== "boolean") + return "exactlyOnceDeliveryEnabled: boolean expected"; + if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled")) + if (typeof message.messageOrderingEnabled !== "boolean") + return "messageOrderingEnabled: boolean expected"; + return null; + }; + + /** + * Creates a SubscriptionProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties + */ + SubscriptionProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) + return object; + var message = new $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); + if (object.exactlyOnceDeliveryEnabled != null) + message.exactlyOnceDeliveryEnabled = Boolean(object.exactlyOnceDeliveryEnabled); + if (object.messageOrderingEnabled != null) + message.messageOrderingEnabled = Boolean(object.messageOrderingEnabled); + return message; + }; + + /** + * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} message SubscriptionProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriptionProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exactlyOnceDeliveryEnabled = false; + object.messageOrderingEnabled = false; + } + if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled")) + object.exactlyOnceDeliveryEnabled = message.exactlyOnceDeliveryEnabled; + if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled")) + object.messageOrderingEnabled = message.messageOrderingEnabled; + return object; + }; + + /** + * Converts this SubscriptionProperties to JSON. + * @function toJSON + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @instance + * @returns {Object.} JSON object + */ + SubscriptionProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriptionProperties + * @function getTypeUrl + * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriptionProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.StreamingPullResponse.SubscriptionProperties"; + }; + + return SubscriptionProperties; + })(); + + return StreamingPullResponse; + })(); + + v1.CreateSnapshotRequest = (function() { + + /** + * Properties of a CreateSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface ICreateSnapshotRequest + * @property {string|null} [name] CreateSnapshotRequest name + * @property {string|null} [subscription] CreateSnapshotRequest subscription + * @property {Object.|null} [labels] CreateSnapshotRequest labels + * @property {Object.|null} [tags] CreateSnapshotRequest tags + */ + + /** + * Constructs a new CreateSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CreateSnapshotRequest. + * @implements ICreateSnapshotRequest + * @constructor + * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set + */ + function CreateSnapshotRequest(properties) { + this.labels = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSnapshotRequest name. + * @member {string} name + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.name = ""; + + /** + * CreateSnapshotRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.subscription = ""; + + /** + * CreateSnapshotRequest labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.labels = $util.emptyObject; + + /** + * CreateSnapshotRequest tags. + * @member {Object.} tags + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.tags = $util.emptyObject; + + /** + * Creates a new CreateSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest instance + */ + CreateSnapshotRequest.create = function create(properties) { + return new CreateSnapshotRequest(properties); + }; + + /** + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CreateSnapshotRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.subscription = reader.string(); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 4: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + */ + CreateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CreateSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.CreateSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {google.pubsub.v1.CreateSnapshotRequest} message CreateSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.subscription = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + return object; + }; + + /** + * Converts this CreateSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CreateSnapshotRequest"; + }; + + return CreateSnapshotRequest; + })(); + + v1.UpdateSnapshotRequest = (function() { + + /** + * Properties of an UpdateSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateSnapshotRequest + * @property {google.pubsub.v1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask + */ + + /** + * Constructs a new UpdateSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateSnapshotRequest. + * @implements IUpdateSnapshotRequest + * @constructor + * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set + */ + function UpdateSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSnapshotRequest snapshot. + * @member {google.pubsub.v1.ISnapshot|null|undefined} snapshot + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.snapshot = null; + + /** + * UpdateSnapshotRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest instance + */ + UpdateSnapshotRequest.create = function create(properties) { + return new UpdateSnapshotRequest(properties); + }; + + /** + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.pubsub.v1.Snapshot.encode(message.snapshot, 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 UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.snapshot = $root.google.pubsub.v1.Snapshot.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 UpdateSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + 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 UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest + */ + UpdateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.snapshot: object expected"); + message.snapshot = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshot); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {google.pubsub.v1.UpdateSnapshotRequest} message UpdateSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshot = null; + object.updateMask = null; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.pubsub.v1.Snapshot.toObject(message.snapshot, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.UpdateSnapshotRequest"; + }; + + return UpdateSnapshotRequest; + })(); + + v1.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.pubsub.v1 + * @interface ISnapshot + * @property {string|null} [name] Snapshot name + * @property {string|null} [topic] Snapshot topic + * @property {google.protobuf.ITimestamp|null} [expireTime] Snapshot expireTime + * @property {Object.|null} [labels] Snapshot labels + */ + + /** + * Constructs a new Snapshot. + * @memberof google.pubsub.v1 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot name. + * @member {string} name + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.name = ""; + + /** + * Snapshot topic. + * @member {string} topic + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.topic = ""; + + /** + * Snapshot expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.expireTime = null; + + /** + * Snapshot labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.labels = $util.emptyObject; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set + * @returns {google.pubsub.v1.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Snapshot(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.topic = reader.string(); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Snapshot) + return object; + var message = new $root.google.pubsub.v1.Snapshot(); + if (object.name != null) + message.name = String(object.name); + if (object.topic != null) + message.topic = String(object.topic); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.pubsub.v1.Snapshot.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Snapshot.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {google.pubsub.v1.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.topic = ""; + object.expireTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Snapshot + * @function getTypeUrl + * @memberof google.pubsub.v1.Snapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Snapshot"; + }; + + return Snapshot; + })(); + + v1.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IGetSnapshotRequest + * @property {string|null} [snapshot] GetSnapshotRequest snapshot + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.snapshot = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.snapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + return null; + }; + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.GetSnapshotRequest(); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {google.pubsub.v1.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshot = ""; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; + return object; + }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetSnapshotRequest"; + }; + + return GetSnapshotRequest; + })(); + + v1.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.pubsub.v1 + * @interface IListSnapshotsRequest + * @property {string|null} [project] ListSnapshotsRequest project + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.project = ""; + + /** + * ListSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSnapshotsRequest) + return object; + var message = new $root.google.pubsub.v1.ListSnapshotsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {google.pubsub.v1.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSnapshotsRequest"; + }; + + return ListSnapshotsRequest; + })(); + + v1.ListSnapshotsResponse = (function() { + + /** + * Properties of a ListSnapshotsResponse. + * @memberof google.pubsub.v1 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListSnapshotsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse + * @constructor + * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set + */ + function ListSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse instance + */ + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.pubsub.v1.Snapshot.encode(message.snapshots[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 ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse + */ + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSnapshotsResponse) + return object; + var message = new $root.google.pubsub.v1.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshots[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {google.pubsub.v1.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.pubsub.v1.Snapshot.toObject(message.snapshots[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSnapshotsResponse"; + }; + + return ListSnapshotsResponse; + })(); + + v1.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSnapshotRequest + * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.snapshot = ""; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.snapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + return null; + }; + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {google.pubsub.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshot = ""; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; + return object; + }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSnapshotRequest"; + }; + + return DeleteSnapshotRequest; + })(); + + v1.SeekRequest = (function() { + + /** + * Properties of a SeekRequest. + * @memberof google.pubsub.v1 + * @interface ISeekRequest + * @property {string|null} [subscription] SeekRequest subscription + * @property {google.protobuf.ITimestamp|null} [time] SeekRequest time + * @property {string|null} [snapshot] SeekRequest snapshot + */ + + /** + * Constructs a new SeekRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a SeekRequest. + * @implements ISeekRequest + * @constructor + * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set + */ + function SeekRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SeekRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + SeekRequest.prototype.subscription = ""; + + /** + * SeekRequest time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + SeekRequest.prototype.time = null; + + /** + * SeekRequest snapshot. + * @member {string|null|undefined} snapshot + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + SeekRequest.prototype.snapshot = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SeekRequest target. + * @member {"time"|"snapshot"|undefined} target + * @memberof google.pubsub.v1.SeekRequest + * @instance + */ + Object.defineProperty(SeekRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["time", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SeekRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.SeekRequest} SeekRequest instance + */ + SeekRequest.create = function create(properties) { + return new SeekRequest(properties); + }; + + /** + * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeekRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SeekRequest} SeekRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.snapshot = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SeekRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SeekRequest} SeekRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeekRequest message. + * @function verify + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeekRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.time != null && message.hasOwnProperty("time")) { + properties.target = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } + return null; + }; + + /** + * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SeekRequest} SeekRequest + */ + SeekRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SeekRequest) + return object; + var message = new $root.google.pubsub.v1.SeekRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.pubsub.v1.SeekRequest.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {google.pubsub.v1.SeekRequest} message SeekRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeekRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.time != null && message.hasOwnProperty("time")) { + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (options.oneofs) + object.target = "time"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.target = "snapshot"; + } + return object; + }; + + /** + * Converts this SeekRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SeekRequest + * @instance + * @returns {Object.} JSON object + */ + SeekRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeekRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.SeekRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeekRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.SeekRequest"; + }; + + return SeekRequest; + })(); + + v1.SeekResponse = (function() { + + /** + * Properties of a SeekResponse. + * @memberof google.pubsub.v1 + * @interface ISeekResponse + */ + + /** + * Constructs a new SeekResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a SeekResponse. + * @implements ISeekResponse + * @constructor + * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set + */ + function SeekResponse(properties) { + if (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 SeekResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.SeekResponse} SeekResponse instance + */ + SeekResponse.create = function create(properties) { + return new SeekResponse(properties); + }; + + /** + * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeekResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SeekResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeekResponse message. + * @function verify + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeekResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + */ + SeekResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SeekResponse) + return object; + return new $root.google.pubsub.v1.SeekResponse(); + }; + + /** + * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.SeekResponse} message SeekResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeekResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SeekResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SeekResponse + * @instance + * @returns {Object.} JSON object + */ + SeekResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeekResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeekResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.SeekResponse"; + }; + + return SeekResponse; + })(); + + v1.SchemaService = (function() { + + /** + * Constructs a new SchemaService service. + * @memberof google.pubsub.v1 + * @classdesc Represents a SchemaService + * @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 SchemaService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SchemaService; + + /** + * Creates new SchemaService service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.SchemaService + * @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 {SchemaService} RPC service. Useful where requests and/or responses are streamed. + */ + SchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef CreateSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls CreateSchema. + * @function createSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.CreateSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.createSchema = function createSchema(request, callback) { + return this.rpcCall(createSchema, $root.google.pubsub.v1.CreateSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "CreateSchema" }); + + /** + * Calls CreateSchema. + * @function createSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef GetSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls GetSchema. + * @function getSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.GetSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.getSchema = function getSchema(request, callback) { + return this.rpcCall(getSchema, $root.google.pubsub.v1.GetSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "GetSchema" }); + + /** + * Calls GetSchema. + * @function getSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ListSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSchemasResponse} [response] ListSchemasResponse + */ + + /** + * Calls ListSchemas. + * @function listSchemas + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ListSchemasCallback} callback Node-style callback called with the error, if any, and ListSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.listSchemas = function listSchemas(request, callback) { + return this.rpcCall(listSchemas, $root.google.pubsub.v1.ListSchemasRequest, $root.google.pubsub.v1.ListSchemasResponse, request, callback); + }, "name", { value: "ListSchemas" }); + + /** + * Calls ListSchemas. + * @function listSchemas + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemaRevisions}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ListSchemaRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSchemaRevisionsResponse} [response] ListSchemaRevisionsResponse + */ + + /** + * Calls ListSchemaRevisions. + * @function listSchemaRevisions + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} request ListSchemaRevisionsRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ListSchemaRevisionsCallback} callback Node-style callback called with the error, if any, and ListSchemaRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.listSchemaRevisions = function listSchemaRevisions(request, callback) { + return this.rpcCall(listSchemaRevisions, $root.google.pubsub.v1.ListSchemaRevisionsRequest, $root.google.pubsub.v1.ListSchemaRevisionsResponse, request, callback); + }, "name", { value: "ListSchemaRevisions" }); + + /** + * Calls ListSchemaRevisions. + * @function listSchemaRevisions + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} request ListSchemaRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|commitSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef CommitSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls CommitSchema. + * @function commitSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICommitSchemaRequest} request CommitSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.CommitSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.commitSchema = function commitSchema(request, callback) { + return this.rpcCall(commitSchema, $root.google.pubsub.v1.CommitSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "CommitSchema" }); + + /** + * Calls CommitSchema. + * @function commitSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.ICommitSchemaRequest} request CommitSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|rollbackSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef RollbackSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls RollbackSchema. + * @function rollbackSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IRollbackSchemaRequest} request RollbackSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.RollbackSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.rollbackSchema = function rollbackSchema(request, callback) { + return this.rpcCall(rollbackSchema, $root.google.pubsub.v1.RollbackSchemaRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "RollbackSchema" }); + + /** + * Calls RollbackSchema. + * @function rollbackSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IRollbackSchemaRequest} request RollbackSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchemaRevision}. + * @memberof google.pubsub.v1.SchemaService + * @typedef DeleteSchemaRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Schema} [response] Schema + */ + + /** + * Calls DeleteSchemaRevision. + * @function deleteSchemaRevision + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} request DeleteSchemaRevisionRequest message or plain object + * @param {google.pubsub.v1.SchemaService.DeleteSchemaRevisionCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.deleteSchemaRevision = function deleteSchemaRevision(request, callback) { + return this.rpcCall(deleteSchemaRevision, $root.google.pubsub.v1.DeleteSchemaRevisionRequest, $root.google.pubsub.v1.Schema, request, callback); + }, "name", { value: "DeleteSchemaRevision" }); + + /** + * Calls DeleteSchemaRevision. + * @function deleteSchemaRevision + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} request DeleteSchemaRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef DeleteSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSchema. + * @function deleteSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.DeleteSchemaCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.deleteSchema = function deleteSchema(request, callback) { + return this.rpcCall(deleteSchema, $root.google.pubsub.v1.DeleteSchemaRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSchema" }); + + /** + * Calls DeleteSchema. + * @function deleteSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ValidateSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ValidateSchemaResponse} [response] ValidateSchemaResponse + */ + + /** + * Calls ValidateSchema. + * @function validateSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ValidateSchemaCallback} callback Node-style callback called with the error, if any, and ValidateSchemaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.validateSchema = function validateSchema(request, callback) { + return this.rpcCall(validateSchema, $root.google.pubsub.v1.ValidateSchemaRequest, $root.google.pubsub.v1.ValidateSchemaResponse, request, callback); + }, "name", { value: "ValidateSchema" }); + + /** + * Calls ValidateSchema. + * @function validateSchema + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}. + * @memberof google.pubsub.v1.SchemaService + * @typedef ValidateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ValidateMessageResponse} [response] ValidateMessageResponse + */ + + /** + * Calls ValidateMessage. + * @function validateMessage + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object + * @param {google.pubsub.v1.SchemaService.ValidateMessageCallback} callback Node-style callback called with the error, if any, and ValidateMessageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.validateMessage = function validateMessage(request, callback) { + return this.rpcCall(validateMessage, $root.google.pubsub.v1.ValidateMessageRequest, $root.google.pubsub.v1.ValidateMessageResponse, request, callback); + }, "name", { value: "ValidateMessage" }); + + /** + * Calls ValidateMessage. + * @function validateMessage + * @memberof google.pubsub.v1.SchemaService + * @instance + * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SchemaService; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.pubsub.v1 + * @interface ISchema + * @property {string|null} [name] Schema name + * @property {google.pubsub.v1.Schema.Type|null} [type] Schema type + * @property {string|null} [definition] Schema definition + * @property {string|null} [revisionId] Schema revisionId + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] Schema revisionCreateTime + */ + + /** + * Constructs a new Schema. + * @memberof google.pubsub.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.pubsub.v1.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schema name. + * @member {string} name + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.name = ""; + + /** + * Schema type. + * @member {google.pubsub.v1.Schema.Type} type + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.type = 0; + + /** + * Schema definition. + * @member {string} definition + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.definition = ""; + + /** + * Schema revisionId. + * @member {string} revisionId + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.revisionId = ""; + + /** + * Schema revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.pubsub.v1.Schema + * @instance + */ + Schema.prototype.revisionCreateTime = null; + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.ISchema=} [properties] Properties to set + * @returns {google.pubsub.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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.definition != null && Object.hasOwnProperty.call(message, "definition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.definition); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Schema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.definition = reader.string(); + break; + } + case 4: { + message.revisionId = reader.string(); + break; + } + case 6: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.pubsub.v1.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.definition != null && message.hasOwnProperty("definition")) + if (!$util.isString(message.definition)) + return "definition: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Schema) + return object; + var message = new $root.google.pubsub.v1.Schema(); + 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 "PROTOCOL_BUFFER": + case 1: + message.type = 1; + break; + case "AVRO": + case 2: + message.type = 2; + break; + } + if (object.definition != null) + message.definition = String(object.definition); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.pubsub.v1.Schema.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Schema + * @static + * @param {google.pubsub.v1.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.definition = ""; + object.revisionId = ""; + object.revisionCreateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.pubsub.v1.Schema.Type[message.type] === undefined ? message.type : $root.google.pubsub.v1.Schema.Type[message.type] : message.type; + if (message.definition != null && message.hasOwnProperty("definition")) + object.definition = message.definition; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.pubsub.v1.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.Schema"; + }; + + /** + * Type enum. + * @name google.pubsub.v1.Schema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PROTOCOL_BUFFER=1 PROTOCOL_BUFFER value + * @property {number} AVRO=2 AVRO value + */ + Schema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROTOCOL_BUFFER"] = 1; + values[valuesById[2] = "AVRO"] = 2; + return values; + })(); + + return Schema; + })(); + + /** + * SchemaView enum. + * @name google.pubsub.v1.SchemaView + * @enum {number} + * @property {number} SCHEMA_VIEW_UNSPECIFIED=0 SCHEMA_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.SchemaView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEMA_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1.CreateSchemaRequest = (function() { + + /** + * Properties of a CreateSchemaRequest. + * @memberof google.pubsub.v1 + * @interface ICreateSchemaRequest + * @property {string|null} [parent] CreateSchemaRequest parent + * @property {google.pubsub.v1.ISchema|null} [schema] CreateSchemaRequest schema + * @property {string|null} [schemaId] CreateSchemaRequest schemaId + */ + + /** + * Constructs a new CreateSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CreateSchemaRequest. + * @implements ICreateSchemaRequest + * @constructor + * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set + */ + function CreateSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.parent = ""; + + /** + * CreateSchemaRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.schema = null; + + /** + * CreateSchemaRequest schemaId. + * @member {string} schemaId + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.schemaId = ""; + + /** + * Creates a new CreateSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest instance + */ + CreateSchemaRequest.create = function create(properties) { + return new CreateSchemaRequest(properties); + }; + + /** + * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); + return writer; + }; + + /** + * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CreateSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.schemaId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + if (!$util.isString(message.schemaId)) + return "schemaId: string expected"; + return null; + }; + + /** + * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest + */ + CreateSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CreateSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.CreateSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.CreateSchemaRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + if (object.schemaId != null) + message.schemaId = String(object.schemaId); + return message; + }; + + /** + * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {google.pubsub.v1.CreateSchemaRequest} message CreateSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schema = null; + object.schemaId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + object.schemaId = message.schemaId; + return object; + }; + + /** + * Converts this CreateSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CreateSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.CreateSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CreateSchemaRequest"; + }; + + return CreateSchemaRequest; + })(); + + v1.GetSchemaRequest = (function() { + + /** + * Properties of a GetSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IGetSchemaRequest + * @property {string|null} [name] GetSchemaRequest name + * @property {google.pubsub.v1.SchemaView|null} [view] GetSchemaRequest view + */ + + /** + * Constructs a new GetSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSchemaRequest. + * @implements IGetSchemaRequest + * @constructor + * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set + */ + function GetSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.name = ""; + + /** + * GetSchemaRequest view. + * @member {google.pubsub.v1.SchemaView} view + * @memberof google.pubsub.v1.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.view = 0; + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest instance + */ + GetSchemaRequest.create = function create(properties) { + return new GetSchemaRequest(properties); + }; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest + */ + GetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.GetSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SCHEMA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {google.pubsub.v1.GetSchemaRequest} message GetSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.GetSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.GetSchemaRequest"; + }; + + return GetSchemaRequest; + })(); + + v1.ListSchemasRequest = (function() { + + /** + * Properties of a ListSchemasRequest. + * @memberof google.pubsub.v1 + * @interface IListSchemasRequest + * @property {string|null} [parent] ListSchemasRequest parent + * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemasRequest view + * @property {number|null} [pageSize] ListSchemasRequest pageSize + * @property {string|null} [pageToken] ListSchemasRequest pageToken + */ + + /** + * Constructs a new ListSchemasRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemasRequest. + * @implements IListSchemasRequest + * @constructor + * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set + */ + function ListSchemasRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemasRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.parent = ""; + + /** + * ListSchemasRequest view. + * @member {google.pubsub.v1.SchemaView} view + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.view = 0; + + /** + * ListSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.pageSize = 0; + + /** + * ListSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemasRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest instance + */ + ListSchemasRequest.create = function create(properties) { + return new ListSchemasRequest(properties); + }; + + /** + * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemasRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemasRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest + */ + ListSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemasRequest) + return object; + var message = new $root.google.pubsub.v1.ListSchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SCHEMA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {google.pubsub.v1.ListSchemasRequest} message ListSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemasRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemasRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemasRequest"; + }; + + return ListSchemasRequest; + })(); + + v1.ListSchemasResponse = (function() { + + /** + * Properties of a ListSchemasResponse. + * @memberof google.pubsub.v1 + * @interface IListSchemasResponse + * @property {Array.|null} [schemas] ListSchemasResponse schemas + * @property {string|null} [nextPageToken] ListSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListSchemasResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemasResponse. + * @implements IListSchemasResponse + * @constructor + * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set + */ + function ListSchemasResponse(properties) { + this.schemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemasResponse schemas. + * @member {Array.} schemas + * @memberof google.pubsub.v1.ListSchemasResponse + * @instance + */ + ListSchemasResponse.prototype.schemas = $util.emptyArray; + + /** + * ListSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSchemasResponse + * @instance + */ + ListSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemasResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse instance + */ + ListSchemasResponse.create = function create(properties) { + return new ListSchemasResponse(properties); + }; + + /** + * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemas != null && message.schemas.length) + for (var i = 0; i < message.schemas.length; ++i) + $root.google.pubsub.v1.Schema.encode(message.schemas[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 ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.schemas && message.schemas.length)) + message.schemas = []; + message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemasResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemas != null && message.hasOwnProperty("schemas")) { + if (!Array.isArray(message.schemas)) + return "schemas: array expected"; + for (var i = 0; i < message.schemas.length; ++i) { + var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]); + if (error) + return "schemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse + */ + ListSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemasResponse) + return object; + var message = new $root.google.pubsub.v1.ListSchemasResponse(); + if (object.schemas) { + if (!Array.isArray(object.schemas)) + throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: array expected"); + message.schemas = []; + for (var i = 0; i < object.schemas.length; ++i) { + if (typeof object.schemas[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: object expected"); + message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {google.pubsub.v1.ListSchemasResponse} message ListSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemas && message.schemas.length) { + object.schemas = []; + for (var j = 0; j < message.schemas.length; ++j) + object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemasResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemasResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemasResponse"; + }; + + return ListSchemasResponse; + })(); + + v1.ListSchemaRevisionsRequest = (function() { + + /** + * Properties of a ListSchemaRevisionsRequest. + * @memberof google.pubsub.v1 + * @interface IListSchemaRevisionsRequest + * @property {string|null} [name] ListSchemaRevisionsRequest name + * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemaRevisionsRequest view + * @property {number|null} [pageSize] ListSchemaRevisionsRequest pageSize + * @property {string|null} [pageToken] ListSchemaRevisionsRequest pageToken + */ + + /** + * Constructs a new ListSchemaRevisionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemaRevisionsRequest. + * @implements IListSchemaRevisionsRequest + * @constructor + * @param {google.pubsub.v1.IListSchemaRevisionsRequest=} [properties] Properties to set + */ + function ListSchemaRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemaRevisionsRequest name. + * @member {string} name + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.name = ""; + + /** + * ListSchemaRevisionsRequest view. + * @member {google.pubsub.v1.SchemaView} view + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.view = 0; + + /** + * ListSchemaRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.pageSize = 0; + + /** + * ListSchemaRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + */ + ListSchemaRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemaRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest instance + */ + ListSchemaRevisionsRequest.create = function create(properties) { + return new ListSchemaRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListSchemaRevisionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} message ListSchemaRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemaRevisionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsRequest} message ListSchemaRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSchemaRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaRevisionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaRevisionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemaRevisionsRequest} ListSchemaRevisionsRequest + */ + ListSchemaRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemaRevisionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListSchemaRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SCHEMA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {google.pubsub.v1.ListSchemaRevisionsRequest} message ListSchemaRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] === undefined ? message.view : $root.google.pubsub.v1.SchemaView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemaRevisionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemaRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaRevisionsRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemaRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemaRevisionsRequest"; + }; + + return ListSchemaRevisionsRequest; + })(); + + v1.ListSchemaRevisionsResponse = (function() { + + /** + * Properties of a ListSchemaRevisionsResponse. + * @memberof google.pubsub.v1 + * @interface IListSchemaRevisionsResponse + * @property {Array.|null} [schemas] ListSchemaRevisionsResponse schemas + * @property {string|null} [nextPageToken] ListSchemaRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListSchemaRevisionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSchemaRevisionsResponse. + * @implements IListSchemaRevisionsResponse + * @constructor + * @param {google.pubsub.v1.IListSchemaRevisionsResponse=} [properties] Properties to set + */ + function ListSchemaRevisionsResponse(properties) { + this.schemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemaRevisionsResponse schemas. + * @member {Array.} schemas + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @instance + */ + ListSchemaRevisionsResponse.prototype.schemas = $util.emptyArray; + + /** + * ListSchemaRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @instance + */ + ListSchemaRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemaRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse instance + */ + ListSchemaRevisionsResponse.create = function create(properties) { + return new ListSchemaRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListSchemaRevisionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsResponse} message ListSchemaRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemas != null && message.schemas.length) + for (var i = 0; i < message.schemas.length; ++i) + $root.google.pubsub.v1.Schema.encode(message.schemas[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 ListSchemaRevisionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemaRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.IListSchemaRevisionsResponse} message ListSchemaRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemaRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSchemaRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.schemas && message.schemas.length)) + message.schemas = []; + message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemaRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemaRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemaRevisionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemaRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemas != null && message.hasOwnProperty("schemas")) { + if (!Array.isArray(message.schemas)) + return "schemas: array expected"; + for (var i = 0; i < message.schemas.length; ++i) { + var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]); + if (error) + return "schemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemaRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListSchemaRevisionsResponse} ListSchemaRevisionsResponse + */ + ListSchemaRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSchemaRevisionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListSchemaRevisionsResponse(); + if (object.schemas) { + if (!Array.isArray(object.schemas)) + throw TypeError(".google.pubsub.v1.ListSchemaRevisionsResponse.schemas: array expected"); + message.schemas = []; + for (var i = 0; i < object.schemas.length; ++i) { + if (typeof object.schemas[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSchemaRevisionsResponse.schemas: object expected"); + message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemaRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {google.pubsub.v1.ListSchemaRevisionsResponse} message ListSchemaRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemaRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemas && message.schemas.length) { + object.schemas = []; + for (var j = 0; j < message.schemas.length; ++j) + object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemaRevisionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemaRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemaRevisionsResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ListSchemaRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemaRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ListSchemaRevisionsResponse"; + }; + + return ListSchemaRevisionsResponse; + })(); + + v1.CommitSchemaRequest = (function() { + + /** + * Properties of a CommitSchemaRequest. + * @memberof google.pubsub.v1 + * @interface ICommitSchemaRequest + * @property {string|null} [name] CommitSchemaRequest name + * @property {google.pubsub.v1.ISchema|null} [schema] CommitSchemaRequest schema + */ + + /** + * Constructs a new CommitSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CommitSchemaRequest. + * @implements ICommitSchemaRequest + * @constructor + * @param {google.pubsub.v1.ICommitSchemaRequest=} [properties] Properties to set + */ + function CommitSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.CommitSchemaRequest + * @instance + */ + CommitSchemaRequest.prototype.name = ""; + + /** + * CommitSchemaRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.CommitSchemaRequest + * @instance + */ + CommitSchemaRequest.prototype.schema = null; + + /** + * Creates a new CommitSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.ICommitSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest instance + */ + CommitSchemaRequest.create = function create(properties) { + return new CommitSchemaRequest(properties); + }; + + /** + * Encodes the specified CommitSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.ICommitSchemaRequest} message CommitSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CommitSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.ICommitSchemaRequest} message CommitSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CommitSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a CommitSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CommitSchemaRequest} CommitSchemaRequest + */ + CommitSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CommitSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.CommitSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.CommitSchemaRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a CommitSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {google.pubsub.v1.CommitSchemaRequest} message CommitSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.schema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this CommitSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.CommitSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CommitSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.CommitSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.CommitSchemaRequest"; + }; + + return CommitSchemaRequest; + })(); + + v1.RollbackSchemaRequest = (function() { + + /** + * Properties of a RollbackSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IRollbackSchemaRequest + * @property {string|null} [name] RollbackSchemaRequest name + * @property {string|null} [revisionId] RollbackSchemaRequest revisionId + */ + + /** + * Constructs a new RollbackSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a RollbackSchemaRequest. + * @implements IRollbackSchemaRequest + * @constructor + * @param {google.pubsub.v1.IRollbackSchemaRequest=} [properties] Properties to set + */ + function RollbackSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @instance + */ + RollbackSchemaRequest.prototype.name = ""; + + /** + * RollbackSchemaRequest revisionId. + * @member {string} revisionId + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @instance + */ + RollbackSchemaRequest.prototype.revisionId = ""; + + /** + * Creates a new RollbackSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.IRollbackSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest instance + */ + RollbackSchemaRequest.create = function create(properties) { + return new RollbackSchemaRequest(properties); + }; + + /** + * Encodes the specified RollbackSchemaRequest message. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.IRollbackSchemaRequest} message RollbackSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified RollbackSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.RollbackSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.IRollbackSchemaRequest} message RollbackSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.RollbackSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a RollbackSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.RollbackSchemaRequest} RollbackSchemaRequest + */ + RollbackSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.RollbackSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.RollbackSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a RollbackSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {google.pubsub.v1.RollbackSchemaRequest} message RollbackSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this RollbackSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.RollbackSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.RollbackSchemaRequest"; + }; + + return RollbackSchemaRequest; + })(); + + v1.DeleteSchemaRevisionRequest = (function() { + + /** + * Properties of a DeleteSchemaRevisionRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSchemaRevisionRequest + * @property {string|null} [name] DeleteSchemaRevisionRequest name + * @property {string|null} [revisionId] DeleteSchemaRevisionRequest revisionId + */ + + /** + * Constructs a new DeleteSchemaRevisionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSchemaRevisionRequest. + * @implements IDeleteSchemaRevisionRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest=} [properties] Properties to set + */ + function DeleteSchemaRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSchemaRevisionRequest name. + * @member {string} name + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @instance + */ + DeleteSchemaRevisionRequest.prototype.name = ""; + + /** + * DeleteSchemaRevisionRequest revisionId. + * @member {string} revisionId + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @instance + */ + DeleteSchemaRevisionRequest.prototype.revisionId = ""; + + /** + * Creates a new DeleteSchemaRevisionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest instance + */ + DeleteSchemaRevisionRequest.create = function create(properties) { + return new DeleteSchemaRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRevisionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified DeleteSchemaRevisionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRevisionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSchemaRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaRevisionRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaRevisionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a DeleteSchemaRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSchemaRevisionRequest} DeleteSchemaRevisionRequest + */ + DeleteSchemaRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSchemaRevisionRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSchemaRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {google.pubsub.v1.DeleteSchemaRevisionRequest} message DeleteSchemaRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this DeleteSchemaRevisionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaRevisionRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSchemaRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSchemaRevisionRequest"; + }; + + return DeleteSchemaRevisionRequest; + })(); + + v1.DeleteSchemaRequest = (function() { + + /** + * Properties of a DeleteSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSchemaRequest + * @property {string|null} [name] DeleteSchemaRequest name + */ + + /** + * Constructs a new DeleteSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSchemaRequest. + * @implements IDeleteSchemaRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set + */ + function DeleteSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSchemaRequest name. + * @member {string} name + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @instance + */ + DeleteSchemaRequest.prototype.name = ""; + + /** + * Creates a new DeleteSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest instance + */ + DeleteSchemaRequest.create = function create(properties) { + return new DeleteSchemaRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRequest.encode = function encode(message, writer) { + 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 DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaRequest.verify = function verify(message) { + if (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 DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest + */ + DeleteSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {google.pubsub.v1.DeleteSchemaRequest} message DeleteSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaRequest.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 DeleteSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.DeleteSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.DeleteSchemaRequest"; + }; + + return DeleteSchemaRequest; + })(); + + v1.ValidateSchemaRequest = (function() { + + /** + * Properties of a ValidateSchemaRequest. + * @memberof google.pubsub.v1 + * @interface IValidateSchemaRequest + * @property {string|null} [parent] ValidateSchemaRequest parent + * @property {google.pubsub.v1.ISchema|null} [schema] ValidateSchemaRequest schema + */ + + /** + * Constructs a new ValidateSchemaRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateSchemaRequest. + * @implements IValidateSchemaRequest + * @constructor + * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set + */ + function ValidateSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateSchemaRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @instance + */ + ValidateSchemaRequest.prototype.parent = ""; + + /** + * ValidateSchemaRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @instance + */ + ValidateSchemaRequest.prototype.schema = null; + + /** + * Creates a new ValidateSchemaRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest instance + */ + ValidateSchemaRequest.create = function create(properties) { + return new ValidateSchemaRequest(properties); + }; + + /** + * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateSchemaRequest message. + * @function verify + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest + */ + ValidateSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateSchemaRequest) + return object; + var message = new $root.google.pubsub.v1.ValidateSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.ValidateSchemaRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {google.pubsub.v1.ValidateSchemaRequest} message ValidateSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schema = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this ValidateSchemaRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateSchemaRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateSchemaRequest"; + }; + + return ValidateSchemaRequest; + })(); + + v1.ValidateSchemaResponse = (function() { + + /** + * Properties of a ValidateSchemaResponse. + * @memberof google.pubsub.v1 + * @interface IValidateSchemaResponse + */ + + /** + * Constructs a new ValidateSchemaResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateSchemaResponse. + * @implements IValidateSchemaResponse + * @constructor + * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set + */ + function ValidateSchemaResponse(properties) { + if (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 ValidateSchemaResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse instance + */ + ValidateSchemaResponse.create = function create(properties) { + return new ValidateSchemaResponse(properties); + }; + + /** + * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateSchemaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateSchemaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateSchemaResponse message. + * @function verify + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateSchemaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse + */ + ValidateSchemaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateSchemaResponse) + return object; + return new $root.google.pubsub.v1.ValidateSchemaResponse(); + }; + + /** + * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {google.pubsub.v1.ValidateSchemaResponse} message ValidateSchemaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateSchemaResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ValidateSchemaResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @instance + * @returns {Object.} JSON object + */ + ValidateSchemaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateSchemaResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateSchemaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateSchemaResponse"; + }; + + return ValidateSchemaResponse; + })(); + + v1.ValidateMessageRequest = (function() { + + /** + * Properties of a ValidateMessageRequest. + * @memberof google.pubsub.v1 + * @interface IValidateMessageRequest + * @property {string|null} [parent] ValidateMessageRequest parent + * @property {string|null} [name] ValidateMessageRequest name + * @property {google.pubsub.v1.ISchema|null} [schema] ValidateMessageRequest schema + * @property {Uint8Array|null} [message] ValidateMessageRequest message + * @property {google.pubsub.v1.Encoding|null} [encoding] ValidateMessageRequest encoding + */ + + /** + * Constructs a new ValidateMessageRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateMessageRequest. + * @implements IValidateMessageRequest + * @constructor + * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set + */ + function ValidateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateMessageRequest parent. + * @member {string} parent + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.parent = ""; + + /** + * ValidateMessageRequest name. + * @member {string|null|undefined} name + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.name = null; + + /** + * ValidateMessageRequest schema. + * @member {google.pubsub.v1.ISchema|null|undefined} schema + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.schema = null; + + /** + * ValidateMessageRequest message. + * @member {Uint8Array} message + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.message = $util.newBuffer([]); + + /** + * ValidateMessageRequest encoding. + * @member {google.pubsub.v1.Encoding} encoding + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + ValidateMessageRequest.prototype.encoding = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ValidateMessageRequest schemaSpec. + * @member {"name"|"schema"|undefined} schemaSpec + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + */ + Object.defineProperty(ValidateMessageRequest.prototype, "schemaSpec", { + get: $util.oneOfGetter($oneOfFields = ["name", "schema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ValidateMessageRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest instance + */ + ValidateMessageRequest.create = function create(properties) { + return new ValidateMessageRequest(properties); + }; + + /** + * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.message); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.encoding); + return writer; + }; + + /** + * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.message = reader.bytes(); + break; + } + case 5: { + message.encoding = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateMessageRequest message. + * @function verify + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.name != null && message.hasOwnProperty("name")) { + properties.schemaSpec = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.schema != null && message.hasOwnProperty("schema")) { + if (properties.schemaSpec === 1) + return "schemaSpec: multiple values"; + properties.schemaSpec = 1; + { + var error = $root.google.pubsub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + } + if (message.message != null && message.hasOwnProperty("message")) + if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message))) + return "message: buffer expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ValidateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest + */ + ValidateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateMessageRequest) + return object; + var message = new $root.google.pubsub.v1.ValidateMessageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.name != null) + message.name = String(object.name); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.pubsub.v1.ValidateMessageRequest.schema: object expected"); + message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema); + } + if (object.message != null) + if (typeof object.message === "string") + $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0); + else if (object.message.length >= 0) + message.message = object.message; + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "JSON": + case 1: + message.encoding = 1; + break; + case "BINARY": + case 2: + message.encoding = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {google.pubsub.v1.ValidateMessageRequest} message ValidateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + if (options.bytes === String) + object.message = ""; + else { + object.message = []; + if (options.bytes !== Array) + object.message = $util.newBuffer(object.message); + } + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object.schemaSpec = "name"; + } + if (message.schema != null && message.hasOwnProperty("schema")) { + object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options); + if (options.oneofs) + object.schemaSpec = "schema"; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] === undefined ? message.encoding : $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding; + return object; + }; + + /** + * Converts this ValidateMessageRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateMessageRequest + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateMessageRequest"; + }; + + return ValidateMessageRequest; + })(); + + v1.ValidateMessageResponse = (function() { + + /** + * Properties of a ValidateMessageResponse. + * @memberof google.pubsub.v1 + * @interface IValidateMessageResponse + */ + + /** + * Constructs a new ValidateMessageResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ValidateMessageResponse. + * @implements IValidateMessageResponse + * @constructor + * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set + */ + function ValidateMessageResponse(properties) { + if (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 ValidateMessageResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse instance + */ + ValidateMessageResponse.create = function create(properties) { + return new ValidateMessageResponse(properties); + }; + + /** + * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateMessageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateMessageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateMessageResponse message. + * @function verify + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateMessageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ValidateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse + */ + ValidateMessageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ValidateMessageResponse) + return object; + return new $root.google.pubsub.v1.ValidateMessageResponse(); + }; + + /** + * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {google.pubsub.v1.ValidateMessageResponse} message ValidateMessageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateMessageResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ValidateMessageResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ValidateMessageResponse + * @instance + * @returns {Object.} JSON object + */ + ValidateMessageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidateMessageResponse + * @function getTypeUrl + * @memberof google.pubsub.v1.ValidateMessageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.ValidateMessageResponse"; + }; + + return ValidateMessageResponse; + })(); + + /** + * Encoding enum. + * @name google.pubsub.v1.Encoding + * @enum {number} + * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value + * @property {number} JSON=1 JSON value + * @property {number} BINARY=2 BINARY value + */ + v1.Encoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + values[valuesById[2] = "BINARY"] = 2; + return values; + })(); + + return v1; + })(); + + return pubsub; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * 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; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * 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(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32()); + 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; + } + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration); + if (error) + return "selectiveGapicGeneration." + error; + } + 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; + } + } + if (object.selectiveGapicGeneration != null) { + if (typeof object.selectiveGapicGeneration !== "object") + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration); + } + 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 = ""; + object.selectiveGapicGeneration = null; + } + 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]; + } + if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * 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; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = 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(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.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; + } + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures); + if (error) + return "experimentalFeatures." + 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); + } + if (object.experimentalFeatures != null) { + if (typeof object.experimentalFeatures !== "object") + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures); + } + 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; + object.experimentalFeatures = null; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, 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"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * 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) { + this.renamedServices = {}; + if (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; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * 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(); + 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(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + 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; + } + 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"; + } + 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); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.GoSettings.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]]); + } + 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.objects || options.defaults) + object.renamedServices = {}; + 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]]; + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * 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; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY 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[900] = "EDITION_LEGACY"] = 900; + 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} [optionDependency] FileDescriptorProto optionDependency + * @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.optionDependency = []; + 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 optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $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); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + 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.optionDependency != null && message.hasOwnProperty("optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] 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 900: + 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.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + 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_LEGACY": + case 900: + message.edition = 900; + 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 = []; + object.optionDependency = []; + } + 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; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + 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 + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * 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; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * 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]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 11: { + message.visibility = reader.int32(); + 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + 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]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * 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; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * 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]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 6: { + message.visibility = reader.int32(); + 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"; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + 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; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + 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]; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = 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.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + 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_LEGACY": + case 900: + message.edition = 900; + 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; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + 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 FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @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 featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * 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.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).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 EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.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 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.featureSupport != null && message.hasOwnProperty("featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport); + if (error) + return "featureSupport." + 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 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.featureSupport != null) { + if (typeof object.featureSupport !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport); + } + 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; + object.featureSupport = null; + } + 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.featureSupport != null && message.hasOwnProperty("featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, 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 EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * 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; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 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); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = 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; + } + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + 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; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + 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; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_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; + if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + 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; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (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 VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + 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 900: + 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_LEGACY": + case 900: + message.minimumEdition = 900; + 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_LEGACY": + case 900: + message.maximumEdition = 900; + 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} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * 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 overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = 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.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.fixedFeatures = $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 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures); + if (error) + return "fixedFeatures." + 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_LEGACY": + case 900: + message.edition = 900; + 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.overridableFeatures != null) { + if (typeof object.overridableFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures); + } + if (object.fixedFeatures != null) { + if (typeof object.fixedFeatures !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures); + } + 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.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + 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; + if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); + if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/handwritten/pubsub/protos/protos.json b/handwritten/pubsub/protos/protos.json new file mode 100644 index 00000000000..ff48d61d449 --- /dev/null +++ b/handwritten/pubsub/protos/protos.json @@ -0,0 +1,5410 @@ +{ + "nested": { + "google": { + "nested": { + "pubsub": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.PubSub.V1", + "go_package": "cloud.google.com/go/pubsub/v2/apiv1/pubsubpb;pubsubpb", + "java_multiple_files": true, + "java_outer_classname": "SchemaProto", + "java_package": "com.google.pubsub.v1", + "php_namespace": "Google\\Cloud\\PubSub\\V1", + "ruby_package": "Google::Cloud::PubSub::V1", + "(google.api.resource_definition).type": "analyticshub.googleapis.com/Listing", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + }, + "nested": { + "Publisher": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateTopic": { + "requestType": "Topic", + "responseType": "Topic", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/topics/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{name=projects/*/topics/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTopic": { + "requestType": "UpdateTopicRequest", + "responseType": "Topic", + "options": { + "(google.api.http).patch": "/v1/{topic.name=projects/*/topics/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "topic,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{topic.name=projects/*/topics/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "topic,update_mask" + } + ] + }, + "Publish": { + "requestType": "PublishRequest", + "responseType": "PublishResponse", + "options": { + "(google.api.http).post": "/v1/{topic=projects/*/topics/*}:publish", + "(google.api.http).body": "*", + "(google.api.method_signature)": "topic,messages" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{topic=projects/*/topics/*}:publish", + "body": "*" + } + }, + { + "(google.api.method_signature)": "topic,messages" + } + ] + }, + "GetTopic": { + "requestType": "GetTopicRequest", + "responseType": "Topic", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{topic=projects/*/topics/*}" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "ListTopics": { + "requestType": "ListTopicsRequest", + "responseType": "ListTopicsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/topics", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{project=projects/*}/topics" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListTopicSubscriptions": { + "requestType": "ListTopicSubscriptionsRequest", + "responseType": "ListTopicSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/subscriptions", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{topic=projects/*/topics/*}/subscriptions" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "ListTopicSnapshots": { + "requestType": "ListTopicSnapshotsRequest", + "responseType": "ListTopicSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/snapshots", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{topic=projects/*/topics/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "DeleteTopic": { + "requestType": "DeleteTopicRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{topic=projects/*/topics/*}", + "(google.api.method_signature)": "topic" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{topic=projects/*/topics/*}" + } + }, + { + "(google.api.method_signature)": "topic" + } + ] + }, + "DetachSubscription": { + "requestType": "DetachSubscriptionRequest", + "responseType": "DetachSubscriptionResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:detach" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:detach" + } + } + ] + } + } + }, + "MessageStoragePolicy": { + "fields": { + "allowedPersistenceRegions": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enforceInTransit": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SchemaSettings": { + "fields": { + "schema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "encoding": { + "type": "Encoding", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "firstRevisionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastRevisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "IngestionDataSourceSettings": { + "oneofs": { + "source": { + "oneof": [ + "awsKinesis", + "cloudStorage", + "azureEventHubs", + "awsMsk", + "confluentCloud" + ] + } + }, + "fields": { + "awsKinesis": { + "type": "AwsKinesis", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudStorage": { + "type": "CloudStorage", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "azureEventHubs": { + "type": "AzureEventHubs", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "awsMsk": { + "type": "AwsMsk", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confluentCloud": { + "type": "ConfluentCloud", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "platformLogsSettings": { + "type": "PlatformLogsSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AwsKinesis": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamArn": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "consumerArn": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "awsRoleArn": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcpServiceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "KINESIS_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "STREAM_NOT_FOUND": 4, + "CONSUMER_NOT_FOUND": 5 + } + } + } + }, + "CloudStorage": { + "oneofs": { + "inputFormat": { + "oneof": [ + "textFormat", + "avroFormat", + "pubsubAvroFormat" + ] + } + }, + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bucket": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "textFormat": { + "type": "TextFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avroFormat": { + "type": "AvroFormat", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pubsubAvroFormat": { + "type": "PubSubAvroFormat", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minimumObjectCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchGlob": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CLOUD_STORAGE_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "BUCKET_NOT_FOUND": 4, + "TOO_MANY_OBJECTS": 5 + } + }, + "TextFormat": { + "oneofs": { + "_delimiter": { + "oneof": [ + "delimiter" + ] + } + }, + "fields": { + "delimiter": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "AvroFormat": { + "fields": {} + }, + "PubSubAvroFormat": { + "fields": {} + } + } + }, + "AzureEventHubs": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceGroup": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "namespace": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventHub": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tenantId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriptionId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcpServiceAccount": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "EVENT_HUBS_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "NAMESPACE_NOT_FOUND": 4, + "EVENT_HUB_NOT_FOUND": 5, + "SUBSCRIPTION_NOT_FOUND": 6, + "RESOURCE_GROUP_NOT_FOUND": 7 + } + } + } + }, + "AwsMsk": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterArn": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "topic": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "awsRoleArn": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcpServiceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "MSK_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "CLUSTER_NOT_FOUND": 4, + "TOPIC_NOT_FOUND": 5 + } + } + } + }, + "ConfluentCloud": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bootstrapServer": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "topic": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "identityPoolId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcpServiceAccount": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CONFLUENT_CLOUD_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "UNREACHABLE_BOOTSTRAP_SERVER": 4, + "CLUSTER_NOT_FOUND": 5, + "TOPIC_NOT_FOUND": 6 + } + } + } + } + } + }, + "PlatformLogsSettings": { + "fields": { + "severity": { + "type": "Severity", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "DISABLED": 1, + "DEBUG": 2, + "INFO": 3, + "WARNING": 4, + "ERROR": 5 + } + } + } + }, + "IngestionFailureEvent": { + "oneofs": { + "failure": { + "oneof": [ + "cloudStorageFailure", + "awsMskFailure", + "azureEventHubsFailure", + "confluentCloudFailure", + "awsKinesisFailure" + ] + } + }, + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "errorMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cloudStorageFailure": { + "type": "CloudStorageFailure", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "awsMskFailure": { + "type": "AwsMskFailureReason", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "azureEventHubsFailure": { + "type": "AzureEventHubsFailureReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confluentCloudFailure": { + "type": "ConfluentCloudFailureReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "awsKinesisFailure": { + "type": "AwsKinesisFailureReason", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ApiViolationReason": { + "fields": {} + }, + "AvroFailureReason": { + "fields": {} + }, + "SchemaViolationReason": { + "fields": {} + }, + "MessageTransformationFailureReason": { + "fields": {} + }, + "CloudStorageFailure": { + "oneofs": { + "reason": { + "oneof": [ + "avroFailureReason", + "apiViolationReason", + "schemaViolationReason", + "messageTransformationFailureReason" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectGeneration": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avroFailureReason": { + "type": "AvroFailureReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiViolationReason": { + "type": "ApiViolationReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaViolationReason": { + "type": "SchemaViolationReason", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageTransformationFailureReason": { + "type": "MessageTransformationFailureReason", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AwsMskFailureReason": { + "oneofs": { + "reason": { + "oneof": [ + "apiViolationReason", + "schemaViolationReason", + "messageTransformationFailureReason" + ] + } + }, + "fields": { + "clusterArn": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kafkaTopic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "offset": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiViolationReason": { + "type": "ApiViolationReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaViolationReason": { + "type": "SchemaViolationReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageTransformationFailureReason": { + "type": "MessageTransformationFailureReason", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AzureEventHubsFailureReason": { + "oneofs": { + "reason": { + "oneof": [ + "apiViolationReason", + "schemaViolationReason", + "messageTransformationFailureReason" + ] + } + }, + "fields": { + "namespace": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventHub": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "offset": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiViolationReason": { + "type": "ApiViolationReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaViolationReason": { + "type": "SchemaViolationReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageTransformationFailureReason": { + "type": "MessageTransformationFailureReason", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConfluentCloudFailureReason": { + "oneofs": { + "reason": { + "oneof": [ + "apiViolationReason", + "schemaViolationReason", + "messageTransformationFailureReason" + ] + } + }, + "fields": { + "clusterId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kafkaTopic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "offset": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiViolationReason": { + "type": "ApiViolationReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaViolationReason": { + "type": "SchemaViolationReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageTransformationFailureReason": { + "type": "MessageTransformationFailureReason", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AwsKinesisFailureReason": { + "oneofs": { + "reason": { + "oneof": [ + "schemaViolationReason", + "messageTransformationFailureReason", + "apiViolationReason" + ] + } + }, + "fields": { + "streamArn": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sequenceNumber": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaViolationReason": { + "type": "SchemaViolationReason", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageTransformationFailureReason": { + "type": "MessageTransformationFailureReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiViolationReason": { + "type": "ApiViolationReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "JavaScriptUDF": { + "fields": { + "functionName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "code": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MessageTransform": { + "oneofs": { + "transform": { + "oneof": [ + "javascriptUdf" + ] + } + }, + "fields": { + "javascriptUdf": { + "type": "JavaScriptUDF", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enabled": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Topic": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Topic", + "(google.api.resource).pattern": "_deleted-topic_", + "(google.api.resource).plural": "topics", + "(google.api.resource).singular": "topic" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageStoragePolicy": { + "type": "MessageStoragePolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "schemaSettings": { + "type": "SchemaSettings", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ingestionDataSourceSettings": { + "type": "IngestionDataSourceSettings", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageTransforms": { + "rule": "repeated", + "type": "MessageTransform", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INGESTION_RESOURCE_ERROR": 2 + } + } + } + }, + "PubsubMessage": { + "fields": { + "data": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageId": { + "type": "string", + "id": 3 + }, + "publishTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "orderingKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetTopicRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + } + } + }, + "UpdateTopicRequest": { + "fields": { + "topic": { + "type": "Topic", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PublishRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "messages": { + "rule": "repeated", + "type": "PubsubMessage", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PublishResponse": { + "fields": { + "messageIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicsResponse": { + "fields": { + "topics": { + "rule": "repeated", + "type": "Topic", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSubscriptionsRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSubscriptionsResponse": { + "fields": { + "subscriptions": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSnapshotsRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTopicSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTopicRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + } + } + }, + "DetachSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "DetachSubscriptionResponse": { + "fields": {} + }, + "Subscriber": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateSubscription": { + "requestType": "Subscription", + "responseType": "Subscription", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/subscriptions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{name=projects/*/subscriptions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" + } + ] + }, + "GetSubscription": { + "requestType": "GetSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).get": "/v1/{subscription=projects/*/subscriptions/*}", + "(google.api.method_signature)": "subscription" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{subscription=projects/*/subscriptions/*}" + } + }, + { + "(google.api.method_signature)": "subscription" + } + ] + }, + "UpdateSubscription": { + "requestType": "UpdateSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).patch": "/v1/{subscription.name=projects/*/subscriptions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{subscription.name=projects/*/subscriptions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,update_mask" + } + ] + }, + "ListSubscriptions": { + "requestType": "ListSubscriptionsRequest", + "responseType": "ListSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/subscriptions", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{project=projects/*}/subscriptions" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "DeleteSubscription": { + "requestType": "DeleteSubscriptionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{subscription=projects/*/subscriptions/*}", + "(google.api.method_signature)": "subscription" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{subscription=projects/*/subscriptions/*}" + } + }, + { + "(google.api.method_signature)": "subscription" + } + ] + }, + "ModifyAckDeadline": { + "requestType": "ModifyAckDeadlineRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" + } + ] + }, + "Acknowledge": { + "requestType": "AcknowledgeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,ack_ids" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,ack_ids" + } + ] + }, + "Pull": { + "requestType": "PullRequest", + "responseType": "PullResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:pull", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,max_messages" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:pull", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,return_immediately,max_messages" + }, + { + "(google.api.method_signature)": "subscription,max_messages" + } + ] + }, + "StreamingPull": { + "requestType": "StreamingPullRequest", + "requestStream": true, + "responseType": "StreamingPullResponse", + "responseStream": true + }, + "ModifyPushConfig": { + "requestType": "ModifyPushConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,push_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", + "body": "*" + } + }, + { + "(google.api.method_signature)": "subscription,push_config" + } + ] + }, + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v1/{snapshot=projects/*/snapshots/*}", + "(google.api.method_signature)": "snapshot" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{snapshot=projects/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "snapshot" + } + ] + }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/snapshots", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{project=projects/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "CreateSnapshot": { + "requestType": "CreateSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/snapshots/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,subscription" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{name=projects/*/snapshots/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,subscription" + } + ] + }, + "UpdateSnapshot": { + "requestType": "UpdateSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).patch": "/v1/{snapshot.name=projects/*/snapshots/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "snapshot,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{snapshot.name=projects/*/snapshots/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "snapshot,update_mask" + } + ] + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{snapshot=projects/*/snapshots/*}", + "(google.api.method_signature)": "snapshot" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{snapshot=projects/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "snapshot" + } + ] + }, + "Seek": { + "requestType": "SeekRequest", + "responseType": "SeekResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:seek", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{subscription=projects/*/subscriptions/*}:seek", + "body": "*" + } + } + ] + } + } + }, + "Subscription": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Subscription", + "(google.api.resource).pattern": "projects/{project}/subscriptions/{subscription}", + "(google.api.resource).plural": "subscriptions", + "(google.api.resource).singular": "subscription" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pushConfig": { + "type": "PushConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigqueryConfig": { + "type": "BigQueryConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudStorageConfig": { + "type": "CloudStorageConfig", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ackDeadlineSeconds": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retainAckedMessages": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableMessageOrdering": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expirationPolicy": { + "type": "ExpirationPolicy", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deadLetterPolicy": { + "type": "DeadLetterPolicy", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retryPolicy": { + "type": "RetryPolicy", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "detached": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableExactlyOnceDelivery": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "topicMessageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "analyticsHubSubscriptionInfo": { + "type": "AnalyticsHubSubscriptionInfo", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "messageTransforms": { + "rule": "repeated", + "type": "MessageTransform", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "RESOURCE_ERROR": 2 + } + }, + "AnalyticsHubSubscriptionInfo": { + "fields": { + "listing": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/Listing" + } + }, + "subscription": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "RetryPolicy": { + "fields": { + "minimumBackoff": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maximumBackoff": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeadLetterPolicy": { + "fields": { + "deadLetterTopic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "maxDeliveryAttempts": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExpirationPolicy": { + "fields": { + "ttl": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PushConfig": { + "oneofs": { + "authenticationMethod": { + "oneof": [ + "oidcToken" + ] + }, + "wrapper": { + "oneof": [ + "pubsubWrapper", + "noWrapper" + ] + } + }, + "fields": { + "pushEndpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oidcToken": { + "type": "OidcToken", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pubsubWrapper": { + "type": "PubsubWrapper", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "noWrapper": { + "type": "NoWrapper", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OidcToken": { + "fields": { + "serviceAccountEmail": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audience": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PubsubWrapper": { + "fields": {} + }, + "NoWrapper": { + "fields": { + "writeMetadata": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "BigQueryConfig": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useTopicSchema": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "writeMetadata": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dropUnknownFields": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "useTableSchema": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PERMISSION_DENIED": 2, + "NOT_FOUND": 3, + "SCHEMA_MISMATCH": 4, + "IN_TRANSIT_LOCATION_RESTRICTION": 5 + } + } + } + }, + "CloudStorageConfig": { + "oneofs": { + "outputFormat": { + "oneof": [ + "textConfig", + "avroConfig" + ] + } + }, + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filenamePrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filenameSuffix": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filenameDatetimeFormat": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "textConfig": { + "type": "TextConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avroConfig": { + "type": "AvroConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxDuration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxBytes": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxMessages": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TextConfig": { + "fields": {} + }, + "AvroConfig": { + "fields": { + "writeMetadata": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useTopicSchema": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PERMISSION_DENIED": 2, + "NOT_FOUND": 3, + "IN_TRANSIT_LOCATION_RESTRICTION": 4, + "SCHEMA_MISMATCH": 5 + } + } + } + }, + "ReceivedMessage": { + "fields": { + "ackId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "message": { + "type": "PubsubMessage", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deliveryAttempt": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "UpdateSubscriptionRequest": { + "fields": { + "subscription": { + "type": "Subscription", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSubscriptionsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSubscriptionsResponse": { + "fields": { + "subscriptions": { + "rule": "repeated", + "type": "Subscription", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "ModifyPushConfigRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "pushConfig": { + "type": "PushConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PullRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "returnImmediately": { + "type": "bool", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxMessages": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PullResponse": { + "fields": { + "receivedMessages": { + "rule": "repeated", + "type": "ReceivedMessage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModifyAckDeadlineRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ackDeadlineSeconds": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AcknowledgeRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StreamingPullRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modifyDeadlineSeconds": { + "rule": "repeated", + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modifyDeadlineAckIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "streamAckDeadlineSeconds": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxOutstandingMessages": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxOutstandingBytes": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protocolVersion": { + "type": "int64", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StreamingPullResponse": { + "fields": { + "receivedMessages": { + "rule": "repeated", + "type": "ReceivedMessage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acknowledgeConfirmation": { + "type": "AcknowledgeConfirmation", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modifyAckDeadlineConfirmation": { + "type": "ModifyAckDeadlineConfirmation", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriptionProperties": { + "type": "SubscriptionProperties", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AcknowledgeConfirmation": { + "fields": { + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invalidAckIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "unorderedAckIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temporaryFailedAckIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModifyAckDeadlineConfirmation": { + "fields": { + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invalidAckIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temporaryFailedAckIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SubscriptionProperties": { + "fields": { + "exactlyOnceDeliveryEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageOrderingEnabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CreateSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + }, + "subscription": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateSnapshotRequest": { + "fields": { + "snapshot": { + "type": "Snapshot", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Snapshot": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Snapshot", + "(google.api.resource).pattern": "projects/{project}/snapshots/{snapshot}", + "(google.api.resource).plural": "snapshots", + "(google.api.resource).singular": "snapshot" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSnapshotRequest": { + "fields": { + "snapshot": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + } + } + }, + "ListSnapshotsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "Snapshot", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSnapshotRequest": { + "fields": { + "snapshot": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + } + } + }, + "SeekRequest": { + "oneofs": { + "target": { + "oneof": [ + "time", + "snapshot" + ] + } + }, + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "time": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshot": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } + } + } + }, + "SeekResponse": { + "fields": {} + }, + "SchemaService": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateSchema": { + "requestType": "CreateSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/schemas", + "(google.api.http).body": "schema", + "(google.api.method_signature)": "parent,schema,schema_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/schemas", + "body": "schema" + } + }, + { + "(google.api.method_signature)": "parent,schema,schema_id" + } + ] + }, + "GetSchema": { + "requestType": "GetSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/schemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/schemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSchemas": { + "requestType": "ListSchemasRequest", + "responseType": "ListSchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/schemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/schemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSchemaRevisions": { + "requestType": "ListSchemaRevisionsRequest", + "responseType": "ListSchemaRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/schemas/*}:listRevisions", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/schemas/*}:listRevisions" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CommitSchema": { + "requestType": "CommitSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/schemas/*}:commit", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/schemas/*}:commit", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,schema" + } + ] + }, + "RollbackSchema": { + "requestType": "RollbackSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/schemas/*}:rollback", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,revision_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/schemas/*}:rollback", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,revision_id" + } + ] + }, + "DeleteSchemaRevision": { + "requestType": "DeleteSchemaRevisionRequest", + "responseType": "Schema", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/schemas/*}:deleteRevision", + "(google.api.method_signature)": "name,revision_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/schemas/*}:deleteRevision" + } + }, + { + "(google.api.method_signature)": "name,revision_id" + } + ] + }, + "DeleteSchema": { + "requestType": "DeleteSchemaRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/schemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/schemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ValidateSchema": { + "requestType": "ValidateSchemaRequest", + "responseType": "ValidateSchemaResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/schemas:validate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/schemas:validate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,schema" + } + ] + }, + "ValidateMessage": { + "requestType": "ValidateMessageRequest", + "responseType": "ValidateMessageResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/schemas:validateMessage", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/schemas:validateMessage", + "body": "*" + } + } + ] + } + } + }, + "Schema": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Schema", + "(google.api.resource).pattern": "projects/{project}/schemas/{schema}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "Type", + "id": 2 + }, + "definition": { + "type": "string", + "id": 3 + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PROTOCOL_BUFFER": 1, + "AVRO": 2 + } + } + } + }, + "SchemaView": { + "values": { + "SCHEMA_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "CreateSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "pubsub.googleapis.com/Schema" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schemaId": { + "type": "string", + "id": 3 + } + } + }, + "GetSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "view": { + "type": "SchemaView", + "id": 2 + } + } + }, + "ListSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "view": { + "type": "SchemaView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListSchemasResponse": { + "fields": { + "schemas": { + "rule": "repeated", + "type": "Schema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSchemaRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "view": { + "type": "SchemaView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListSchemaRevisionsResponse": { + "fields": { + "schemas": { + "rule": "repeated", + "type": "Schema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CommitSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RollbackSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSchemaRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + } + } + }, + "ValidateSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidateSchemaResponse": { + "fields": {} + }, + "ValidateMessageRequest": { + "oneofs": { + "schemaSpec": { + "oneof": [ + "name", + "schema" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Schema" + } + }, + "schema": { + "type": "Schema", + "id": 3 + }, + "message": { + "type": "bytes", + "id": 4 + }, + "encoding": { + "type": "Encoding", + "id": 5 + } + } + }, + "ValidateMessageResponse": { + "fields": {} + }, + "Encoding": { + "values": { + "ENCODING_UNSPECIFIED": 0, + "JSON": 1, + "BINARY": 2 + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "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 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "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 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "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 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "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 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "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 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 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 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/handwritten/pubsub/src/ack-metadata.ts b/handwritten/pubsub/src/ack-metadata.ts new file mode 100644 index 00000000000..a26bf23d8e3 --- /dev/null +++ b/handwritten/pubsub/src/ack-metadata.ts @@ -0,0 +1,118 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {GoogleError, Status} from 'google-gax'; +import {AckResponse, AckResponses} from './subscriber'; + +const permanentFailureInvalidAckId = 'PERMANENT_FAILURE_INVALID_ACK_ID'; +const transientFailurePrefix = 'TRANSIENT_'; + +// If we get these as RPC errors, they will trigger a retry. +const exactlyOnceDeliveryTemporaryRetryErrors = [ + Status.DEADLINE_EXCEEDED, + Status.RESOURCE_EXHAUSTED, + Status.ABORTED, + Status.INTERNAL, + Status.UNAVAILABLE, +]; + +/** + * @private + */ +interface StringToString { + [propname: string]: string; +} + +/** + * Contains information about ack responses that may be used to build + * responses to user ack calls. + * + * @private + */ +export interface AckErrorInfo { + transient: boolean; + response?: AckResponse; + rawErrorCode?: string; + grpcErrorCode?: Status; +} + +export type AckErrorCodes = Map; + +/** + * Processes the raw RPC information when sending a batch of acks + * to the Pub/Sub service. + * + * @private + */ +export function processAckErrorInfo(rpcError: GoogleError): AckErrorCodes { + const ret = new Map(); + + if (!rpcError.errorInfoMetadata) { + return ret; + } + + // The typing for errorInfoMetadata is currently incorrect. + const metadata = rpcError.errorInfoMetadata as StringToString; + + for (const ackId of Object.getOwnPropertyNames(metadata)) { + const code = metadata[ackId]; + + if (code === permanentFailureInvalidAckId) { + ret.set(ackId, { + transient: false, + response: AckResponses.Invalid, + rawErrorCode: code, + }); + } else if (code.startsWith(transientFailurePrefix)) { + ret.set(ackId, { + transient: true, + rawErrorCode: code, + }); + } else { + ret.set(ackId, { + transient: false, + response: AckResponses.Other, + rawErrorCode: code, + }); + } + } + + return ret; +} + +/** + * For a completely failed RPC call, this will find the appropriate + * error information to return to an ack() caller. + * + * @private + */ +export function processAckRpcError(grpcCode: Status): AckErrorInfo { + const ackError: AckErrorInfo = { + transient: exactlyOnceDeliveryTemporaryRetryErrors.includes(grpcCode), + grpcErrorCode: grpcCode, + }; + switch (grpcCode) { + case Status.PERMISSION_DENIED: + ackError.response = AckResponses.PermissionDenied; + break; + case Status.FAILED_PRECONDITION: + ackError.response = AckResponses.FailedPrecondition; + break; + default: + ackError.response = AckResponses.Other; + break; + } + + return ackError; +} diff --git a/handwritten/pubsub/src/debug.ts b/handwritten/pubsub/src/debug.ts new file mode 100644 index 00000000000..532b6d2febb --- /dev/null +++ b/handwritten/pubsub/src/debug.ts @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * Represents a debug message the user might want to print out for logging + * while debugging or whatnot. These will always come by way of the 'error' + * channel on streams or other event emitters. It's completely fine to + * ignore them, as some will just be verbose logging info, but they may + * help figure out what's going wrong. Support may also ask you to catch + * these channels, which you can do like so: + * + * ``` + * subscription.on('debug', msg => console.log(msg.message)); + * ``` + * + * These values are _not_ guaranteed to remain stable, even within a major + * version, so don't depend on them for your program logic. Debug outputs + * may be added or removed at any time, without warning. + */ +export class DebugMessage { + constructor( + public message: string, + public error?: Error, + ) {} +} diff --git a/handwritten/pubsub/src/default-options.ts b/handwritten/pubsub/src/default-options.ts new file mode 100644 index 00000000000..7f09392d51d --- /dev/null +++ b/handwritten/pubsub/src/default-options.ts @@ -0,0 +1,59 @@ +/*! + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {Duration} from './temporal'; + +// These options will be used library-wide. They're specified here so that +// they can be changed easily in the future. +export const defaultOptions = { + subscription: { + // The maximum number of messages that may be queued for receiving, + // with the default lease manager. + maxOutstandingMessages: 1000, + + // The maximum amount of message data that may be queued for receiving, + // in bytes, with the default lease manager. + maxOutstandingBytes: 100 * 1024 * 1024, + + // The minimum length of time a message's lease will be extended by. + minAckDeadline: undefined, + + // The maximum length of time a message's lease will be extended by. + maxAckDeadline: Duration.from({minutes: 10}), + + // The maximum amount of time that a message's lease will ever + // be extended. + maxExtensionTime: Duration.from({minutes: 60}), + + // The maximum number of subscription streams/threads that will ever + // be opened. + maxStreams: 5, + + // The starting number of seconds that ack deadlines will be extended. + startingAckDeadline: Duration.from({seconds: 10}), + }, + + publish: { + // The maximum number of messages we'll batch up for publish(). + maxOutstandingMessages: 100, + + // The maximum size of the total batched up messages for publish(). + maxOutstandingBytes: 1 * 1024 * 1024, + + // The maximum time we'll wait to send batched messages, in milliseconds. + maxDelayMillis: 10, + }, +}; diff --git a/handwritten/pubsub/src/exponential-retry.ts b/handwritten/pubsub/src/exponential-retry.ts new file mode 100644 index 00000000000..95cc2b5e39f --- /dev/null +++ b/handwritten/pubsub/src/exponential-retry.ts @@ -0,0 +1,204 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 Heap from 'heap-js'; +import {Duration} from './temporal'; + +/** + * This interface specifies what we'll add to retried items in order + * to track them through the exponential backoff. + * + * @private + */ +export interface RetriedItem { + retryInfo?: RetryInfo; +} + +/** + * These items will go inside the added retry metadata. + * + * @private + */ +export interface RetryInfo { + // Date.now() value of when we first started retrying. + firstRetry: number; + + // Date.now() value of when we will next retry. + nextRetry: number; + + // The current multiplier for exponential backoff. + multiplier: number; + + // The user callback to call when it next comes off retry wait. + callback: RetryCallback; +} + +// Compare function for Heap so we can use it as a priority queue. +function comparator(a: RetriedItem, b: RetriedItem) { + return a.retryInfo!.nextRetry - b.retryInfo!.nextRetry; +} + +/** + * Users of this class will pass in a callback in this form when + * an item is ready to be retried. The item must be placed + * back on the queue if it needs to be retried again. + * + * @private + */ +export interface RetryCallback { + (item: T, totalTime: Duration): void; +} + +/** + * Provides a helper that will manage your retries using the "truncated + * exponential backoff" strategy. + * + * Most of the pieces of this library are doing retries via gax, but for + * exactly-once delivery, we have some things where gRPC failures won't + * take care of it. + * + * @private + */ +export class ExponentialRetry { + private _items = new Heap>(comparator); + private _backoffMs: number; + private _maxBackoffMs: number; + private _timer?: NodeJS.Timeout; + + constructor(backoff: Duration, maxBackoff: Duration) { + this._backoffMs = backoff.milliseconds; + this._maxBackoffMs = maxBackoff.milliseconds; + } + + /** + * Shut down all operations/timers/etc and return a list of + * items that were still pending retry. + * + * @private + */ + close(): T[] { + if (this._timer) { + clearTimeout(this._timer); + } + + const leftovers = this._items.toArray(); + this._items.clear(); + return leftovers as T[]; + } + + /** + * Place an item on the retry queue. It's important that it's the + * same exact item that was already on the queue, if it's being retried + * more than once. + * + * @private + */ + retryLater(item: T, callback: RetryCallback) { + const retried = item as RetriedItem; + const retryInfo = retried.retryInfo; + + if (!retryInfo) { + // This item's first time through. + retried.retryInfo = { + firstRetry: Date.now(), + nextRetry: Date.now() + this.randomizeDelta(this._backoffMs), + multiplier: 1, + callback, + }; + } else { + // Not the first time - handle backoff. + const nextMultiplier = retryInfo.multiplier * 2; + let delta = this.randomizeDelta(nextMultiplier * this._backoffMs); + if (delta > this._maxBackoffMs) { + delta = this.randomizeDelta(this._maxBackoffMs); + } else { + retryInfo.multiplier = nextMultiplier; + } + retryInfo.nextRetry = Date.now() + delta; + } + + // Re-sort it into the heap with the correct position. + // It's my assumption here that any item that is being retried is + // very likely near or at the top. + this._items.remove(retried); + this._items.push(retried); + + // Schedule the next retry. + this.scheduleRetry(); + } + + /** + * Resets an item that was previously retried. This is useful if you have + * persistent items that just need to be retried occasionally. + * + * @private + */ + reset(item: T) { + const retried = item as RetriedItem; + delete retried.retryInfo; + } + + // Takes a time delta and adds fuzz. + private randomizeDelta(durationMs: number): number { + // The fuzz distance should never exceed one second, but in the + // case of smaller things, don't end up with a negative delta. + const magnitude = durationMs < 1000 ? durationMs : 1000; + const offset = Math.random() * magnitude - magnitude / 2.0; + return durationMs + offset; + } + + // Looks through the queue to see if there's anything to handle. + private doRetries() { + const now = Date.now(); + while (!this._items.isEmpty()) { + const next = this._items.peek()!; + + // Within 10msec is close enough. + if (next.retryInfo!.nextRetry - now < 10) { + this._items.pop(); + + next.retryInfo!.callback( + next as unknown as T, + Duration.from({milliseconds: now - next.retryInfo!.firstRetry}), + ); + } else { + break; + } + } + + // Is there stuff to retry still? + if (!this._items.isEmpty()) { + this.scheduleRetry(); + } + } + + // If there are items to retry, schedule the next timer event. + private scheduleRetry() { + // What's next? + const next = this._items.peek(); + if (next) { + let delta = next.retryInfo!.nextRetry - Date.now(); + if (delta < 0) { + delta = 0; + } + + if (this._timer) { + clearTimeout(this._timer); + } + this._timer = setTimeout(() => { + this.doRetries(); + }, delta); + } + } +} diff --git a/handwritten/pubsub/src/histogram.ts b/handwritten/pubsub/src/histogram.ts new file mode 100644 index 00000000000..0b00223eed6 --- /dev/null +++ b/handwritten/pubsub/src/histogram.ts @@ -0,0 +1,80 @@ +/*! + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface HistogramOptions { + min?: number; + max?: number; +} + +/*! + * The Histogram class is used to capture the lifespan of messages within the + * the client. These durations are then used to calculate the 99th percentile + * of ack deadlines for future messages. + * + * @private + * @class + */ +export class Histogram { + options: HistogramOptions; + data: Map; + length: number; + constructor(options?: HistogramOptions) { + this.options = Object.assign( + {min: 0, max: Number.MAX_SAFE_INTEGER}, + options, + ); + this.data = new Map(); + this.length = 0; + } + /*! + * Adds a value to the histogram. + * + * @private + * @param {numnber} value - The value in milliseconds. + */ + add(value: number): void { + value = Math.ceil(value); + value = Math.max(value, this.options.min!); + value = Math.min(value, this.options.max!); + if (!this.data.has(value)) { + this.data.set(value, 0); + } + const count = this.data.get(value)!; + this.data.set(value, count + 1); + this.length += 1; + } + /*! + * Retrieves the nth percentile of recorded values. + * + * @private + * @param {number} percent The requested percentage. + * @return {number} + */ + percentile(percent: number): number { + percent = Math.min(percent, 100); + let target = this.length - this.length * (percent / 100); + const keys = Array.from(this.data.keys()); + let key; + for (let i = keys.length - 1; i > -1; i--) { + key = keys[i]; + target -= this.data.get(key)!; + if (target <= 0) { + return key; + } + } + return this.options.min!; + } +} diff --git a/handwritten/pubsub/src/iam.ts b/handwritten/pubsub/src/iam.ts new file mode 100644 index 00000000000..eec8932e990 --- /dev/null +++ b/handwritten/pubsub/src/iam.ts @@ -0,0 +1,432 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! + * @module pubsub/iam + */ + +import arrify = require('arrify'); +import {CallOptions, IamProtos} from 'google-gax'; + +import {Omit, PubSub, RequestCallback, ResourceCallback} from './pubsub'; +import {promisifySome} from './util'; + +export type Policy = { + etag?: string | Buffer; +} & Omit; + +export type GetPolicyCallback = RequestCallback; +export type SetPolicyCallback = RequestCallback; + +export type SetPolicyResponse = [Policy]; +export type GetPolicyResponse = [Policy]; + +/** + * Allows us to get the most up to date full name of an object. + * + * @private + */ +export interface Nameable { + name: string; +} + +/** + * Shows which IAM permissions is allowed. + * The key to this object are the IAM permissions (string) and the values are + * booleans, true if permissions are granted to the corresponding key. + */ +export interface IamPermissionsMap { + [key: string]: boolean; +} + +export type TestIamPermissionsResponse = [ + IamPermissionsMap, + IamProtos.google.iam.v1.ITestIamPermissionsResponse, +]; +export type TestIamPermissionsCallback = ResourceCallback< + IamPermissionsMap, + IamProtos.google.iam.v1.ITestIamPermissionsResponse +>; + +/** + * [IAM (Identity and Access + * Management)](https://cloud.google.com/pubsub/access_control) allows you to + * set permissions on individual resources and offers a wider range of roles: + * editor, owner, publisher, subscriber, and viewer. This gives you greater + * flexibility and allows you to set more fine-grained access control. + * + * For example: + * * Grant access on a per-topic or per-subscription basis, rather than for + * the whole Cloud project. + * * Grant access with limited capabilities, such as to only publish messages + * to a topic, or to only to consume messages from a subscription, but not + * to delete the topic or subscription. + * + * + * *The IAM access control features described in this document are Beta, + * including the API methods to get and set IAM policies, and to test IAM + * permissions. Cloud Pub/Sub's use of IAM features is not covered by any + * SLA or deprecation policy, and may be subject to backward-incompatible + * changes.* + * + * @class + * @param {PubSub} pubsub PubSub Object. + * @param {string} id The name of the topic or subscription. + * + * @see [Access Control Overview]{@link https://cloud.google.com/pubsub/access_control} + * @see [What is Cloud IAM?]{@link https://cloud.google.com/iam/} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * // topic.iam + * + * const subscription = pubsub.subscription('my-subscription'); + * // subscription.iam + * ``` + */ +export class IAM { + pubsub: PubSub; + request: typeof PubSub.prototype.request; + private nameable_: Nameable; + + constructor(pubsub: PubSub, nameOrNameable: Nameable | string) { + this.pubsub = pubsub; + this.request = pubsub.request.bind(pubsub); + if (typeof nameOrNameable === 'string') { + this.nameable_ = { + name: nameOrNameable, + }; + } else { + this.nameable_ = nameOrNameable; + } + } + + get id(): string { + return this.nameable_.name; + } + + /** + * @typedef {array} GetPolicyResponse + * @property {object} 0 The policy. + */ + /** + * @callback GetPolicyCallback + * @param {?Error} err Request error, if any. + * @param {object} acl The policy. + */ + /** + * Get the IAM policy + * + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {GetPolicyCallback} [callback] Callback function. + * @returns {Promise} + * + * @see [Topics: getIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/getIamPolicy} + * @see [Subscriptions: getIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/getIamPolicy} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * topic.iam.getPolicy(function(err, policy, apiResponse) {}); + * + * subscription.iam.getPolicy(function(err, policy, apiResponse) {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.iam.getPolicy().then(function(data) { + * const policy = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + getPolicy(gaxOpts?: CallOptions): Promise; + getPolicy(callback: GetPolicyCallback): void; + getPolicy(gaxOpts: CallOptions, callback: GetPolicyCallback): void; + getPolicy( + optsOrCallback?: CallOptions | GetPolicyCallback, + callback?: GetPolicyCallback, + ): Promise | void { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + resource: this.id, + }; + + this.request( + { + client: 'SubscriberClient', + method: 'getIamPolicy', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + + /** + * @typedef {array} SetPolicyResponse + * @property {object} 0 The policy. + */ + /** + * @callback SetPolicyCallback + * @param {?Error} err Request error, if any. + * @param {object} acl The policy. + */ + /** + * Set the IAM policy + * + * @throws {Error} If no policy is provided. + * + * @param {object} policy The [policy](https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy). + * @param {array} [policy.bindings] Bindings associate members with roles. + * @param {Array} [policy.rules] Rules to be applied to the policy. + * @param {string} [policy.etag] Etags are used to perform a read-modify-write. + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {SetPolicyCallback} callback Callback function. + * @returns {Promise} + * + * @see [Topics: setIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/setIamPolicy} + * @see [Subscriptions: setIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/setIamPolicy} + * @see [Policy]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * const myPolicy = { + * bindings: [ + * { + * role: 'roles/pubsub.subscriber', + * members: + * ['serviceAccount:myotherproject@appspot.gserviceaccount.com'] + * } + * ] + * }; + * + * topic.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {}); + * + * subscription.iam.setPolicy(myPolicy, function(err, policy, apiResponse) + * {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.iam.setPolicy(myPolicy).then(function(data) { + * const policy = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + setPolicy(policy: Policy, gaxOpts?: CallOptions): Promise; + setPolicy( + policy: Policy, + gaxOpts: CallOptions, + callback: SetPolicyCallback, + ): void; + setPolicy(policy: Policy, callback: SetPolicyCallback): void; + setPolicy( + policy: Policy, + optsOrCallback?: CallOptions | SetPolicyCallback, + callback?: SetPolicyCallback, + ): Promise | void { + if (!(typeof policy === 'object')) { + throw new Error('A policy object is required.'); + } + + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + resource: this.id, + policy, + }; + + this.request( + { + client: 'SubscriberClient', + method: 'setIamPolicy', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + + /** + * @callback TestIamPermissionsCallback + * @param {?Error} err Request error, if any. + * @param {TestIamPermissionsAPIResponse} permissions A subset of permissions that the caller is allowed. + * @param {PermissionsResponse} apiResponse The full API response. + */ + /** + * @typedef {array} TestIamPermissionsResponse + * @property {object[]} 0 A subset of permissions that the caller is allowed. + * @property {PermissionsResponse} 1 The full API response. + */ + /** + * @typedef {string[]} PermissionsResponse + * A subset of TestPermissionsRequest.permissions that the caller is allowed. + * @see https://cloud.google.com/pubsub/docs/reference/rpc/google.iam.v1#google.iam.v1.TestIamPermissionsRequest + */ + /** + * Test a set of permissions for a resource. + * + * Permissions with wildcards such as `*` or `storage.*` are not allowed. + * + * @throws {Error} If permissions are not provided. + * + * @param {string|string[]} permissions The permission(s) to test for. + * @param {object} [gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {TestIamPermissionsCallback} [callback] Callback function. + * @returns {Promise} + * + * @see [Topics: testIamPermissions API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/testIamPermissions} + * @see [Subscriptions: testIamPermissions API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/testIamPermissions} + * @see [Permissions Reference]{@link https://cloud.google.com/pubsub/access_control#permissions} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * //- + * // Test a single permission. + * //- + * const test = 'pubsub.topics.update'; + * + * topic.iam.testPermissions(test, function(err, permissions, apiResponse) { + * console.log(permissions); + * // { + * // "pubsub.topics.update": true + * // } + * }); + * + * //- + * // Test several permissions at once. + * //- + * const tests = [ + * 'pubsub.subscriptions.consume', + * 'pubsub.subscriptions.update' + * ]; + * + * subscription.iam.testPermissions(tests, function(err, permissions) { + * console.log(permissions); + * // { + * // "pubsub.subscriptions.consume": true, + * // "pubsub.subscriptions.update": false + * // } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.iam.testPermissions(test).then(function(data) { + * const permissions = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + testPermissions( + permissions: string | string[], + gaxOpts?: CallOptions, + ): Promise; + testPermissions( + permissions: string | string[], + gaxOpts: CallOptions, + callback: TestIamPermissionsCallback, + ): void; + testPermissions( + permissions: string | string[], + callback: TestIamPermissionsCallback, + ): void; + testPermissions( + permissions: string | string[], + optsOrCallback?: CallOptions | TestIamPermissionsCallback, + callback?: TestIamPermissionsCallback, + ): Promise | void { + if (!Array.isArray(permissions) && !(typeof permissions === 'string')) { + throw new Error('Permissions are required.'); + } + + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + resource: this.id, + permissions: arrify(permissions), + }; + + this.request( + { + client: 'SubscriberClient', + method: 'testIamPermissions', + reqOpts, + gaxOpts, + }, + (err, resp) => { + if (err) { + callback!(err, null, resp!); + return; + } + + const availablePermissions = arrify(resp!.permissions!); + const permissionHash: IamPermissionsMap = ( + permissions as string[] + ).reduce( + (acc, permission) => { + acc[permission] = availablePermissions.indexOf(permission) > -1; + return acc; + }, + {} as {[key: string]: boolean}, + ); + callback!(null, permissionHash, resp!); + }, + ); + } +} + +/*! Developer Documentation + * + * Existing async methods (except for streams) will return a Promise in the event + * that a callback is omitted. Future methods will not allow for a callback. + * (Use .then() on the returned Promise instead.) + */ +promisifySome(IAM, IAM.prototype, [ + 'getPolicy', + 'setPolicy', + 'testPermissions', +]); diff --git a/handwritten/pubsub/src/index.ts b/handwritten/pubsub/src/index.ts new file mode 100644 index 00000000000..2b1432cdbdc --- /dev/null +++ b/handwritten/pubsub/src/index.ts @@ -0,0 +1,188 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @namespace google.pubsub.v1 + */ +/** + * @namespace google.protobuf + */ + +/** + * The default export of the `@google-cloud/pubsub` package is the + * {@link PubSub} class. + * + * See {@link PubSub} and {@link ClientConfig} for client methods and + * configuration options. + * + * @module {PubSub} @google-cloud/pubsub + * @alias nodejs-pubsub + * + * @example Install the client library with npm: + * ``` + * npm install @google-cloud/pubsub + * + * ``` + * @example Import the client library + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * + * ``` + * @example Create a client that uses Application Default Credentials (ADC): + * ``` + * const pubsub = new PubSub(); + * + * ``` + * @example Create a client with explicit credentials: + * ``` + * const pubsub = new PubSub({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json' + * }); + * + * ``` + * @example include:samples/quickstart.js + * region_tag:pubsub_quickstart_create_topic + * Full quickstart example: + */ + +/** + * Reference to internal generated clients, advanced use only. + * + * @name PubSub.v1 + * @see v1.PublisherClient + * @see v1.SubscriberClient + * @type {object} + * @property {constructor} PublisherClient + * Reference to {@link v1.PublisherClient}. + * @property {constructor} SubscriberClient + * Reference to {@link v1.SubscriberClient}. + */ + +/** + * Reference to internal generated clients, advanced use only. + * + * @name module:@google-cloud/pubsub.v1 + * @see v1.PublisherClient + * @see v1.SubscriberClient + * @type {object} + * @property {constructor} PublisherClient + * Reference to {@link v1.PublisherClient}. + * @property {constructor} SubscriberClient + * Reference to {@link v1.SubscriberClient}. + */ +import * as v1 from './v1'; +export {v1}; +export {ServiceError, CallOptions} from 'google-gax'; +export { + Policy, + GetPolicyCallback, + SetPolicyCallback, + SetPolicyResponse, + GetPolicyResponse, + IamPermissionsMap, + TestIamPermissionsResponse, + TestIamPermissionsCallback, + IAM, +} from './iam'; +export {Attributes, PublishCallback, PublishOptions} from './publisher'; +export {BatchPublishOptions} from './publisher/message-batch'; +export {PublishError} from './publisher/publish-error'; +export {FlowControlOptions} from './publisher/flow-control'; +export { + PageOptions, + GetSnapshotsCallback, + GetSnapshotsResponse, + GetSubscriptionsCallback, + GetSubscriptionsResponse, + GetTopicsCallback, + GetTopicsResponse, + EmptyCallback, + EmptyResponse, + ExistsCallback, + ExistsResponse, + PubSub, + ClientConfig, +} from './pubsub'; +export { + CreateSnapshotCallback, + CreateSnapshotResponse, + SeekCallback, + SeekResponse, + Snapshot, +} from './snapshot'; +export {Message, StatusError, SubscriberOptions} from './subscriber'; +export { + Schema, + CreateSchemaResponse, + ISchema, + SchemaType, + SchemaTypes, + ICreateSchemaRequest, + SchemaEncoding, + SchemaView, + SchemaViews, + Encodings, + SchemaMessageMetadata, +} from './schema'; +export { + PushConfig, + SubscriptionMetadata, + SubscriptionOptions, + SubscriptionCloseCallback, + SubscriptionCloseOptions, + SubscriptionCloseBehaviors, + CreateSubscriptionOptions, + CreateSubscriptionCallback, + CreateSubscriptionResponse, + GetSubscriptionOptions, + GetSubscriptionCallback, + GetSubscriptionResponse, + GetSubscriptionMetadataCallback, + GetSubscriptionMetadataResponse, + SetSubscriptionMetadataCallback, + SetSubscriptionMetadataResponse, + Subscription, + AckError, + AckResponse, + AckResponses, +} from './subscription'; +export { + CreateTopicCallback, + CreateTopicResponse, + GetTopicCallback, + GetTopicResponse, + GetTopicOptions, + GetTopicMetadataCallback, + GetTopicMetadataResponse, + GetTopicSubscriptionsCallback, + GetTopicSubscriptionsResponse, + SetTopicMetadataCallback, + SetTopicMetadataResponse, + Topic, + TopicMetadata, +} from './topic'; +export {Duration, TotalOfUnit, DurationLike} from './temporal'; +export {DebugMessage} from './debug'; + +if (process.env.DEBUG_GRPC) { + console.info('gRPC logging set to verbose'); + const grpc = require('google-gax').grpc; + grpc.setLogger(console); + grpc.setLogVerbosity(grpc.logVerbosity.DEBUG); +} +import * as protos from '../protos/protos'; +export {protos}; diff --git a/handwritten/pubsub/src/lease-manager.ts b/handwritten/pubsub/src/lease-manager.ts new file mode 100644 index 00000000000..d8afdb11a35 --- /dev/null +++ b/handwritten/pubsub/src/lease-manager.ts @@ -0,0 +1,389 @@ +/*! + * Copyright 2018 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {EventEmitter} from 'events'; + +import {AckError, Message, Subscriber} from './subscriber'; +import {defaultOptions} from './default-options'; +import {Duration} from './temporal'; +import {DebugMessage} from './debug'; +import {logs as baseLogs} from './logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + callbackDelivery: baseLogs.pubsub.sublog('callback-delivery'), + callbackExceptions: baseLogs.pubsub.sublog('callback-exceptions'), + expiry: baseLogs.pubsub.sublog('expiry'), + subscriberFlowControl: baseLogs.pubsub.sublog('subscriber-flow-control'), +}; + +export interface FlowControlOptions { + allowExcessMessages?: boolean; + maxBytes?: number; + maxMessages?: number; +} + +/** + * @typedef {object} FlowControlOptions + * @property {boolean} [allowExcessMessages=true] PubSub delivers messages in + * batches with no way to configure the batch size. Sometimes this can be + * overwhelming if you only want to process a few messages at a time. + * Setting this option to false will make the client manage any excess + * messages until you're ready for them. This will prevent them from being + * redelivered and make the maxMessages option behave more predictably. + * @property {number} [maxBytes=104857600] The desired amount of memory to + * allow message data to consume. (Default: 100MB) It's possible that this + * value will be exceeded, since messages are received in batches. + * @property {number} [maxMessages=1000] The desired number of messages to allow + * in memory before pausing the message stream. Unless allowExcessMessages + * is set to false, it is very likely that this value will be exceeded since + * any given message batch could contain a greater number of messages than + * the desired amount of messages. + */ +/** + * Manages a Subscribers inventory while auto-magically extending the message + * deadlines. + * + * @private + * @class + * + * @param {Subscriber} sub The subscriber to manage leases for. + * @param {FlowControlOptions} options Flow control options. + */ +export class LeaseManager extends EventEmitter { + bytes: number; + private _isLeasing: boolean; + private _messages: Set; + private _options!: FlowControlOptions; + private _pending: Message[]; + private _subscriber: Subscriber; + private _timer?: NodeJS.Timeout; + constructor(sub: Subscriber, options = {}) { + super(); + + this.bytes = 0; + this._isLeasing = false; + this._messages = new Set(); + this._pending = []; + this._subscriber = sub; + + this.setOptions(options); + } + /** + * @type {number} + * @private + */ + get pending(): number { + return this._pending.length; + } + /** + * @type {number} + * @private + */ + get size(): number { + return this._messages.size; + } + /** + * Adds a message to the inventory, kicking off the deadline extender if it + * isn't already running. + * + * @fires LeaseManager#full + * + * @param {Message} message The message. + * @private + */ + add(message: Message): void { + const {allowExcessMessages} = this._options; + const wasFull = this.isFull(); + + this._messages.add(message); + this.bytes += message.length; + + message.subSpans.flowStart(); + + if (allowExcessMessages! || !wasFull) { + this._dispense(message); + } else { + if (this.pending === 0) { + logs.subscriberFlowControl.info( + 'subscriber for %s is client-side flow blocked', + this._subscriber.name, + ); + } + this._pending.push(message); + } + + if (!this._isLeasing) { + this._isLeasing = true; + this._scheduleExtension(); + } + + if (!wasFull && this.isFull()) { + this.emit('full'); + } + } + /** + * Removes ALL messages from inventory, and returns the ones removed. + * + * @fires LeaseManager#free + * @fires LeaseManager#empty + * + * @private + */ + clear(): Message[] { + const wasFull = this.isFull(); + const wasEmpty = this.isEmpty(); + + if (this.pending > 0) { + logs.subscriberFlowControl.info( + 'subscriber for %s is unblocking client-side flow due to clear()', + this._subscriber.name, + ); + } + + this._pending = []; + const remaining = Array.from(this._messages); + this._messages.clear(); + this.bytes = 0; + + if (wasFull) { + process.nextTick(() => this.emit('free')); + } + if (!wasEmpty && this.isEmpty()) { + process.nextTick(() => this.emit('empty')); + } + + this._cancelExtension(); + + return remaining; + } + + /** + * Indicates if we're at or over capacity. + * + * @returns {boolean} + * @private + */ + isFull(): boolean { + const {maxBytes, maxMessages} = this._options; + return this.size >= maxMessages! || this.bytes >= maxBytes!; + } + + /** + * True if we have no messages in leasing. + * + * @returns {boolean} + * @private + */ + isEmpty(): boolean { + return this._messages.size === 0; + } + + /** + * Removes a message from the inventory. Stopping the deadline extender if no + * messages are left over. + * + * @fires LeaseManager#free + * @fires LeaseManager#empty + * + * @param {Message} message The message to remove. + * @private + */ + remove(message: Message): void { + if (!this._messages.has(message)) { + return; + } + + const wasFull = this.isFull(); + + this._messages.delete(message); + this.bytes -= message.length; + + if (wasFull && !this.isFull()) { + process.nextTick(() => this.emit('free')); + } else if (this._pending.includes(message)) { + const index = this._pending.indexOf(message); + this._pending.splice(index, 1); + } else if (this.pending > 0) { + if (this.pending > 1) { + logs.subscriberFlowControl.info( + 'subscriber for %s dispensing one blocked message', + this._subscriber.name, + ); + } else { + logs.subscriberFlowControl.info( + 'subscriber for %s fully unblocked on client-side flow control', + this._subscriber.name, + ); + } + + this._dispense(this._pending.shift()!); + } + + if (this.isEmpty()) { + this.emit('empty'); + } + + if (this.size === 0 && this._isLeasing) { + this._cancelExtension(); + } + } + /** + * Sets options for the LeaseManager. + * + * @param {FlowControlOptions} [options] The options. + * + * @throws {RangeError} If both maxExtension and maxExtensionMinutes are set. + * + * @private + */ + setOptions(options: FlowControlOptions): void { + const defaults: FlowControlOptions = { + allowExcessMessages: true, + maxBytes: defaultOptions.subscription.maxOutstandingBytes, + maxMessages: defaultOptions.subscription.maxOutstandingMessages, + }; + + this._options = Object.assign(defaults, options); + } + /** + * Stops extending message deadlines. + * + * @private + */ + private _cancelExtension(): void { + this._isLeasing = false; + + if (this._timer) { + clearTimeout(this._timer); + delete this._timer; + } + } + /** + * Emits the message. Emitting messages is very slow, so to avoid it acting + * as a bottleneck, we're wrapping it in nextTick. + * + * @private + * + * @fires Subscriber#message + * + * @param {Message} message The message to emit. + */ + private _dispense(message: Message): void { + if (this._subscriber.isOpen) { + message.subSpans.flowEnd(); + process.nextTick(() => { + message.dispatched(); + logs.callbackDelivery.info( + 'message (ID %s, ackID %s) delivery to user callbacks', + message.id, + message.ackId, + ); + message.subSpans.processingStart(this._subscriber.name); + try { + this._subscriber.emit('message', message); + } catch (e: unknown) { + logs.callbackExceptions.error( + 'message (ID %s, ackID %s) caused a user callback exception: %o', + message.id, + message.ackId, + e, + ); + this._subscriber.emit( + 'debug', + new DebugMessage('error during user callback', e as Error), + ); + } + }); + } + } + /** + * Loops through inventory and extends the deadlines for any messages that + * have not hit the max extension option. + * + * @private + */ + private _extendDeadlines(): void { + const deadline = Duration.from({seconds: this._subscriber.ackDeadline}); + const maxExtensionMinutes = + this._subscriber.maxExtensionTime.totalOf('minute'); + + for (const message of this._messages) { + // Lifespan here is in minutes. + const lifespan = (Date.now() - message.received) / (60 * 1000); + + if (lifespan < maxExtensionMinutes) { + message.subSpans.modAckStart(deadline, false); + + if (this._subscriber.isExactlyOnceDelivery) { + message + .modAckWithResponse(deadline.totalOf('second')) + .catch(e => { + // In the case of a permanent failure (temporary failures are retried), + // we need to stop trying to lease-manage the message. + message.ackFailed(e as AckError); + this.remove(message); + }) + .finally(() => { + message.subSpans.modAckEnd(); + }); + } else { + message.modAck(deadline.totalOf('second')); + message.subSpans.modAckStart(deadline, false); + } + } else { + logs.expiry.warn( + 'message (ID %s, ackID %s) has been dropped from leasing due to a timeout', + message.id, + message.ackId, + ); + this.remove(message); + } + } + + if (this._isLeasing) { + this._scheduleExtension(); + } + } + /** + * Creates a timeout(ms) that should allow us to extend any message deadlines + * before they would be redelivered. + * + * @private + * + * @returns {number} + */ + private _getNextExtensionTimeoutMs(): number { + const jitter = Math.random(); + const deadline = this._subscriber.ackDeadline * 1000; + const latency = this._subscriber.modAckLatency; + + return (deadline * 0.9 - latency) * jitter; + } + /** + * Schedules an deadline extension for all messages. + * + * @private + */ + private _scheduleExtension(): void { + const timeout = this._getNextExtensionTimeoutMs(); + this._timer = setTimeout(() => this._extendDeadlines(), timeout); + } +} diff --git a/handwritten/pubsub/src/logs.ts b/handwritten/pubsub/src/logs.ts new file mode 100644 index 00000000000..b6c9aa68f68 --- /dev/null +++ b/handwritten/pubsub/src/logs.ts @@ -0,0 +1,24 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {loggingUtils} from 'google-gax'; + +/** + * Base logger. Other loggers will derive from this one. + * + * @private + */ +export const logs = { + pubsub: loggingUtils.log('pubsub'), +}; diff --git a/handwritten/pubsub/src/message-queues.ts b/handwritten/pubsub/src/message-queues.ts new file mode 100644 index 00000000000..3b4600c7ddf --- /dev/null +++ b/handwritten/pubsub/src/message-queues.ts @@ -0,0 +1,711 @@ +/*! + * Copyright 2018 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {CallOptions, GoogleError, grpc, RetryOptions} from 'google-gax'; +import defer = require('p-defer'); +import { + AckErrorInfo, + AckErrorCodes, + processAckErrorInfo, + processAckRpcError, +} from './ack-metadata'; +import {ExponentialRetry} from './exponential-retry'; +import { + AckError, + AckResponse, + AckResponses, + Message, + Subscriber, +} from './subscriber'; +import {Duration} from './temporal'; +import {addToBucket} from './util'; +import {DebugMessage} from './debug'; +import * as tracing from './telemetry-tracing'; +import {logs as baseLogs} from './logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + ackBatch: baseLogs.pubsub.sublog('ack-batch'), +}; + +export interface ReducedMessage { + ackId: string; + tracingSpan?: tracing.Span; +} + +/** + * @private + */ +export interface QueuedMessage { + message: ReducedMessage; + deadline?: number; // seconds + responsePromise?: defer.DeferredPromise; + retryCount: number; +} + +/** + * @private + */ +export type QueuedMessages = Array; + +/** + * Batching options for sending acks and modacks back to the server. + */ +export interface BatchOptions { + callOptions?: CallOptions; + maxMessages?: number; + maxMilliseconds?: number; +} + +// This is the maximum number of bytes we will send for a batch of +// ack/modack messages. The server itself has a maximum of 512KiB, so +// we just pull back a little from that in case of unknown fenceposts. +export const MAX_BATCH_BYTES = 510 * 1024; + +/** + * Error class used to signal a batch failure. + * + * Now that we have exactly-once delivery subscriptions, we'll only + * throw one of these if there was an unknown error. + * + * @class + * + * @param {string} message The error message. + * @param {GoogleError} err The grpc error. + */ +export class BatchError extends DebugMessage { + ackIds: string[]; + code: grpc.status; + details: string; + constructor(err: GoogleError, ackIds: string[], rpc: string) { + super( + `Failed to "${rpc}" for ${ackIds.length} message(s). Reason: ${ + process.env.DEBUG_GRPC ? err.stack : err.message + }`, + err, + ); + + this.ackIds = ackIds; + this.code = err.code!; + this.details = err.message; + } +} + +/** + * @typedef {object} BatchOptions + * @property {object} [callOptions] Request configuration option, outlined + * here: {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html}. + * @property {number} [maxMessages=3000] Maximum number of messages allowed in + * each batch sent. + * @property {number} [maxMilliseconds=100] Maximum duration to wait before + * sending a batch. Batches can be sent earlier if the maxMessages option + * is met before the configured duration has passed. + */ +/** + * Class for buffering ack/modAck requests. + * + * @private + * @class + * + * @param {Subscriber} sub The subscriber we're queueing requests for. + * @param {BatchOptions} options Batching options. + */ +export abstract class MessageQueue { + numPendingRequests: number; + numInFlightRequests: number; + numInRetryRequests: number; + bytes: number; + protected _onFlush?: defer.DeferredPromise; + protected _onDrain?: defer.DeferredPromise; + protected _options!: BatchOptions; + protected _requests: QueuedMessages; + protected _subscriber: Subscriber; + protected _timer?: NodeJS.Timeout; + protected _retrier: ExponentialRetry; + protected _closed = false; + protected abstract _sendBatch(batch: QueuedMessages): Promise; + + constructor(sub: Subscriber, options = {} as BatchOptions) { + this.numPendingRequests = 0; + this.numInFlightRequests = 0; + this.numInRetryRequests = 0; + this.bytes = 0; + this._requests = []; + this._subscriber = sub; + this._retrier = new ExponentialRetry( + Duration.from({seconds: 1}), + Duration.from({seconds: 64}), + ); + + this.setOptions(options); + } + + protected abstract getType(): string; + + /** + * Shuts down this message queue gracefully. Any acks/modAcks pending in + * the queue or waiting for retry will be removed. If exactly-once delivery + * is enabled on the subscription, we'll send permanent failures to + * anyone waiting on completions; otherwise we'll send successes. + * + * If a flush is desired first, do it before calling close(). + * + * @private + */ + close() { + let requests = this._requests; + this._requests = []; + this.numInFlightRequests = this.numPendingRequests = 0; + requests = requests.concat(this._retrier.close()); + const isExactlyOnceDelivery = this._subscriber.isExactlyOnceDelivery; + requests.forEach(r => { + if (r.responsePromise) { + if (isExactlyOnceDelivery) { + r.responsePromise.reject( + new AckError(AckResponses.Invalid, 'Subscriber closed'), + ); + } else { + r.responsePromise.resolve(); + } + } + }); + + this._closed = true; + } + + /** + * Gets the default buffer time in ms. + * + * @returns {number} + * @private + */ + get maxMilliseconds(): number { + return this._options!.maxMilliseconds!; + } + + /*! + * Logs about a batch being sent, and why. + * @private + */ + private logBatch(reason: string) { + logs.ackBatch.info( + '%s triggered %s batch of %i messages, a total of %i bytes', + reason, + this.getType(), + this._requests.length, + this.bytes, + ); + } + + /** + * Adds a message to the queue. + * + * @param {Message} message The message to add. + * @param {number} [deadline] The deadline in seconds. + * @private + */ + async add(message: Message, deadline?: number): Promise { + if (this._closed) { + if (this._subscriber.isExactlyOnceDelivery) { + throw new AckError(AckResponses.Invalid, 'Subscriber closed'); + } else { + return; + } + } + + const {maxMessages, maxMilliseconds} = this._options; + const size = Buffer.byteLength(message.ackId, 'utf8'); + + // If we will go over maxMessages or MAX_BATCH_BYTES by adding this + // message, flush first. (maxMilliseconds is handled by timers.) + if ( + this._requests.length + 1 >= maxMessages! || + this.bytes + size >= MAX_BATCH_BYTES + ) { + const reason = + this._requests.length + 1 >= maxMessages! + ? 'going over count' + : 'going over size'; + await this.flush(reason); + } + + // Add the message to the current batch. + const responsePromise = defer(); + this._requests.push({ + message: { + ackId: message.ackId, + tracingSpan: message.parentSpan, + }, + deadline, + responsePromise, + retryCount: 0, + }); + this.numPendingRequests++; + this.numInFlightRequests++; + this.bytes += size; + + // Ensure that we are counting toward maxMilliseconds by timer. + if (!this._timer) { + this._timer = setTimeout( + () => this.flush('batch timer'), + maxMilliseconds!, + ); + } + + return responsePromise.promise; + } + + /** + * Retry handler for acks/modacks that have transient failures. Unless + * it's passed the final deadline, we will just re-queue it for sending. + * + * @private + */ + private handleRetry(message: QueuedMessage, totalTime: Duration) { + // Has it been too long? + if (totalTime.totalOf('minute') >= 10 || this.shouldFailEarly(message)) { + message.responsePromise?.reject( + new AckError(AckResponses.Invalid, 'Retried for too long'), + ); + return; + } + + // If we'd go over maxMessages or MAX_BATCH_BYTES by re-queueing this + // message, flush first + const {maxMessages} = this._options; + const size = Buffer.byteLength(message.message.ackId, 'utf8'); + if ( + this._requests.length + 1 >= maxMessages! || + this.bytes + size >= MAX_BATCH_BYTES + ) { + const reason = + this._requests.length + 1 >= maxMessages! + ? 'going over count' + : 'going over size'; + + // No need to wait on this one; it clears the old batch out, and acks + // are best effort. + this.flush(reason).catch(() => {}); + } + + // Just throw it in for another round of processing on the next batch. + this._requests.push(message); + this.numPendingRequests++; + this.numInFlightRequests++; + this.numInRetryRequests--; + this.bytes += size; + + // Make sure we actually do have another batch scheduled. + if (!this._timer) { + this._timer = setTimeout( + () => this.flush('retry timer'), + this._options.maxMilliseconds!, + ); + } + } + + /** + * This hook lets a subclass tell the retry handler to go ahead and fail early. + * + * @private + */ + protected shouldFailEarly(message: QueuedMessage): boolean { + message; + return false; + } + + /** + * Sends a batch of messages. + * @private + */ + async flush(reason?: string): Promise { + if (reason) { + this.logBatch(reason); + } + + if (this._timer) { + clearTimeout(this._timer); + delete this._timer; + } + + const batch = this._requests; + const batchSize = batch.length; + const deferred = this._onFlush; + + this._requests = []; + this.bytes = 0; + this.numPendingRequests -= batchSize; + delete this._onFlush; + + try { + const toRetry = await this._sendBatch(batch); + + // We'll get back anything that needs a retry for transient errors. + for (const m of toRetry) { + this.numInRetryRequests++; + m.retryCount++; + this._retrier.retryLater(m, this.handleRetry.bind(this)); + } + } catch (e) { + // These queues are used for ack and modAck messages, which should + // never surface an error to the user level. However, we'll emit + // them onto this debug channel in case debug info is needed. + const err = e as Error; + const debugMsg = new DebugMessage(err.message, err); + this._subscriber.emit('debug', debugMsg); + } + + this.numInFlightRequests -= batchSize; + if (deferred) { + deferred.resolve(); + } + + if ( + this.numInFlightRequests <= 0 && + this.numInRetryRequests <= 0 && + this._onDrain + ) { + this._onDrain.resolve(); + delete this._onDrain; + } + } + + /** + * Returns a promise that resolves after the next flush occurs. + * + * @returns {Promise} + * @private + */ + onFlush(): Promise { + if (!this._onFlush) { + this._onFlush = defer(); + } + return this._onFlush.promise; + } + + /** + * Returns a promise that resolves when all in-flight messages have settled. + */ + onDrain(): Promise { + if (!this._onDrain) { + this._onDrain = defer(); + } + return this._onDrain.promise; + } + + /** + * Set the batching options. + * + * @param {BatchOptions} options Batching options. + * @private + */ + setOptions(options: BatchOptions): void { + const defaults: BatchOptions = { + maxMessages: 3000, + maxMilliseconds: 100, + }; + + this._options = Object.assign(defaults, options); + } + + /** + * Succeed a whole batch of Acks/Modacks for an OK RPC response. + * + * @private + */ + handleAckSuccesses(batch: QueuedMessages) { + // Everyone gets a resolve! + batch.forEach(({responsePromise}) => { + responsePromise?.resolve(); + }); + } + + /** + * If we get an RPC failure of any kind, this will take care of deciding + * what to do for each related ack/modAck. Successful ones will have their + * Promises resolved, permanent errors will have their Promises rejected, + * and transients will be returned for retry. + * + * Note that this is only used for subscriptions with exactly-once + * delivery enabled, so _sendBatch() in the classes below take care of + * resolving errors to success; they don't make it here. + * + * @private + */ + handleAckFailures( + operation: string, + batch: QueuedMessages, + rpcError: GoogleError, + ) { + const toSucceed: QueuedMessages = []; + const toRetry: QueuedMessages = []; + const toError = new Map([ + [AckResponses.PermissionDenied, []], + [AckResponses.FailedPrecondition, []], + [AckResponses.Other, []], + ]); + + // Parse any error codes, both for the RPC call and the ErrorInfo. + const error: AckErrorInfo | undefined = rpcError.code + ? processAckRpcError(rpcError.code) + : undefined; + const codes: AckErrorCodes = processAckErrorInfo(rpcError); + + for (const m of batch) { + if (codes.has(m.message.ackId)) { + // This ack has an ErrorInfo entry, so use that to route it. + const code = codes.get(m.message.ackId)!; + if (code.transient) { + // Transient errors get retried. + toRetry.push(m); + } else { + // It's a permanent error. + addToBucket(toError, code.response!, m); + } + } else if (error !== undefined) { + // This ack doesn't have an ErrorInfo entry, but we do have an RPC + // error, so use that to route it. + if (error.transient) { + toRetry.push(m); + } else { + addToBucket(toError, error.response!, m); + } + } else { + // Looks like this one worked out. + toSucceed.push(m); + } + } + + // To remain consistent with previous behaviour, we will push a debug + // stream message if an unknown error happens during ack. + const others = toError.get(AckResponses.Other); + if (others?.length) { + const otherIds = others.map(e => e.message.ackId); + const debugMsg = new BatchError(rpcError, otherIds, operation); + this._subscriber.emit('debug', debugMsg); + } + + // Take care of following up on all the Promises. + toSucceed.forEach(m => { + m.responsePromise?.resolve(); + }); + for (const e of toError.entries()) { + e[1].forEach(m => { + const exc = new AckError(e[0], rpcError.message); + m.responsePromise?.reject(exc); + }); + } + return { + toError, + toRetry, + }; + } + + /** + * Since we handle our own retries for ack/modAck calls when exactly-once + * delivery is enabled on a subscription, we conditionally need to disable + * the gax retries. This returns an appropriate CallOptions for the + * subclasses to pass down. + * + * @private + */ + protected getCallOptions(): CallOptions | undefined { + let callOptions = this._options.callOptions; + if (this._subscriber.isExactlyOnceDelivery) { + // If exactly-once-delivery is enabled, tell gax not to do retries for us. + callOptions = Object.assign({}, callOptions ?? {}); + callOptions.retry = new RetryOptions([], { + initialRetryDelayMillis: 0, + retryDelayMultiplier: 0, + maxRetryDelayMillis: 0, + }); + } + + return callOptions; + } +} + +/** + * Queues up Acknowledge (ack) requests. + * + * @private + * @class + */ +export class AckQueue extends MessageQueue { + /** + * @private + * @returns The name of the items in this queue. + */ + protected getType(): string { + return 'ack'; + } + + /** + * Sends a batch of ack requests. + * + * @private + * + * @param {Array.>} batch Array of ackIds and deadlines. + * @return {Promise} + */ + protected async _sendBatch(batch: QueuedMessages): Promise { + const responseSpan = tracing.PubsubSpans.createAckRpcSpan( + batch.map(b => b.message.tracingSpan), + this._subscriber.name, + 'AckQueue._sendBatch', + ); + const client = await this._subscriber.getClient(); + const ackIds = batch.map(({message}) => message.ackId); + const reqOpts = {subscription: this._subscriber.name, ackIds}; + + try { + await client.acknowledge(reqOpts, this.getCallOptions()); + + // It's okay if these pass through since they're successful anyway. + this.handleAckSuccesses(batch); + responseSpan?.end(); + return []; + } catch (e) { + // If exactly-once delivery isn't enabled, don't do error processing. We'll + // emulate previous behaviour by resolving all pending Promises with + // a success status, and then throwing a BatchError for debug logging. + if (!this._subscriber.isExactlyOnceDelivery) { + batch.forEach(m => { + m.responsePromise?.resolve(); + }); + throw new BatchError(e as GoogleError, ackIds, 'ack'); + } else { + const grpcError = e as GoogleError; + try { + const results = this.handleAckFailures('ack', batch, grpcError); + return results.toRetry; + } catch (e) { + // This should only ever happen if there's a code failure. + const err = e as Error; + this._subscriber.emit('debug', new DebugMessage(err.message, err)); + const exc = new AckError(AckResponses.Other, 'Code error'); + batch.forEach(m => { + m.responsePromise?.reject(exc); + }); + responseSpan?.end(); + return []; + } + } + } + } +} + +/** + * Queues up ModifyAckDeadline requests and sends them out in batches. + * + * @private + * @class + */ +export class ModAckQueue extends MessageQueue { + /** + * @private + * @returns The name of the items in this queue. + */ + protected getType(): string { + return 'modack/nack'; + } + + /** + * Sends a batch of modAck requests. Each deadline requires its own request, + * so we have to group all the ackIds by deadline and send multiple requests. + * + * @private + * + * @param {Array.>} batch Array of ackIds and deadlines. + * @return {Promise} + */ + protected async _sendBatch(batch: QueuedMessages): Promise { + const client = await this._subscriber.getClient(); + const subscription = this._subscriber.name; + const modAckTable: {[index: string]: QueuedMessages} = batch.reduce( + (table: {[index: string]: QueuedMessages}, message) => { + if (!table[message.deadline!]) { + table[message.deadline!] = []; + } + + table[message.deadline!].push(message); + return table; + }, + {}, + ); + + const callOptions = this.getCallOptions(); + const modAckRequests = Object.keys(modAckTable).map(async deadline => { + const messages = modAckTable[deadline]; + const ackIds = messages.map(m => m.message.ackId); + const ackDeadlineSeconds = Number(deadline); + const reqOpts = {subscription, ackIds, ackDeadlineSeconds}; + + const responseSpan = tracing.PubsubSpans.createModackRpcSpan( + messages.map(b => b.message.tracingSpan), + this._subscriber.name, + ackDeadlineSeconds === 0 ? 'nack' : 'modack', + 'ModAckQueue._sendBatch', + Duration.from({seconds: ackDeadlineSeconds}), + ); + + try { + await client.modifyAckDeadline(reqOpts, callOptions); + + responseSpan?.end(); + + // It's okay if these pass through since they're successful anyway. + this.handleAckSuccesses(messages); + return []; + } catch (e) { + // If exactly-once delivery isn't enabled, don't do error processing. We'll + // emulate previous behaviour by resolving all pending Promises with + // a success status, and then throwing a BatchError for debug logging. + if (!this._subscriber.isExactlyOnceDelivery) { + batch.forEach(m => { + m.responsePromise?.resolve(); + }); + throw new BatchError(e as GoogleError, ackIds, 'modAck'); + } else { + const grpcError = e as GoogleError; + + const newBatch = this.handleAckFailures( + 'modAck', + messages, + grpcError, + ); + return newBatch.toRetry; + } + } + }); + + // This catches the sub-failures and bubbles up anything we need to bubble. + const allNewBatches: QueuedMessages[] = await Promise.all(modAckRequests); + return allNewBatches.reduce((p: QueuedMessage[], c: QueuedMessage[]) => [ + ...(p ?? []), + ...c, + ]); + } + + // For modacks only, we'll stop retrying after 3 tries. + protected shouldFailEarly(message: QueuedMessage): boolean { + return message.retryCount >= 3; + } +} diff --git a/handwritten/pubsub/src/message-stream.ts b/handwritten/pubsub/src/message-stream.ts new file mode 100644 index 00000000000..60c404bcb85 --- /dev/null +++ b/handwritten/pubsub/src/message-stream.ts @@ -0,0 +1,563 @@ +/*! + * Copyright 2018 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {promisify} from '@google-cloud/promisify'; +import {ClientStub, GoogleError, grpc} from 'google-gax'; +import * as isStreamEnded from 'is-stream-ended'; +import {PassThrough} from 'stream'; + +import {PullRetry} from './pull-retry'; +import {Subscriber} from './subscriber'; +import {google} from '../protos/protos'; +import {defaultOptions} from './default-options'; +import {Duration} from './temporal'; +import {ExponentialRetry} from './exponential-retry'; +import {DebugMessage} from './debug'; +import {logs as baseLogs} from './logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + subscriberStreams: baseLogs.pubsub.sublog('subscriber-streams'), +}; + +/*! + * Frequency to ping streams. + */ +const KEEP_ALIVE_INTERVAL = 30000; + +/*! + * Deadline for the stream. + */ +const PULL_TIMEOUT = require('./v1/subscriber_client_config.json').interfaces[ + 'google.pubsub.v1.Subscriber' +].methods.StreamingPull.timeout_millis; + +/** + * @typedef {object} MessageStreamOptions + * @property {number} [highWaterMark=0] Configures the Buffer level for all + * underlying streams. See + * {@link https://nodejs.org/en/docs/guides/backpressuring-in-streams/} for + * more details. + * @property {number} [maxStreams=5] Number of streaming connections to make. + * @property {number} [timeout=300000] Timeout for establishing a connection. + */ +export interface MessageStreamOptions { + highWaterMark?: number; + maxStreams?: number; + timeout?: number; + retryMinBackoff?: Duration; + retryMaxBackoff?: Duration; +} + +/*! + * default stream options + */ +const DEFAULT_OPTIONS: MessageStreamOptions = { + highWaterMark: 0, + maxStreams: defaultOptions.subscription.maxStreams, + timeout: 300000, + retryMinBackoff: Duration.from({milliseconds: 100}), + retryMaxBackoff: Duration.from({seconds: 60}), +}; + +interface StreamState { + highWaterMark: number; +} + +type StreamingPullRequest = google.pubsub.v1.IStreamingPullRequest; +type PullResponse = google.pubsub.v1.IPullResponse; +type PullStream = grpc.ClientDuplexStream< + StreamingPullRequest, + PullResponse +> & { + _readableState: StreamState; +}; + +/** + * Error wrapper for gRPC status objects. + * + * @class + * + * @param {object} status The gRPC status object. + */ +export class StatusError extends Error implements grpc.ServiceError { + code: grpc.status; + details: string; + metadata: grpc.Metadata; + constructor(status: grpc.StatusObject) { + super(status.details); + this.code = status.code; + this.details = status.details; + this.metadata = status.metadata; + } +} + +/** + * Error thrown when we fail to open a channel for the message stream. + * + * @class + * + * @param {Error} err The original error. + */ +export class ChannelError extends Error implements grpc.ServiceError { + code: grpc.status; + details: string; + metadata: grpc.Metadata; + constructor(err: Error) { + super( + `Failed to connect to channel. Reason: ${ + process.env.DEBUG_GRPC ? err.stack : err.message + }`, + ); + this.code = err.message.includes('deadline') + ? grpc.status.DEADLINE_EXCEEDED + : grpc.status.UNKNOWN; + this.details = err.message; + this.metadata = new grpc.Metadata(); + } +} + +// Provide a lightweight wrapper around streams so we can track them +// deterministically for retries. +interface StreamTracked { + stream?: PullStream; + receivedStatus?: boolean; +} + +/** + * Streaming class used to manage multiple StreamingPull requests. + * + * @private + * @class + * + * @param {Subscriber} sub The parent subscriber. + * @param {MessageStreamOptions} [options] The message stream options. + */ +export class MessageStream extends PassThrough { + private _keepAliveHandle?: NodeJS.Timeout; + private _options: MessageStreamOptions; + private _retrier: ExponentialRetry; + + private _streams: StreamTracked[]; + + private _subscriber: Subscriber; + constructor(sub: Subscriber, options = {} as MessageStreamOptions) { + options = Object.assign({}, DEFAULT_OPTIONS, options); + + super({objectMode: true, highWaterMark: options.highWaterMark}); + + this._options = options; + this._retrier = new ExponentialRetry<{}>( + options.retryMinBackoff!, // Filled by DEFAULT_OPTIONS + options.retryMaxBackoff!, + ); + + this._streams = []; + for (let i = 0; i < options.maxStreams!; i++) { + this._streams.push({}); + } + + this._subscriber = sub; + } + + /** + * Actually starts the stream setup and subscription pulls. + * This is separated so that others can properly wait on the promise. + * + * @private + */ + async start(): Promise { + await this._fillStreamPool(); + + this._keepAliveHandle = setInterval( + () => this._keepAlive(), + KEEP_ALIVE_INTERVAL, + ); + this._keepAliveHandle.unref(); + } + + /** + * Updates the stream ack deadline with the server. + * + * @param {Duration} deadline The new deadline value to set. + */ + setStreamAckDeadline(deadline: Duration) { + const request: StreamingPullRequest = { + streamAckDeadlineSeconds: deadline.totalOf('second'), + }; + + for (const tracker of this._streams) { + // We don't need a callback on this one, it's advisory. + if (tracker.stream) { + tracker.stream.write(request); + } + } + } + + /** + * Destroys the stream and any underlying streams. + * + * @param {error?} error An error to emit, if any. + * @param {Function} callback Callback for completion of any destruction. + * @private + */ + _destroy(error: Error | null, callback: (error: Error | null) => void): void { + if (this._keepAliveHandle) { + clearInterval(this._keepAliveHandle); + } + + this._retrier.close(); + + for (let i = 0; i < this._streams.length; i++) { + const tracker = this._streams[i]; + if (tracker.stream) { + this._removeStream(i, 'overall message stream destroyed', 'n/a'); + } + } + + callback(error); + } + + /** + * Adds a StreamingPull stream to the combined stream. + * + * @private + * + * @param {stream} stream The StreamingPull stream. + */ + private _replaceStream( + index: number, + stream: PullStream, + reason?: string, + ): void { + this._removeStream(index, reason, 'stream replacement'); + + this._setHighWaterMark(stream); + const tracker = this._streams[index]; + tracker.stream = stream; + tracker.receivedStatus = false; + + stream + .on('error', err => this._onError(index, err)) + .once('status', status => this._onStatus(index, status)) + .on('data', (data: PullResponse) => this._onData(index, data)); + } + + private _onData(index: number, data: PullResponse): void { + // Mark this stream as alive again. (reset backoff) + const tracker = this._streams[index]; + this._retrier.reset(tracker); + + this.emit('data', data); + } + + /** + * Attempts to create and cache the desired number of StreamingPull requests. + * gRPC does not supply a way to confirm that a stream is connected, so our + * best bet is to open the streams and use the client.waitForReady() method to + * confirm everything is ok. + * + * @private + * + * @returns {Promise} + */ + private async _fillStreamPool(): Promise { + if (this.destroyed) { + return; + } + + let client!: ClientStub; + + try { + client = await this._getClient(); + } catch (e) { + const err = e as Error; + this.destroy(err); + } + + const all: Promise[] = []; + for (let i = 0; i < this._streams.length; i++) { + all.push(this._fillOne(i, client, 'initial fill')); + } + await Promise.all(all); + + try { + await this._waitForClientReady(client); + } catch (e) { + const err = e as Error; + this.destroy(err); + } + } + + private async _fillOne(index: number, client?: ClientStub, reason?: string) { + if (this.destroyed) { + logs.subscriberStreams.info( + 'not filling stream %i for reason "%s" because already shut down', + index, + reason, + ); + + return; + } + + const tracker = this._streams[index]; + if (tracker.stream) { + return; + } + + if (!client) { + try { + client = await this._getClient(); + } catch (e) { + logs.subscriberStreams.error( + 'unable to create stream %i: %o', + index, + e, + ); + const err = e as Error; + this.destroy(err); + return; + } + } + + const deadline = Date.now() + PULL_TIMEOUT; + const request: StreamingPullRequest = { + subscription: this._subscriber.name, + streamAckDeadlineSeconds: this._subscriber.ackDeadline, + maxOutstandingMessages: this._subscriber.useLegacyFlowControl + ? 0 + : this._subscriber.maxMessages, + maxOutstandingBytes: this._subscriber.useLegacyFlowControl + ? 0 + : this._subscriber.maxBytes, + }; + const otherArgs = { + headers: { + 'x-goog-request-params': 'subscription=' + this._subscriber.name, + }, + }; + + const stream: PullStream = client.streamingPull({deadline, otherArgs}); + this._replaceStream(index, stream, reason); + stream.write(request); + } + + /** + * It is critical that we keep as few `PullResponse` objects in memory as + * possible to reduce the number of potential redeliveries. Because of this we + * want to bypass gax for StreamingPull requests to avoid creating a Duplexify + * stream, doing so essentially doubles the size of our readable buffer. + * + * @private + * + * @returns {Promise.} + */ + private async _getClient(): Promise { + const client = await this._subscriber.getClient(); + await client.initialize(); + return client.subscriberStub as Promise; + } + + /** + * Since we do not use the streams to ack/modAck messages, they will close + * by themselves unless we periodically send empty messages. + * + * @private + */ + private _keepAlive(): void { + logs.subscriberStreams.info( + 'sending keepAlive to %i streams', + this._streams.length, + ); + this._streams.forEach(tracker => { + // It's possible that a status event fires off (signaling the rpc being + // closed) but the stream hasn't drained yet. Writing to such a stream will + // result in a `write after end` error. + if (!tracker.receivedStatus && tracker.stream) { + tracker.stream.write({}); + } + }); + } + + // Returns the number of tracked streams that contain an actual stream (good or not). + private _activeStreams(): number { + return this._streams.reduce((p, t) => (t.stream ? 1 : 0) + p, 0); + } + + /** + * Once the stream has nothing left to read, we'll remove it and attempt to + * refill our stream pool if needed. + * + * @private + * + * @param {number} index The ended stream. + * @param {object} status The stream status. + */ + private _onEnd(index: number, status: grpc.StatusObject): void { + const willRetry = PullRetry.retry(status); + this._removeStream( + index, + 'stream was closed', + willRetry ? 'will be retried' : 'will not be retried', + ); + + const statusError = new StatusError(status); + if (willRetry) { + const message = `Subscriber stream ${index} has ended with status ${status.code}; will be retried.`; + logs.subscriberStreams.info('%s', message); + this.emit('debug', new DebugMessage(message, statusError)); + if (PullRetry.resetFailures(status)) { + this._retrier.reset(this._streams[index]); + } + this._retrier.retryLater(this._streams[index], () => + this._fillOne(index, undefined, 'retry'), + ); + } else if (this._activeStreams() === 0) { + const message = `Subscriber stream ${index} has ended with status ${status.code}; will not be retried.`; + logs.subscriberStreams.info('%s', message); + this.emit('debug', new DebugMessage(message, statusError)); + + // No streams left, and nothing to retry. + this.destroy(new StatusError(status)); + } + } + + /** + * gRPC will usually emit a status as a ServiceError via `error` event before + * it emits the status itself. In order to cut back on emitted errors, we'll + * wait a tick on error and ignore it if the status has been received. + * + * @private + * + * @param {number} index The stream that errored. + * @param {Error} err The error. + */ + private async _onError(index: number, err: Error): Promise { + await promisify(process.nextTick)(); + + const code = (err as StatusError).code; + const tracker = this._streams[index]; + const receivedStatus = + !tracker.stream || (tracker.stream && !tracker.receivedStatus); + + // For the user-cancelled errors, we don't need to show those, we're handling + // notifying of us closing the stream elsewhere. + if ((err as GoogleError).code !== grpc.status.CANCELLED) { + logs.subscriberStreams.error('error on stream %i: %o', index, err); + } + + if (typeof code !== 'number' || !receivedStatus) { + this.emit('error', err); + } + } + + /** + * gRPC streams will emit a status event once the connection has been + * terminated. This is preferable to end/close events because we'll receive + * information as to why the stream closed and if it is safe to open another. + * + * @private + * + * @param {stream} stream The stream that was closed. + * @param {object} status The status message stating why it was closed. + */ + private _onStatus(index: number, status: grpc.StatusObject): void { + if (this.destroyed) { + return; + } + + const tracker = this._streams[index]; + tracker.receivedStatus = true; + if (!tracker.stream) { + // This shouldn't really happen, but in case wires get crossed. + return; + } + + if (isStreamEnded(tracker.stream)) { + this._onEnd(index, status); + } else { + tracker.stream.once('end', () => this._onEnd(index, status)); + tracker.stream.push(null); + } + } + + /** + * Removes a stream from the combined stream. + * + * @private + * + * @param {number} index The stream to remove. + */ + private _removeStream( + index: number, + reason?: string, + whatNext?: string, + ): void { + const tracker = this._streams[index]; + if (tracker.stream) { + logs.subscriberStreams.info( + 'closing stream %i; why: %s; next: %s', + index, + reason, + whatNext, + ); + tracker.stream.unpipe(this); + tracker.stream.cancel(); + tracker.stream = undefined; + tracker.receivedStatus = undefined; + } + } + + /** + * Neither gRPC nor gax allow for the highWaterMark option to be specified. + * However using the default value (16) it is possible to end up with a lot of + * PullResponse objects stored in internal buffers. If this were to happen + * and the client were slow to process messages, we could potentially see a + * very large number of redeliveries happen before the messages even made it + * to the client. + * + * @private + * + * @param {Duplex} stream The duplex stream to adjust the + * highWaterMarks for. + */ + private _setHighWaterMark(stream: PullStream): void { + stream._readableState.highWaterMark = this._options.highWaterMark!; + } + + /** + * Promisified version of gRPC's Client#waitForReady function. + * + * @private + * + * @param {object} client The gRPC client to wait for. + * @returns {Promise} + */ + private async _waitForClientReady(client: ClientStub): Promise { + const deadline = Date.now() + this._options.timeout!; + + try { + await promisify(client.waitForReady).call(client, deadline); + } catch (e) { + const err = e as Error; + throw new ChannelError(err); + } + } +} diff --git a/handwritten/pubsub/src/publisher/flow-control.ts b/handwritten/pubsub/src/publisher/flow-control.ts new file mode 100644 index 00000000000..6683c9e5ead --- /dev/null +++ b/handwritten/pubsub/src/publisher/flow-control.ts @@ -0,0 +1,191 @@ +/*! + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as defer from 'p-defer'; + +/** + * @typedef FlowControlOptions + * @property {number} [maxOutstandingMessages] The maximum number of messages to + * buffer before publisher flow control kicks in. + * @property {number} [maxOutstandingBytes] The maximum number of bytes to buffer + * before publisher flow control kicks in. + */ +export interface FlowControlOptions { + maxOutstandingMessages?: number; + maxOutstandingBytes?: number; +} + +// Represents a publish request. This details how big the request is, and +// how to let it proceed. +interface QueuedPromise { + promise: Promise; + resolve: () => void; + reject: () => void; + + bytes: number; + messageCount: number; +} + +/** + * Manages flow control handling for max bytes and messages. + * + * Do not use this class externally, it may change without warning. + * @private + * + */ +export class FlowControl { + options: FlowControlOptions = {}; + private bytes: number; + private messages: number; + private requests: QueuedPromise[]; + + constructor(options: FlowControlOptions) { + this.setOptions(options); + this.bytes = this.messages = 0; + this.requests = []; + } + + /** + * Update our options after the fact. + * + * Do not use externally, it may change without warning. + * @private + */ + setOptions(options: FlowControlOptions) { + this.options = options; + + if ( + this.options.maxOutstandingBytes === 0 || + this.options.maxOutstandingMessages === 0 + ) { + // Undefined is okay, but if either is zero, no publishes ever happen. + throw new Error( + 'When using publisher flow control, maxOutstandingBytes and maxOutstandingMessages must not be zero', + ); + } + } + + /** + * @returns {number} The number of bytes that are queued up. + */ + get currentByteCount(): number { + return this.bytes; + } + + /** + * @returns {number} The number of messages that are queued up. + */ + get currentMessageCount(): number { + return this.messages; + } + + /** + * Adds the specified number of bytes or messages to our count. We'll + * assume that this is end running around our queueing mechanisms. + * + * @param {number} bytes The number of bytes to add to the count. + * @param {number} messages The number of messages to add to the count. + */ + addToCount(bytes: number, messages: number): void { + this.bytes += bytes; + this.messages += messages; + } + + /** + * Attempts to queue the specified number of bytes and messages. If + * there are too many things in the publisher flow control queue + * already, we will defer and come back to it. + * + * Do not use externally, it may change without warning. + * @private + */ + async willSend(bytes: number, messages: number): Promise { + // Add this to our queue size. + this.bytes += bytes; + this.messages += messages; + + // If this request won't fit, we have to put it in the queue. + if (this.exceeded()) { + const promise = defer(); + this.requests.push({ + promise: promise.promise, + resolve: promise.resolve, + reject: promise.reject, + bytes, + messageCount: messages, + }); + + // This will pass through when someone else's this.sent() completes. + await promise.promise; + } + } + + /** + * Removes the specified number of bytes and messages from our queued + * counts, after a deferred request was released. If there is enough + * space. + * + * Do not use externally, it may change without warning. + * @private + */ + sent(bytes: number, messages: number) { + this.bytes -= bytes; + this.messages -= messages; + + // This shouldn't happen, but just be sure. + if (this.bytes < 0) this.bytes = 0; + if (this.messages < 0) this.messages = 0; + + // Let things waiting on willSend() have a go, if there's space. + if (this.requests.length > 0 && !this.exceeded()) { + const next = this.requests.shift()!; + next.resolve(); + } + } + + // Just uses wouldExceed() to see if we've already exceeded the limits. + private exceeded(): boolean { + return this.wouldExceed(0, 0); + } + + /** + * Returns true if adding the specified number of bytes or messages + * would exceed limits imposed by configuration. + * + * Do not use externally, it may change without warning. + * @private + */ + wouldExceed(bytes: number, messages: number): boolean { + const totalBytes = this.bytes + bytes; + const totalMessages = this.messages + messages; + + if ( + this.options.maxOutstandingBytes !== undefined && + totalBytes > this.options.maxOutstandingBytes + ) { + return true; + } + + if ( + this.options.maxOutstandingMessages !== undefined && + totalMessages > this.options.maxOutstandingMessages + ) { + return true; + } + + return false; + } +} diff --git a/handwritten/pubsub/src/publisher/flow-publisher.ts b/handwritten/pubsub/src/publisher/flow-publisher.ts new file mode 100644 index 00000000000..34e1a8dd07a --- /dev/null +++ b/handwritten/pubsub/src/publisher/flow-publisher.ts @@ -0,0 +1,148 @@ +/*! + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {Publisher} from '.'; +import {FlowControl} from './flow-control'; +import {PubsubMessage, calculateMessageSize} from './pubsub-message'; +import * as tracing from '../telemetry-tracing'; + +/** + * Encapsulates a series of message publishes from a rapid loop (or similar + * circumstance). + * + * This class is not meant to be instantiated outside of the `@google-cloud/pubsub` + * package. It is returned from {@link Topic#flowControlled}. Messages sent + * through an instance of this class will obey publisher flow control + * settings set through {@link PublisherOptions} on {@link Topic}, across + * all instances returned by {@link Topic#flowControlled} on that {@link Topic}. + */ +export class FlowControlledPublisher { + private publisher: Publisher; + private flowControl: FlowControl; + private idPromises: Promise[]; + + constructor(publisher: Publisher) { + this.publisher = publisher; + this.flowControl = this.publisher.flowControl; + this.idPromises = []; + } + + /** + * Returns true if sending the specified Buffer would result in exceeding the + * limits of the flow control settings. + * + * @param {PubsubMessage} message The data buffer with the message's contents. + * @returns {boolean} True if the message would exceed flow control limits. + */ + wouldExceed(message: PubsubMessage): boolean { + return this.flowControl.wouldExceed(calculateMessageSize(message), 1); + } + + /** + * Publishes a message, subject to flow control restrictions. + * + * If the message can be sent immediately, this will return `null`. Otherwise, + * it will return a Promise that resolves after it's okay to resume + * calling the method. + * + * @param {Buffer} [data] The message contents to be sent. + * @param {Attributes} [attributes] Optional attributes. + * @returns null, or a Promise that resolves when sending may resume. + * + * @example + * ``` + * const wait = flowControlled.publish({data}); + * if (wait) { + * await wait; + * } + * + * ``` + * @example + * ``` + * // It's okay to await unconditionally, it's equivalent to nextTick(). + * await flowControlled.publish(data); + * ``` + */ + publish(message: PubsubMessage): Promise | null { + const flowSpan = message.parentSpan + ? tracing.PubsubSpans.createPublishFlowSpan(message) + : undefined; + const doPublish = () => { + flowSpan?.end(); + this.doPublish(message); + }; + + const size = calculateMessageSize(message); + if (this.flowControl.wouldExceed(size, 1)) { + const waitPromise = this.flowControl.willSend(size, 1); + return waitPromise.then(doPublish); + } else { + void this.flowControl.willSend(size, 1).then(() => {}); + doPublish(); + return null; + } + } + + /** + * Publishes a message unconditionally, updating flow control counters. + * + * You'll generally only want to use this if you want to deal with timing the + * flow control yourself, but you'd like the library to do the bean counting. + * + * @param {Buffer} [data] The message contents to be sent. + * @param {Attributes} [attributes] Optional attributes. + * + * @example + * ``` + * if (!flowControlled.wouldExceed(data)) { + * flowControlled.publishNow(data); + * } + * ``` + */ + publishNow(message: PubsubMessage): void { + this.flowControl.addToCount(calculateMessageSize(message), 1); + this.doPublish(message); + } + + private doPublish(message: PubsubMessage): void { + let idPromise = this.publisher.publishMessage(message); + + // This will defer but not eat any errors. + const publishDone = (id: string) => { + this.flowControl.sent(calculateMessageSize(message), 1); + return id; + }; + idPromise.catch(publishDone); + idPromise = idPromise.then(publishDone); + + this.idPromises.push(idPromise); + } + + /** + * Returns a Promise that will resolve to all of the currently sent + * message IDs (or reject if there is an error). This also clears + * out any currently sent messages, so the next call to `all()` will + * be a clean slate. + * + * @returns {Promise} A Promise that resolves when all current + * messages are sent. + */ + all(): Promise { + const allPromise = Promise.all(this.idPromises); + this.idPromises = []; + return allPromise; + } +} diff --git a/handwritten/pubsub/src/publisher/index.ts b/handwritten/pubsub/src/publisher/index.ts new file mode 100644 index 00000000000..2046c61699f --- /dev/null +++ b/handwritten/pubsub/src/publisher/index.ts @@ -0,0 +1,358 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as extend from 'extend'; +import {CallOptions} from 'google-gax'; +import {isSpanContextValid, Span} from '@opentelemetry/api'; + +import {BatchPublishOptions} from './message-batch'; +import {Queue, OrderedQueue} from './message-queues'; +import {Topic} from '../topic'; +import {RequestCallback, EmptyCallback} from '../pubsub'; +import {defaultOptions} from '../default-options'; +import * as tracing from '../telemetry-tracing'; + +import {FlowControl, FlowControlOptions} from './flow-control'; +import {promisifySome} from '../util'; + +import {PubsubMessage, Attributes} from './pubsub-message'; +export {PubsubMessage, Attributes} from './pubsub-message'; + +export type PublishCallback = RequestCallback; + +export interface PublishOptions { + batching?: BatchPublishOptions; + flowControlOptions?: FlowControlOptions; + gaxOpts?: CallOptions; + messageOrdering?: boolean; +} + +/** + * @typedef PublishOptions + * @property {BatchPublishOptions} [batching] The maximum number of bytes to + * buffer before sending a payload. + * @property {FlowControlOptions} [publisherFlowControl] Publisher-side flow + * control settings. If this is undefined, Ignore will be the assumed action. + * @property {object} [gaxOpts] Request configuration options, outlined + * {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html|here.} + * @property {boolean} [messageOrdering] If true, messages published with the + * same order key in Message will be delivered to the subscribers in the order in which they + * are received by the Pub/Sub system. Otherwise, they may be delivered in + * any order. + */ + +export const BATCH_LIMITS: BatchPublishOptions = { + maxBytes: Math.pow(1024, 2) * 9, + maxMessages: 1000, +}; + +export const flowControlDefaults: FlowControlOptions = { + maxOutstandingBytes: undefined, + maxOutstandingMessages: undefined, +}; + +/** + * A Publisher object allows you to publish messages to a specific topic. + * + * @private + * @class + * + * @see [Topics: publish API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish} + * + * @param {Topic} topic The topic associated with this publisher. + * @param {PublishOptions} [options] Configuration object. + */ +export class Publisher { + topic: Topic; + settings!: PublishOptions; + queue: Queue; + orderedQueues: Map; + flowControl: FlowControl; + + constructor(topic: Topic, options?: PublishOptions) { + this.flowControl = new FlowControl( + options?.flowControlOptions || flowControlDefaults, + ); + this.setOptions(options); + this.topic = topic; + this.queue = new Queue(this); + this.orderedQueues = new Map(); + } + + /** + * Immediately sends all remaining queued data. This is mostly useful + * if you are planning to call close() on the PubSub object that holds + * the server connections. + * + * @private + * + * @param {EmptyCallback} [callback] Callback function. + * @returns {Promise} + */ + flush(): Promise; + flush(callback: EmptyCallback): void; + flush(callback?: EmptyCallback): Promise | void { + const definedCallback = callback ? callback : () => {}; + + const toDrain = [this.queue, ...Array.from(this.orderedQueues.values())]; + + const allDrains = Promise.all( + toDrain.map( + q => + new Promise(resolve => { + const flushResolver = () => { + resolve(); + + // flush() may be called more than once, so remove these + // event listeners after we've completed flush(). + q.removeListener('drain', flushResolver); + }; + q.on('drain', flushResolver); + }), + ), + ); + + const allPublishes = Promise.all(toDrain.map(q => q.publishDrain())); + + allPublishes + .then(() => allDrains) + .then(() => { + definedCallback(null); + }) + .catch(definedCallback); + } + + /** + * Publish the provided message. + * + * @deprecated use {@link Publisher#publishMessage} instead. + * + * @private + * @see Publisher#publishMessage + * + * @param {buffer} data The message data. This must come in the form of a + * Buffer object. + * @param {object.} [attributes] Attributes for this message. + * @param {PublishCallback} [callback] Callback function. + * @returns {Promise} + */ + publish(data: Buffer, attributes?: Attributes): Promise; + publish(data: Buffer, callback: PublishCallback): void; + publish( + data: Buffer, + attributes: Attributes, + callback: PublishCallback, + ): void; + publish( + data: Buffer, + attrsOrCb?: Attributes | PublishCallback, + callback?: PublishCallback, + ): Promise | void { + const attributes = typeof attrsOrCb === 'object' ? attrsOrCb : {}; + callback = typeof attrsOrCb === 'function' ? attrsOrCb : callback; + return this.publishMessage({data, attributes}, callback!); + } + + /** + * Publish the provided message. + * + * @private + * + * @throws {TypeError} If data is not a Buffer object. + * @throws {TypeError} If any value in `attributes` object is not a string. + * + * @param {PubsubMessage} [message] Options for this message. + * @param {PublishCallback} [callback] Callback function. + */ + publishMessage(message: PubsubMessage): Promise; + publishMessage(message: PubsubMessage, callback: PublishCallback): void; + publishMessage( + message: PubsubMessage, + callback?: PublishCallback, + ): Promise | void { + const {data, attributes = {}} = message; + + // We must have at least one of: + // - `data` as a Buffer + // - `attributes` that are not empty + if (data && !(data instanceof Uint8Array)) { + throw new TypeError( + 'Data must be in the form of a Buffer or Uint8Array.', + ); + } + + const keys = Object.keys(attributes!); + if (!data && keys.length === 0) { + throw new TypeError( + 'If data is undefined, at least one attribute must be present.', + ); + } + + for (const key of keys) { + const value = attributes![key]; + if (typeof value !== 'string') { + throw new TypeError(`All attributes must be in the form of a string. +\nInvalid value of type "${typeof value}" provided for "${key}".`); + } + } + + // Ensure that there's a parent span for subsequent publishes + // to hang off of. + this.getParentSpan(message, 'Publisher.publishMessage'); + + if (!message.orderingKey) { + this.queue.add(message, callback!); + } else { + const key = message.orderingKey; + + if (!this.orderedQueues.has(key)) { + const queue = new OrderedQueue(this, key); + this.orderedQueues.set(key, queue); + queue.once('drain', () => this.orderedQueues.delete(key)); + } + + const queue = this.orderedQueues.get(key)!; + queue.add(message, callback!); + } + } + + /** + * Indicates to the publisher that it is safe to continue publishing for the + * supplied ordering key. + * + * @private + * + * @param {string} key The ordering key to continue publishing for. + */ + resumePublishing(key: string) { + const queue = this.orderedQueues.get(key); + + if (queue) { + queue.resumePublishing(); + } + } + + /** + * Returns the set of default options used for {@link Publisher}. The + * returned value is a copy, and editing it will have no effect elsehwere. + * + * This is a non-static method to make it easier to access/stub. + * + * @private + * + * @returns {PublishOptions} + */ + getOptionDefaults(): PublishOptions { + // Return a unique copy to avoid shenanigans. + const defaults: PublishOptions = { + batching: { + maxBytes: defaultOptions.publish.maxOutstandingBytes, + maxMessages: defaultOptions.publish.maxOutstandingMessages, + maxMilliseconds: defaultOptions.publish.maxDelayMillis, + }, + messageOrdering: false, + gaxOpts: { + isBundling: false, + }, + flowControlOptions: Object.assign( + {}, + flowControlDefaults, + ) as FlowControlOptions, + }; + + return defaults; + } + + /** + * Sets the Publisher options. + * + * @private + * + * @param {PublishOptions} options The publisher options. + */ + setOptions(options = {} as PublishOptions): void { + const defaults = this.getOptionDefaults(); + + const {batching, gaxOpts, messageOrdering, flowControlOptions} = extend( + true, + defaults, + options, + ); + + this.settings = { + batching: { + maxBytes: Math.min(batching!.maxBytes!, BATCH_LIMITS.maxBytes!), + maxMessages: Math.min( + batching!.maxMessages!, + BATCH_LIMITS.maxMessages!, + ), + maxMilliseconds: batching!.maxMilliseconds, + }, + gaxOpts, + messageOrdering, + flowControlOptions, + }; + + // We also need to let all of our queues know that they need to update their options. + // Note that these might be undefined, because setOptions() is called in the constructor. + if (this.queue) { + this.queue.updateOptions(); + } + if (this.orderedQueues) { + for (const q of this.orderedQueues.values()) { + q.updateOptions(); + } + } + + // This will always be filled in by our defaults if nothing else. + this.flowControl.setOptions(this.settings.flowControlOptions!); + } + + /** + * Finds or constructs an telemetry publish/parent span for a message. + * + * @private + * + * @param {PubsubMessage} message The message to create a span for + */ + getParentSpan(message: PubsubMessage, caller: string): Span | undefined { + const enabled = tracing.isEnabled(); + if (!enabled) { + return undefined; + } + + if (message.parentSpan) { + return message.parentSpan; + } + + const span = tracing.PubsubSpans.createPublisherSpan( + message, + this.topic.name, + caller, + ); + + // If the span's context is valid we should inject the propagation trace context. + if (span && isSpanContextValid(span.spanContext())) { + tracing.injectSpan(span, message); + } + + return span; + } +} + +promisifySome(Publisher, Publisher.prototype, ['flush', 'publishMessage'], { + singular: true, +}); diff --git a/handwritten/pubsub/src/publisher/message-batch.ts b/handwritten/pubsub/src/publisher/message-batch.ts new file mode 100644 index 00000000000..4807acc4b00 --- /dev/null +++ b/handwritten/pubsub/src/publisher/message-batch.ts @@ -0,0 +1,180 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {BATCH_LIMITS, PubsubMessage, PublishCallback} from './'; +import {calculateMessageSize} from './pubsub-message'; +import * as tracing from '../telemetry-tracing'; + +export interface BatchPublishOptions { + maxBytes?: number; + maxMessages?: number; + maxMilliseconds?: number; +} + +/** + * Encapsulates a completed batch of messages. + * + * @private + * @internal + */ +export interface BatchResults { + messages: PubsubMessage[]; + callbacks: PublishCallback[]; + bytes: number; +} + +/** + * @typedef BatchPublishOptions + * @property {number} [maxBytes=1 * 1024 * 1024] The maximum number of bytes to + * buffer before sending a payload. + * @property {number} [maxMessages=100] The maximum number of messages to + * buffer before sending a payload. + * @property {number} [maxMilliseconds=10] The maximum duration to wait before + * sending a payload. + */ +/** + * Call used to help batch messages. + * + * @private + * + * @param {BatchPublishOptions} options The batching options. + */ +export class MessageBatch { + messages: PubsubMessage[]; + callbacks: PublishCallback[]; + created: number; + bytes: number; + + constructor( + public options: BatchPublishOptions, + public topicName: string, + ) { + this.messages = []; + this.callbacks = []; + this.created = Date.now(); + this.bytes = 0; + } + + /** + * Updates our options from new values. + * + * @param {BatchPublishOptions} options The new options. + */ + setOptions(options: BatchPublishOptions) { + this.options = options; + } + + /** + * Adds a message to the current batch. + * + * @param {object} message The message to publish. + * @param {PublishCallback} callback The callback function. + */ + add(message: PubsubMessage, callback: PublishCallback): void { + this.messages.push(message); + this.callbacks.push(callback); + this.bytes += calculateMessageSize(message); + + tracing.PubsubSpans.createPublishSchedulerSpan(message); + } + + /** + * Ends the current batch, and returns the messages and callbacks we've queued up. + * + * @private + * @internal + */ + end(): BatchResults { + this.messages.forEach(m => m.publishSchedulerSpan?.end()); + return { + messages: this.messages, + callbacks: this.callbacks, + bytes: this.bytes, + }; + } + + /** + * Indicates if a given message can fit in the batch. + * + * @param {PubsubMessage} message The message in question. + * @returns {boolean} + */ + canFit(message: PubsubMessage): boolean { + return this.canFitCount() && this.canFitSize(message); + } + + /** + * Indicates if a given message can fit in the batch, re: message count. + * + * @returns {boolean} + */ + canFitCount(): boolean { + const {maxMessages} = this.options; + return this.messages.length < maxMessages!; + } + + /** + * Indicates if a given message can fit in the batch, re: byte count. + * + * @param {PubsubMessage} message The message in question. + * @returns {boolean} + */ + canFitSize(message: PubsubMessage): boolean { + const {maxBytes} = this.options; + return this.bytes + calculateMessageSize(message) <= maxBytes!; + } + + /** + * Checks to see if this batch is at the maximum allowed payload size. + * When publishing ordered messages, it is ok to exceed the user configured + * thresholds while a batch is in flight. + * + * @returns {boolean} + */ + isAtMax(): boolean { + const {maxMessages, maxBytes} = BATCH_LIMITS; + return this.messages.length >= maxMessages! || this.bytes >= maxBytes!; + } + + /** + * Indicates if the batch is at capacity. + * + * @returns {boolean} + */ + isFull(): boolean { + return this.isFullMessages() || this.isFullSize(); + } + + /** + * True if we are full because of too many messages. + * + * @private + */ + isFullMessages(): boolean { + const {maxMessages} = this.options; + return this.messages.length >= maxMessages!; + } + + /** + * True if we are full because of too many bytes. + * + * @private + */ + isFullSize(): boolean { + const {maxBytes} = this.options; + return this.bytes >= maxBytes!; + } +} diff --git a/handwritten/pubsub/src/publisher/message-queues.ts b/handwritten/pubsub/src/publisher/message-queues.ts new file mode 100644 index 00000000000..7f333a5c330 --- /dev/null +++ b/handwritten/pubsub/src/publisher/message-queues.ts @@ -0,0 +1,489 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {ServiceError} from 'google-gax'; +import {EventEmitter} from 'events'; + +import {BatchPublishOptions, MessageBatch} from './message-batch'; +import {PublishError} from './publish-error'; +import {Publisher, PubsubMessage, PublishCallback} from './'; +import {google} from '../../protos/protos'; +import * as tracing from '../telemetry-tracing'; +import {filterMessage} from './pubsub-message'; +import {promisify} from 'util'; +import {logs as baseLogs} from '../logs'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + publishBatch: baseLogs.pubsub.sublog('publish-batch'), +}; + +/** + * Queues are used to manage publishing batches of messages. + * + * @private + * + * @param {Publisher} publisher The parent publisher. + */ +export abstract class MessageQueue extends EventEmitter { + batchOptions: BatchPublishOptions; + publisher: Publisher; + pending?: NodeJS.Timeout; + + constructor(publisher: Publisher) { + super(); + this.publisher = publisher; + this.batchOptions = publisher.settings.batching!; + } + + /** + * Forces the queue to update its options from the publisher. + * The specific queue will need to do a bit more to pass the new + * values down into any MessageBatch. + * + * This is only for use by {@link Publisher}. + * + * @private + */ + updateOptions() { + this.batchOptions = this.publisher.settings.batching!; + } + + /** + * Adds a message to the queue. + * + * @abstract + * + * @param {object} message The message to publish. + * @param {PublishCallback} callback The publish callback. + */ + abstract add(message: PubsubMessage, callback: PublishCallback): void; + + /** + * Method to initiate publishing. Full drain behaviour depends on whether the + * queues are ordered or not. + * + * @abstract + * @param {string} [reason] Optional log explanation of why the publish is happening. + */ + abstract publish(reason: string): Promise; + + /*! + * Logs about a batch being sent, and why. + * @private + */ + private logBatch(reason: string, length: number, bytes: number) { + logs.publishBatch.info( + '%s triggered a publish batch of %i messages, a total of %i bytes', + reason, + length, + bytes, + ); + } + + /** + * Method to finalize publishing. Does as many publishes as are needed + * to finish emptying the queues, and fires a drain event afterward. + * + * @abstract + */ + abstract publishDrain(): Promise; + + /** + * Accepts a batch of messages and publishes them to the API. + * + * @param {object[]} messages The messages to publish. + * @param {PublishCallback[]} callbacks The corresponding callback functions. + * @private + */ + async _publish( + messages: PubsubMessage[], + callbacks: PublishCallback[], + bytes: number, + reason?: string, + ): Promise { + const {topic, settings} = this.publisher; + const reqOpts = { + topic: topic.name, + messages: messages.map(filterMessage), + }; + if (messages.length === 0) { + return; + } + + // Make sure we have a projectId filled in to update telemetry spans. + // The overall spans may not have the correct projectId because it wasn't + // known at the time publishMessage was called. + const spanMessages = messages.filter(m => !!m.parentSpan); + if (spanMessages.length) { + if (!topic.pubsub.isIdResolved) { + await topic.pubsub.getClientConfig(); + } + spanMessages.forEach(m => { + tracing.PubsubSpans.updatePublisherTopicName(m.parentSpan!, topic.name); + tracing.PubsubEvents.publishStart(m); + }); + } + + const rpcSpan = tracing.PubsubSpans.createPublishRpcSpan( + spanMessages, + topic.name, + 'MessageQueue._publish', + ); + + if (reason) { + this.logBatch(reason, messages.length, bytes); + } + + const requestCallback = topic.request; + const request = promisify(requestCallback.bind(topic)); + try { + const resp = await request({ + client: 'PublisherClient', + method: 'publish', + reqOpts, + gaxOpts: settings.gaxOpts!, + }); + + if (resp) { + const messageIds = resp.messageIds || []; + callbacks.forEach((callback, i) => callback(null, messageIds[i])); + } + } catch (e) { + const err = e as ServiceError; + callbacks.forEach(callback => callback(err)); + + throw e; + } finally { + rpcSpan?.end(); + messages.forEach(m => { + // We're finished with both the RPC and the whole publish operation, + // so close out all of the related spans. + tracing.PubsubEvents.publishEnd(m); + m.parentSpan?.end(); + }); + } + } +} + +/** + * Standard message queue used for publishing messages. + * + * @private + * @extends MessageQueue + * + * @param {Publisher} publisher The publisher. + */ +export class Queue extends MessageQueue { + batch: MessageBatch; + constructor(publisher: Publisher) { + super(publisher); + this.batch = new MessageBatch(this.batchOptions, this.publisher.topic.name); + } + + // This needs to update our existing message batch. + updateOptions() { + super.updateOptions(); + this.batch.setOptions(this.batchOptions); + } + + /** + * Adds a message to the queue. + * + * @param {PubsubMessage} message The message to publish. + * @param {PublishCallback} callback The publish callback. + */ + add(message: PubsubMessage, callback: PublishCallback): void { + if (!this.batch.canFit(message)) { + // Make a background best-effort attempt to clear out the + // queue. If this fails, we'll basically just be overloaded + // for a bit. + const reason = !this.batch.canFitCount() ? 'message count' : 'byte count'; + this.publish(reason).catch(() => {}); + } + + this.batch.add(message, callback); + + if (this.batch.isFull()) { + // See comment above - best effort. + const reason = this.batch.isFullMessages() + ? 'message count' + : 'byte count'; + this.publish(reason).catch(() => {}); + } else if (!this.pending) { + const {maxMilliseconds} = this.batchOptions; + this.pending = setTimeout(() => { + // See comment above - we are basically making a best effort + // to start clearing out the queue if nothing else happens + // before the batch timeout. + this.publish('timeout').catch(() => {}); + }, maxMilliseconds!); + } + } + + /** + * Cancels any pending publishes and calls _publish immediately. + * + * _Does_ attempt to further drain after one batch is sent. + * + * @emits Queue#drain when all messages are sent. + */ + async publishDrain(): Promise { + await this._publishInternal(true, 'manual drain'); + } + + /** + * Cancels any pending publishes and calls _publish immediately. + * + * Does _not_ attempt to further drain after one batch is sent. + * @private + */ + async publish(reason?: string): Promise { + await this._publishInternal(false, reason); + } + + /** + * Cancels any pending publishes and calls _publish immediately. + * + * @emits Queue#drain when all messages are sent. + * @private + */ + async _publishInternal(fullyDrain: boolean, reason?: string): Promise { + const {messages, callbacks} = this.batch.end(); + const bytes = this.batch.bytes; + + this.batch = new MessageBatch(this.batchOptions, this.publisher.topic.name); + + if (this.pending) { + clearTimeout(this.pending); + delete this.pending; + } + + await this._publish(messages, callbacks, bytes, reason); + if (this.batch.messages.length) { + // We only do the indefinite go-arounds when we're trying to do a + // final drain for flush(). In all other cases, we want to leave + // subsequent batches alone so that they can time out as needed. + if (fullyDrain) { + await this._publishInternal(true, 'message count'); + } + } else { + this.emit('drain'); + } + } +} + +/** + * Queue for handling ordered messages. Unlike the standard queue, this + * ensures that batches are published one at a time and throws an exception in + * the event that any batch fails to publish. + * + * @private + * @extends MessageQueue + * + * @param {Publisher} publisher The publisher. + * @param {string} key The key used to order the messages. + */ +export class OrderedQueue extends MessageQueue { + batches: MessageBatch[]; + inFlight: boolean; + error?: null | PublishError; + key: string; + constructor(publisher: Publisher, key: string) { + super(publisher); + this.batches = []; + this.inFlight = false; + this.key = key; + } + + // This needs to update our existing message batches. + updateOptions() { + super.updateOptions(); + this.batches.forEach(b => b.setOptions(this.batchOptions)); + } + + /** + * Reference to the batch we're currently filling. + * @returns {MessageBatch} + */ + get currentBatch(): MessageBatch { + if (!this.batches.length) { + this.batches.push(this.createBatch()); + } + return this.batches[0]; + } + /** + * Adds a message to a batch, creating a new batch if need be. + * + * @param {object} message The message to publish. + * @param {PublishCallback} callback The publish callback. + */ + add(message: PubsubMessage, callback: PublishCallback): void { + if (this.error) { + callback(this.error); + return; + } + + if (this.inFlight) { + // in the event that a batch is currently in flight, we can overfill + // the next batch as long as it hasn't hit the API limit + if (this.currentBatch.isAtMax()) { + this.batches.unshift(this.createBatch()); + } + + this.currentBatch.add(message, callback); + return; + } + + if (!this.currentBatch.canFit(message)) { + // Make a best-effort attempt to clear out the publish queue, + // to make more space for the new batch. If this fails, we'll + // just be overfilled for a bit. + const reason = !this.currentBatch.canFitCount() + ? 'message count' + : 'byte count'; + this.publish(reason).catch(() => {}); + } + + this.currentBatch.add(message, callback); + + // it is possible that we triggered a publish earlier, so we'll need to + // check again here + if (!this.inFlight) { + if (this.currentBatch.isFull()) { + // See comment above - best-effort. + const reason = this.currentBatch.isFullMessages() + ? 'message count' + : 'byte count'; + this.publish(reason).catch(() => {}); + } else if (!this.pending) { + this.beginNextPublish(); + } + } + } + /** + * Starts a timeout to publish any pending messages. + */ + beginNextPublish(): void { + const maxMilliseconds = this.batchOptions.maxMilliseconds!; + const timeWaiting = Date.now() - this.currentBatch.created; + const delay = Math.max(0, maxMilliseconds - timeWaiting); + + this.pending = setTimeout(() => { + // Make a best-effort attempt to start a publish request. If + // this fails, we'll catch it again later, eventually, when more + // messages try to enter the queue. + this.publish('timeout').catch(() => {}); + }, delay); + } + /** + * Creates a new {@link MessageBatch} instance. + * + * @returns {MessageBatch} + */ + createBatch(): MessageBatch { + return new MessageBatch(this.batchOptions, this.publisher.topic.name); + } + /** + * In the event of a publish failure, we need to cache the error in question + * and reject all pending publish calls, prompting the user to call + * {@link OrderedQueue#resumePublishing}. + * + * @param {Error} err The publishing error. + */ + handlePublishFailure(err: ServiceError): void { + this.error = new PublishError(this.key, err); + + // reject all pending publishes + while (this.batches.length) { + const {callbacks} = this.batches.pop()!; + callbacks.forEach(callback => callback(err)); + } + } + /** + * Publishes the messages. If successful it will prepare the next batch to be + * published immediately after. If an error occurs, it will reject all + * pending messages. In the event that no pending messages/batches are left, + * a "drain" event will be fired, indicating to the publisher that it is + * safe to delete this queue. + * + * @fires OrderedQueue#drain + */ + async publish(reason: string): Promise { + // If there's nothing to flush, don't try, just short-circuit to the drain event. + // This can happen if we get a publish() call after already being drained, in + // the case that topic.flush() pulls a reference to us before we get deleted. + if (!this.batches.length) { + this.emit('drain'); + return; + } + + this.inFlight = true; + + if (this.pending) { + clearTimeout(this.pending); + delete this.pending; + } + + const {messages, callbacks, bytes} = this.batches.pop()!.end(); + + try { + await this._publish(messages, callbacks, bytes, reason); + } catch (e) { + const err = e as ServiceError; + this.inFlight = false; + this.handlePublishFailure(err); + } finally { + this.inFlight = false; + } + + if (this.batches.length) { + this.beginNextPublish(); + } else { + this.emit('drain'); + } + } + + /** + * For ordered queues, this does exactly the same thing as `publish()`. + * + * @fires OrderedQueue#drain + */ + async publishDrain(): Promise { + await this.publish('manual drain'); + } + + /** + * Tells the queue it is ok to continue publishing messages. + */ + resumePublishing(): void { + delete this.error; + + // once this is called, we'll make this object eligible for garbage + // collection. by wrapping in nextTick() we'll give users an opportunity + // to use it again instead of deleting instantly and then creating a new + // instance. + process.nextTick(() => { + if (!this.batches.length) { + this.emit('drain'); + } + }); + } +} diff --git a/handwritten/pubsub/src/publisher/publish-error.ts b/handwritten/pubsub/src/publisher/publish-error.ts new file mode 100644 index 00000000000..6669cf658fe --- /dev/null +++ b/handwritten/pubsub/src/publisher/publish-error.ts @@ -0,0 +1,73 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {grpc} from 'google-gax'; + +/** + * Exception to be thrown during failed ordered publish. + * + * @class + * @extends Error + */ +export class PublishError extends Error implements grpc.ServiceError { + code: grpc.status; + details: string; + metadata: grpc.Metadata; + orderingKey: string; + error: grpc.ServiceError; + constructor(key: string, err: grpc.ServiceError) { + super(`Unable to publish for key "${key}". Reason: ${err.message}`); + + /** + * The gRPC grpc.status code. + * + * @name PublishError#code + * @type {number} + */ + this.code = err.code; + + /** + * The gRPC grpc.status details. + * + * @name PublishError#details + * @type {string} + */ + this.details = err.details; + + /** + * The gRPC grpc.Metadata object. + * + * @name PublishError#grpc.Metadata + * @type {object} + */ + this.metadata = err.metadata; + + /** + * The ordering key this failure occurred for. + * + * @name PublishError#orderingKey + * @type {string} + */ + this.orderingKey = key; + + /** + * The original gRPC error. + * + * @name PublishError#error + * @type {Error} + */ + this.error = err; + } +} diff --git a/handwritten/pubsub/src/publisher/pubsub-message.ts b/handwritten/pubsub/src/publisher/pubsub-message.ts new file mode 100644 index 00000000000..ac979941680 --- /dev/null +++ b/handwritten/pubsub/src/publisher/pubsub-message.ts @@ -0,0 +1,153 @@ +/*! + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {google} from '../../protos/protos'; +import * as tracing from '../telemetry-tracing'; + +/** + * Strings are the only allowed values for keys and values in message attributes. + */ +export type Attributes = Record; + +/** + * The basic {data, attributes} for a message to be published. + */ +export interface PubsubMessage + extends google.pubsub.v1.IPubsubMessage, + tracing.MessageWithAttributes { + /** + * If we've calculated the size of this message, it will be cached here. + * This is done to avoid having to build up the attribute size over and over. + * + * This field should not be used outside of this library. Its implementation + * may change, and it may disappear later. + * + * @private + * @internal + */ + calculatedSize?: number; + + // The following are here instead of inside an object (like subs) because we + // don't get to control what these objects are. They come from grpc. + + /** + * If tracing is enabled, track the message span. + * + * @private + * @internal + */ + messageSpan?: tracing.Span; + + /** + * If tracing is enabled, track the batching (publish scheduling) period. + * + * @private + * @internal + */ + publishSchedulerSpan?: tracing.Span; + + /** + * If this is a message being received from a subscription, expose the ackId + * internally. Primarily for tracing. + * + * @private + * @internal + */ + ackId?: string; + + /** + * If this is a message being received from a subscription, expose the exactly + * once delivery flag internally. Primarily for tracing. + * + * @private + * @internal + */ + isExactlyOnceDelivery?: boolean; +} + +/** + * Since we tag a fair number of extra things into messages sent to the Pub/Sub + * server, this filters everything down to what needs to be sent. This should be + * used right before gRPC calls. + * + * @private + * @internal + */ +export function filterMessage( + message: PubsubMessage, +): google.pubsub.v1.IPubsubMessage { + const filtered = {} as PubsubMessage; + if (message.data) { + filtered.data = message.data; + } + if (message.attributes) { + filtered.attributes = message.attributes; + } + if (message.messageId) { + filtered.messageId = message.messageId; + } + if (message.publishTime) { + filtered.publishTime = message.publishTime; + } + if (message.orderingKey) { + filtered.orderingKey = message.orderingKey; + } + return filtered; +} + +/** + * Precisely calculates the size of a message with optional `data` and + * `attributes` fields. If a `data` field is present, its {@link Buffer#length} + * member will be used. If `attributes` are present, each attribute's + * key and value will be calculated for byte length. + * + * When the calculation is complete, the result will be stored in + * `calculatedSize`. Since this calculation is generally only done + * after the message has been handed off to this library, there shouldn't + * be an issue with it being updated after the fact. + * + * This should not be used outside of this library. Its implementation + * may change. + * + * @private + * @internal + */ +export function calculateMessageSize( + message: PubsubMessage | google.pubsub.v1.IPubsubMessage, +) { + // If it's not a PubsubMessage, we'll augment it into one. + const msg = message as unknown as PubsubMessage; + + if (msg.calculatedSize !== undefined) { + return msg.calculatedSize; + } + + let size = 0; + + if (msg.data) { + size += msg.data.length; + } + if (msg.attributes) { + const attrs = msg.attributes; + for (const key of Object.getOwnPropertyNames(attrs)) { + const val = attrs[key] || ''; + size += Buffer.byteLength(key + val); + } + } + + msg.calculatedSize = size; + return size; +} diff --git a/handwritten/pubsub/src/pubsub.ts b/handwritten/pubsub/src/pubsub.ts new file mode 100644 index 00000000000..c250d9da665 --- /dev/null +++ b/handwritten/pubsub/src/pubsub.ts @@ -0,0 +1,1645 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {paginator} from '@google-cloud/paginator'; +import {replaceProjectIdToken} from '@google-cloud/projectify'; +import * as extend from 'extend'; +import {GoogleAuth} from 'google-auth-library'; +import * as gax from 'google-gax'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const PKG = require('../../package.json'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const v1 = require('./v1'); + +import {promisifySome} from './util'; +import { + Schema, + SchemaType, + ICreateSchemaRequest, + SchemaViews, + ISchema, + SchemaView, +} from './schema'; +import {Snapshot} from './snapshot'; +import { + Subscription, + SubscriptionMetadata, + SubscriptionOptions, + CreateSubscriptionOptions, + CreateSubscriptionCallback, + CreateSubscriptionResponse, + DetachSubscriptionCallback, + DetachSubscriptionResponse, +} from './subscription'; +import { + Topic, + GetTopicSubscriptionsCallback, + GetTopicSubscriptionsResponse, + CreateTopicCallback, + CreateTopicResponse, + TopicMetadata, +} from './topic'; +import {PublishOptions} from './publisher'; +import {CallOptions} from 'google-gax'; +import {Transform} from 'stream'; +import {google} from '../protos/protos'; +import {SchemaServiceClient} from './v1'; +import * as tracing from './telemetry-tracing'; + +/** + * Project ID placeholder. + * @type {string} + * @private + */ +const PROJECT_ID_PLACEHOLDER = '{{projectId}}'; + +export type Omit = Pick>; + +export interface ClientConfig extends gax.GrpcClientOptions { + apiEndpoint?: string; + + /** + * Configures the emulator mode behaviour: + * - If false, disable emulator mode always + * - If true, enable emulator mode always + * - If unset, use heuristics to decide + * Emulator mode notably sets insecure SSL authentication so that you can + * try the library out without needing a cert. + * + * Also notably, if a TPC universeDomain is set, then this will be counted + * as !emulatorMode for the purposes of the heuristics. If you want emulator + * mode but with a TPC universe domain set, set this to true as well. + */ + emulatorMode?: boolean; + + servicePath?: string; + port?: string | number; + sslCreds?: gax.grpc.ChannelCredentials; + + /** + * Enables OpenTelemetry tracing (newer, more full implementation). This + * defaults to false/undefined + */ + enableOpenTelemetryTracing?: boolean; +} + +export interface PageOptions { + gaxOpts?: CallOptions; + pageSize?: number; + pageToken?: string; + autoPaginate?: boolean; +} + +export type GetSnapshotsCallback = RequestCallback< + Snapshot, + google.pubsub.v1.IListSnapshotsResponse +>; + +export type GetSnapshotsResponse = PagedResponse< + Snapshot, + google.pubsub.v1.IListSnapshotsResponse +>; + +export type GetSubscriptionsOptions = PageOptions & {topic?: string | Topic}; + +type GetAllSubscriptionsCallback = RequestCallback< + Subscription, + google.pubsub.v1.IListSubscriptionsResponse +>; + +type GetAllSubscriptionsResponse = PagedResponse< + Subscription, + google.pubsub.v1.IListSubscriptionsResponse +>; + +export type GetSubscriptionsCallback = + | GetAllSubscriptionsCallback + | GetTopicSubscriptionsCallback; + +export type GetSubscriptionsResponse = + | GetAllSubscriptionsResponse + | GetTopicSubscriptionsResponse; + +export type GetTopicsCallback = RequestCallback< + Topic, + google.pubsub.v1.IListTopicsResponse +>; + +export type GetTopicsResponse = PagedResponse< + Topic, + google.pubsub.v1.IListTopicsResponse +>; + +export type EmptyCallback = RequestCallback; +export type EmptyResponse = [google.protobuf.IEmpty]; + +export type ExistsCallback = RequestCallback; +export type ExistsResponse = [boolean]; + +export type DetachedCallback = RequestCallback; +export type DetachedResponse = [boolean]; + +export interface GetClientConfig { + client: 'PublisherClient' | 'SubscriberClient'; +} + +export interface RequestConfig extends GetClientConfig { + method: string; + reqOpts?: object; + gaxOpts?: CallOptions; +} + +export interface ResourceCallback { + ( + err: gax.grpc.ServiceError | null, + resource?: Resource | null, + response?: Response | null, + ): void; +} + +export type RequestCallback = R extends void + ? NormalCallback + : PagedCallback; + +export interface NormalCallback { + (err: gax.grpc.ServiceError | null, res?: TResponse | null): void; +} + +export interface PagedCallback { + ( + err: gax.grpc.ServiceError | null, + results?: Item[] | null, + nextQuery?: {} | null, + response?: Response | null, + ): void; +} + +export type PagedResponse = + | [Item[]] + | [Item[], {} | null, Response]; + +export type ObjectStream = { + addListener(event: 'data', listener: (data: O) => void): ObjectStream; + emit(event: 'data', data: O): boolean; + on(event: 'data', listener: (data: O) => void): ObjectStream; + once(event: 'data', listener: (data: O) => void): ObjectStream; + prependListener(event: 'data', listener: (data: O) => void): ObjectStream; + prependOnceListener( + event: 'data', + listener: (data: O) => void, + ): ObjectStream; +} & Transform; + +interface GetClientCallback { + (err: Error | null, gaxClient?: gax.ClientStub): void; +} + +/** + * @typedef {object} ClientConfig + * @property {string} [projectId] The project ID from the Google Developer's + * Console, e.g. 'grape-spaceship-123'. We will also check the environment + * variable `GCLOUD_PROJECT` for your project ID. If your app is running in + * an environment which supports {@link + * https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application + * Application Default Credentials}, your project ID will be detected + * automatically. + * @property {string} [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 above is not necessary. NOTE: .pem and + * .p12 require you to specify the `email` option as well. + * @property {string} [apiEndpoint] The `apiEndpoint` from options will set the + * host. If not set, the `PUBSUB_EMULATOR_HOST` environment variable from the + * gcloud SDK is honored. We also check the `CLOUD_API_ENDPOINT_OVERRIDES_PUBSUB` + * environment variable used by `gcloud alpha pubsub`. Otherwise the actual API + * endpoint will be used. Note that if the URL doesn't end in '.googleapis.com', + * we will assume that it's an emulator and disable strict SSL checks. + * @property {string} [email] Account email address. Required when using a .pem + * or .p12 keyFilename. + * @property {object} [credentials] Credentials object. + * @property {string} [credentials.client_email] + * @property {string} [credentials.private_key] + * @property {boolean} [autoRetry=true] Automatically retry requests if the + * response is related to rate limits or certain intermittent server errors. + * We will exponentially backoff subsequent requests by default. + * @property {Constructor} [promise] Custom promise module to use instead of + * native Promises. + */ +/** + * [Cloud Pub/Sub](https://developers.google.com/pubsub/overview) is a + * reliable, many-to-many, asynchronous messaging service from Cloud + * Platform. + * + * @class + * + * @see [Cloud Pub/Sub overview]{@link https://developers.google.com/pubsub/overview} + * + * @param {ClientConfig} [options] Configuration options. + * + * @example Import the client library + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * + * ``` + * @example Create a client that uses Application Default Credentials (ADC): + * ``` + * const pubsub = new PubSub(); + * + * ``` + * @example Create a client with explicit credentials: + * ``` + * const pubsub = new PubSub({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json' + * }); + * + * ``` + * @example include:samples/quickstart.js + * region_tag:pubsub_quickstart_create_topic + * Full quickstart example: + */ +export class PubSub { + options: ClientConfig; + isEmulator: boolean; + api: {[key: string]: gax.ClientStub}; + auth: GoogleAuth; + projectId: string; + name?: string; + // tslint:disable-next-line variable-name + Promise?: PromiseConstructor; + getSubscriptionsStream = paginator.streamify( + 'getSubscriptions', + ) as () => ObjectStream; + getSnapshotsStream = paginator.streamify( + 'getSnapshots', + ) as () => ObjectStream; + getTopicsStream = paginator.streamify( + 'getTopics', + ) as () => ObjectStream; + isOpen = true; + + private schemaClient?: SchemaServiceClient; + + constructor(options?: ClientConfig) { + // Needed for potentially large responses that may come from using exactly-once delivery, + // as well as trying to work around silent connection failures. + // + // These will get passed down to grpc client objects. User values will overwrite these. + const grpcDefaults = { + 'grpc.max_metadata_size': 4 * 1024 * 1024, // 4 MiB + 'grpc.keepalive_time_ms': 300000, // 5 minutes + 'grpc.keepalive_timeout_ms': 20000, // 20 seconds + }; + options = Object.assign(grpcDefaults, options || {}); + + // Determine what scopes are needed. + // It is the union of the scopes on both clients. + const clientClasses = [v1.SubscriberClient, v1.PublisherClient]; + const allScopes: {[key: string]: boolean} = {}; + for (const clientClass of clientClasses) { + for (const scope of clientClass.scopes) { + allScopes[scope] = true; + } + } + + this.options = Object.assign( + { + libName: 'gccl', + libVersion: PKG.version, + scopes: Object.keys(allScopes), + }, + options, + ); + + if (this.options.enableOpenTelemetryTracing) { + tracing.setGloballyEnabled(true); + } + + /** + * @name PubSub#isEmulator + * @type {boolean} + */ + this.isEmulator = false; + this.determineBaseUrl_(); + this.api = {}; + this.auth = new GoogleAuth(this.options); + this.projectId = this.options.projectId || PROJECT_ID_PLACEHOLDER; + if (this.projectId !== PROJECT_ID_PLACEHOLDER) { + this.name = PubSub.formatName_(this.projectId); + } + } + + /** + * Returns true if we have actually resolved the full project name. + * + * @returns {boolean} true if the name is resolved. + */ + get isIdResolved(): boolean { + return this.projectId.indexOf(PROJECT_ID_PLACEHOLDER) < 0; + } + + /** + * Closes the PubSub client, releasing any underlying gRPC connections. + * + * Note that once you close a PubSub object, it may not be used again. Any pending + * operations (e.g. queued publish messages) will fail. If you have topic or + * subscription objects that may have pending operations, you should call close() + * on those first if you want any pending messages to be delivered correctly. The + * PubSub class doesn't track those. + + * Note that this method primarily closes the gRPC clients (Publisher and Subscriber) + * used for API requests. It does **not** automatically handle the graceful shutdown + * of active subscriptions. + * + * For graceful shutdown of subscriptions with specific timeout behavior (e.g., + * ensuring buffered messages are nacked before closing), please refer to the + * {@link Subscription#close} method. It is recommended to call + * `Subscription.close({timeout: ...})` directly on your active `Subscription` + * objects *before* calling `PubSub.close()` if you require that specific + * shutdown behavior. + * + * Calling `PubSub.close()` without first closing active subscriptions might + * result in abrupt termination of message processing for those subscriptions. + * Any pending operations on associated Topic or Subscription objects (e.g., + * queued publish messages or unacked subscriber messages) may fail after + * `PubSub.close()` is called. + * + * @callback EmptyCallback + * @param {Error} [err] Request error, if any. + * @returns {Promise} Resolves when the clients are closed. + */ + close(): Promise; + close(callback: EmptyCallback): void; + close(callback?: EmptyCallback): Promise | void { + const definedCallback = callback || (() => {}); + if (this.isOpen) { + this.isOpen = false; + this.closeAllClients_() + .then(() => this.schemaClient?.close()) + .then(() => { + definedCallback(null); + }) + .catch(definedCallback); + } else { + definedCallback(null); + } + } + + /** + * Create a schema in the project. + * + * @see [Schemas: create API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/create} + * @see {@link Schema#create} + * + * @throws {Error} If a schema ID or name is not provided. + * @throws {Error} If an invalid SchemaType is provided. + * @throws {Error} If an invalid schema definition is provided. + * + * @param {string} schemaId The name or ID of the subscription. + * @param {SchemaType} type The type of the schema (Protobuf, Avro, etc). + * @param {string} definition The text describing the schema in terms of the type. + * @param {object} [options] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @returns {Promise} + * + * @example Create a schema. + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * await pubsub.createSchema( + * 'messageType', + * SchemaTypes.Avro, + * '{...avro definition...}' + * ); + * ``` + */ + async createSchema( + schemaId: string, + type: SchemaType, + definition: string, + gaxOpts?: CallOptions, + ): Promise { + // This populates projectId for us. + await this.getClientConfig(); + + const schemaName = Schema.formatName_(this.projectId, schemaId); + const request: ICreateSchemaRequest = { + parent: this.name, + schemaId, + schema: { + name: schemaName, + type, + definition, + }, + }; + + const client = await this.getSchemaClient(); + await client.createSchema(request, gaxOpts); + return new Schema(this, schemaName); + } + + /** + * @typedef {array} CreateSubscriptionResponse + * @property {Subscription} 0 The new {@link Subscription}. + * @property {object} 1 The full API response. + */ + /** + * @callback CreateSubscriptionCallback + * @param {?Error} err Request error, if any. + * @param {Subscription} Subscription + * @param {object} apiResponse The full API response. + */ + /** + * Options for creating a subscription. + * + * See a [Subscription + * resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions). + * + * @typedef {object} CreateSubscriptionRequest + * @property {DeadLetterPolicy} [deadLetterPolicy] A policy that specifies the + * conditions for dead lettering messages in this subscription. + * @property {object} [flowControl] Flow control configurations for + * receiving messages. Note that these options do not persist across + * subscription instances. + * @property {number} [flowControl.maxBytes] The maximum number of bytes + * in un-acked messages to allow before the subscription pauses incoming + * messages. Defaults to 20% of free memory. + * @property {number} [flowControl.maxMessages=Infinity] The maximum number + * of un-acked messages to allow before the subscription pauses incoming + * messages. + * @property {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @property {number|google.protobuf.Duration} [messageRetentionDuration] Set + * this to override the default duration of 7 days. This value is expected + * in seconds. Acceptable values are in the range of 10 minutes and 7 + * days. + * @property {string} [pushEndpoint] A URL to a custom endpoint that + * messages should be pushed to. + * @property {object} [oidcToken] If specified, Pub/Sub will generate and + * attach an OIDC JWT token as an `Authorization` header in the HTTP + * request for every pushed message. This object should have the same + * structure as [OidcToken]{@link google.pubsub.v1.OidcToken} + * @property {boolean} [retainAckedMessages=false] If set, acked messages + * are retained in the subscription's backlog for the length of time + * specified by `options.messageRetentionDuration`. + * @property {ExpirationPolicy} [expirationPolicy] A policy that specifies + * the conditions for this subscription's expiration. + */ + /** + * Create a subscription to a topic. + * + * @see [Subscriptions: create API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create} + * @see {@link Topic#createSubscription} + * + * @throws {Error} If a Topic instance or topic name is not provided. + * @throws {Error} If a subscription name is not provided. + * + * @param {Topic|string} topic The Topic to create a subscription to. + * @param {string} name The name of the subscription. + * @param {CreateSubscriptionRequest} [options] See a [Subscription resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions). + * @param {CreateSubscriptionCallback} [callback] Callback function. + * @returns {Promise} + * + * @example Subscribe to a topic. + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = 'messageCenter'; + * const name = 'newMessages'; + * + * const callback = function(err, subscription, apiResponse) {}; + * + * pubsub.createSubscription(topic, name, callback); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * pubsub.createSubscription(topic, name) + * .then(function(data) { + * const subscription = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + createSubscription( + topic: Topic | string, + name: string, + options?: CreateSubscriptionOptions, + ): Promise; + createSubscription( + topic: Topic | string, + name: string, + callback: CreateSubscriptionCallback, + ): void; + createSubscription( + topic: Topic | string, + name: string, + options: CreateSubscriptionOptions, + callback: CreateSubscriptionCallback, + ): void; + createSubscription( + topic: Topic | string, + name: string, + optionsOrCallback?: CreateSubscriptionOptions | CreateSubscriptionCallback, + callback?: CreateSubscriptionCallback, + ): Promise | void { + if (typeof topic !== 'string' && !(topic instanceof Topic)) { + throw new Error('A Topic is required for a new subscription.'); + } + if (typeof name !== 'string') { + throw new Error('A subscription name is required.'); + } + if (typeof topic === 'string') { + topic = this.topic(topic); + } + let options = + typeof optionsOrCallback === 'object' + ? optionsOrCallback + : ({} as CreateSubscriptionOptions); + callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : callback; + + // Make a deep copy of options to not pollute caller object. + options = extend(true, {}, options); + + const gaxOpts = options.gaxOpts; + const flowControl = options.flowControl; + delete options.gaxOpts; + delete options.flowControl; + + const metadata = Subscription.formatMetadata_( + options as SubscriptionMetadata, + ); + + let subscriptionCtorOptions = flowControl ? {flowControl} : {}; + subscriptionCtorOptions = Object.assign(subscriptionCtorOptions, metadata); + const subscription = this.subscription(name, subscriptionCtorOptions); + + const reqOpts = Object.assign(metadata, { + topic: topic.name, + name: subscription.name, + }); + + this.request( + { + client: 'SubscriberClient', + method: 'createSubscription', + reqOpts, + gaxOpts, + }, + (err, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + subscription.metadata = resp!; + + callback!(null, subscription, resp!); + }, + ); + } + + /** + * @typedef {array} CreateTopicResponse + * @property {Topic} 0 The new {@link Topic}. + * @property {object} 1 The full API response. + */ + /** + * @callback CreateTopicCallback + * @param {?Error} err Request error, if any. + * @param {Topic} topic The new {@link Topic}. + * @param {object} apiResponse The full API response. + */ + /** + * Create a topic with the given name. + * + * @see [Topics: create API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/create} + * + * @param {string} name Name of the topic. + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {CreateTopicCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.createTopic('my-new-topic', function(err, topic, apiResponse) { + * if (!err) { + * // The topic was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * pubsub.createTopic('my-new-topic').then(function(data) { + * const topic = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + createTopic( + name: string | TopicMetadata, + gaxOpts?: CallOptions, + ): Promise; + createTopic( + name: string | TopicMetadata, + callback: CreateTopicCallback, + ): void; + createTopic( + name: string | TopicMetadata, + gaxOpts: CallOptions, + callback: CreateTopicCallback, + ): void; + createTopic( + name: string | TopicMetadata, + optsOrCallback?: CallOptions | CreateTopicCallback, + callback?: CreateTopicCallback, + ): Promise | void { + const reqOpts: TopicMetadata = + typeof name === 'string' + ? { + name, + } + : name; + + // We don't allow a blank name, but this will let topic() handle that case. + const topic = this.topic(reqOpts.name || ''); + + // Topic#constructor might have canonicalized the name. + reqOpts.name = topic.name; + + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + this.request( + { + client: 'PublisherClient', + method: 'createTopic', + reqOpts, + gaxOpts, + }, + (err, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + topic.metadata = resp!; + + callback!(null, topic, resp!); + }, + ); + } + + /** + * Detach a subscription with the given name. + * + * @see [Admin: Pub/Sub administration API Documentation]{@link https://cloud.google.com/pubsub/docs/admin} + * + * @param {string} name Name of the subscription. + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {DetachSubscriptionCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.detachSubscription('my-sub', (err, topic, apiResponse) => { + * if (!err) { + * // The topic was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * pubsub.detachSubscription('my-sub').then(data => { + * const apiResponse = data[0]; + * }); + * ``` + */ + detachSubscription( + name: string, + gaxOpts?: CallOptions, + ): Promise; + detachSubscription(name: string, callback: DetachSubscriptionCallback): void; + detachSubscription( + name: string, + gaxOpts: CallOptions, + callback: DetachSubscriptionCallback, + ): void; + detachSubscription( + name: string, + optsOrCallback?: CallOptions | DetachSubscriptionCallback, + callback?: DetachSubscriptionCallback, + ): Promise | void { + if (typeof name !== 'string') { + throw new Error('A subscription name is required.'); + } + + const sub = this.subscription(name); + const reqOpts = { + subscription: sub.name, + }; + + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + this.request( + { + client: 'PublisherClient', + method: 'detachSubscription', + reqOpts, + gaxOpts: gaxOpts as CallOptions, + }, + callback!, + ); + } + + /** + * Determine the appropriate endpoint to use for API requests, first trying + * the `apiEndpoint` parameter. If that isn't set, we try the Pub/Sub emulator + * environment variable (PUBSUB_EMULATOR_HOST). If that is also null, we try + * the standard `gcloud alpha pubsub` environment variable + * (CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB). Otherwise the default production + * API is used. + * + * Note that if the URL doesn't end in '.googleapis.com', we will assume that + * it's an emulator and disable strict SSL checks. + * + * @private + */ + determineBaseUrl_() { + // We allow an override from the client object options, or from + // one of these variables. The CLOUDSDK variable is provided for + // compatibility with the `gcloud alpha` utility. + const gcloudVarName = 'CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB'; + const emulatorVarName = 'PUBSUB_EMULATOR_HOST'; + const apiEndpoint = + this.options.apiEndpoint || + process.env[emulatorVarName] || + process.env[gcloudVarName]; + if (!apiEndpoint) { + return; + } + + // Parse the URL into a hostname and port, if possible. + const leadingProtocol = new RegExp('^https?://'); + const trailingSlashes = new RegExp('(?} + * + * @example + * ``` + * for await (const s of pubsub.listSchemas()) { + * const moreInfo = await s.get(); + * } + * ``` + */ + async *listSchemas( + view: SchemaView = SchemaViews.Basic, + options?: CallOptions, + ): AsyncIterable { + const client = await this.getSchemaClient(); + const query = { + parent: this.name, + view, + }; + + for await (const s of client.listSchemasAsync(query, options)) { + yield s; + } + } + + /** + * Query object for listing snapshots. + * + * @typedef {object} GetSnapshotsRequest + * @property {boolean} [autoPaginate=true] Have pagination handled + * automatically. + * @property {object} [options.gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @property {number} [options.pageSize] Maximum number of results to return. + * @property {string} [options.pageToken] Page token. + */ + /** + * @typedef {array} GetSnapshotsResponse + * @property {Snapshot[]} 0 Array of {@link Snapshot} instances. + * @property {object} 1 The full API response. + */ + /** + * @callback GetSnapshotsCallback + * @param {?Error} err Request error, if any. + * @param {Snapshot[]} snapshots Array of {@link Snapshot} instances. + * @param {object} apiResponse The full API response. + */ + /** + * Get a list of snapshots. + * + * @param {GetSnapshotsRequest} [query] Query object for listing snapshots. + * @param {GetSnapshotsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getSnapshots(function(err, snapshots) { + * if (!err) { + * // snapshots is an array of Snapshot objects. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * pubsub.getSnapshots().then(function(data) { + * const snapshots = data[0]; + * }); + * ``` + */ + getSnapshots(options?: PageOptions): Promise; + getSnapshots(callback: GetSnapshotsCallback): void; + getSnapshots(options: PageOptions, callback: GetSnapshotsCallback): void; + getSnapshots( + optsOrCallback?: PageOptions | GetSnapshotsCallback, + callback?: GetSnapshotsCallback, + ): void | Promise { + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = Object.assign( + { + project: PubSub.formatName_(this.projectId), + }, + options, + ); + + delete reqOpts.gaxOpts; + delete reqOpts.autoPaginate; + + const gaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + this.request< + google.pubsub.v1.ISnapshot, + google.pubsub.v1.IListSnapshotsResponse + >( + { + client: 'SubscriberClient', + method: 'listSnapshots', + reqOpts, + gaxOpts, + }, + (err, rawSnapshots, ...args) => { + let snapshots: Snapshot[]; + + if (rawSnapshots) { + snapshots = rawSnapshots.map( + (snapshot: google.pubsub.v1.ISnapshot) => { + const snapshotInstance = this.snapshot(snapshot.name!); + snapshotInstance.metadata = snapshot; + return snapshotInstance; + }, + ); + } + + callback!(err, snapshots!, ...args); + }, + ); + } + + /** + * Query object for listing subscriptions. + * + * @typedef {object} GetSubscriptionsRequest + * @property {boolean} [autoPaginate=true] Have pagination handled + * automatically. + * @property {object} [options.gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @property {number} [options.pageSize] Maximum number of results to return. + * @property {string} [options.pageToken] Page token. + * @param {string|Topic} options.topic - The name of the topic to + * list subscriptions from. + */ + /** + * @typedef {array} GetSubscriptionsResponse + * @property {Subscription[]} 0 Array of {@link Subscription} instances. + * @property {object} 1 The full API response. + */ + /** + * @callback GetSubscriptionsCallback + * @param {?Error} err Request error, if any. + * @param {Subscription[]} subscriptions Array of {@link Subscription} instances. + * @param {object} apiResponse The full API response. + */ + /** + * Get a list of the subscriptions registered to all of your project's topics. + * You may optionally provide a query object as the first argument to + * customize the response. + * + * Your provided callback will be invoked with an error object if an API error + * occurred or an array of {@link Subscription} objects. + * + * To get subscriptions for a topic, see {@link Topic}. + * + * @see [Subscriptions: list API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/list} + * + * @param {GetSubscriptionsRequest} [query] Query object for listing subscriptions. + * @param {GetSubscriptionsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getSubscriptions(function(err, subscriptions) { + * if (!err) { + * // subscriptions is an array of Subscription objects. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * pubsub.getSubscriptions().then(function(data) { + * const subscriptions = data[0]; + * }); + * ``` + */ + getSubscriptions( + options?: GetSubscriptionsOptions, + ): Promise; + getSubscriptions(callback: GetSubscriptionsCallback): void; + getSubscriptions( + options: GetSubscriptionsOptions, + callback: GetSubscriptionsCallback, + ): void; + getSubscriptions( + optsOrCallback?: GetSubscriptionsOptions | GetSubscriptionsCallback, + callback?: GetSubscriptionsCallback, + ): void | Promise { + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + let topic = options.topic; + if (topic) { + if (!(topic instanceof Topic)) { + topic = this.topic(topic); + } + return topic.getSubscriptions( + options, + callback as GetTopicSubscriptionsCallback, + ); + } + const reqOpts = Object.assign( + {}, + options, + ) as google.pubsub.v1.IListSubscriptionsRequest; + reqOpts.project = 'projects/' + this.projectId; + + delete (reqOpts as GetSubscriptionsOptions).gaxOpts; + delete (reqOpts as GetSubscriptionsOptions).autoPaginate; + + const gaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + this.request< + google.pubsub.v1.ISubscription, + google.pubsub.v1.IListSubscriptionsResponse + >( + { + client: 'SubscriberClient', + method: 'listSubscriptions', + reqOpts, + gaxOpts, + }, + (err, rawSubs, ...args) => { + let subscriptions: Subscription[]; + + if (rawSubs) { + subscriptions = rawSubs.map((sub: google.pubsub.v1.ISubscription) => { + const subscriptionInstance = this.subscription(sub.name!); + subscriptionInstance.metadata = sub; + return subscriptionInstance; + }); + } + + (callback as GetAllSubscriptionsCallback)(err, subscriptions!, ...args); + }, + ); + } + + /** + * Query object for listing topics. + * + * @typedef {object} GetTopicsRequest + * @property {boolean} [autoPaginate=true] Have pagination handled + * automatically. + * @property {object} [options.gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @property {number} [options.pageSize] Maximum number of results to return. + * @property {string} [options.pageToken] Page token. + */ + /** + * @typedef {array} GetTopicsResponse + * @property {Topic[]} 0 Array of {@link Topic} instances. + * @property {object} 1 The full API response. + */ + /** + * @callback GetTopicsCallback + * @param {?Error} err Request error, if any. + * @param {Topic[]} topics Array of {@link Topic} instances. + * @param {object} apiResponse The full API response. + */ + /** + * Get a list of the topics registered to your project. You may optionally + * provide a query object as the first argument to customize the response. + * + * @see [Topics: list API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/list} + * + * @param {GetTopicsRequest} [query] Query object for listing topics. + * @param {GetTopicsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getTopics(function(err, topics) { + * if (!err) { + * // topics is an array of Topic objects. + * } + * }); + * + * //- + * // Customize the query. + * //- + * pubsub.getTopics({ + * pageSize: 3 + * }, function(err, topics) {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * pubsub.getTopics().then(function(data) { + * const topics = data[0]; + * }); + * ``` + */ + getTopics(options?: PageOptions): Promise; + getTopics(callback: GetTopicsCallback): void; + getTopics(options: PageOptions, callback: GetTopicsCallback): void; + getTopics( + optsOrCallback?: PageOptions | GetTopicsCallback, + callback?: GetTopicsCallback, + ): void | Promise { + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = Object.assign( + { + project: 'projects/' + this.projectId, + }, + options, + ); + + delete reqOpts.gaxOpts; + delete reqOpts.autoPaginate; + + const gaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + this.request( + { + client: 'PublisherClient', + method: 'listTopics', + reqOpts, + gaxOpts, + }, + (err, rawTopics, ...args) => { + let topics: Topic[]; + + if (rawTopics) { + topics = rawTopics.map(topic => { + const topicInstance = this.topic(topic.name); + topicInstance.metadata = topic; + return topicInstance; + }); + } + + callback!(err, topics!, ...args); + }, + ); + } + + /** + * Retrieve a client configuration, suitable for passing into a GAPIC + * 'v1' class constructor. This will fill out projectId, emulator URLs, + * and so forth. + * + * @returns {Promise} the filled client configuration. + */ + async getClientConfig(): Promise { + if (!this.projectId || this.projectId === PROJECT_ID_PLACEHOLDER) { + let projectId; + + try { + projectId = await this.auth.getProjectId(); + } catch (e) { + if (!this.isEmulator) { + throw e; + } + projectId = ''; + } + + this.projectId = projectId!; + this.name = PubSub.formatName_(this.projectId); + this.options.projectId = projectId!; + } + + return this.options; + } + + /** + * Gets a schema client, creating one if needed. This is a shortcut for + * `new v1.SchemaServiceClient(await pubsub.getClientConfig())`. + * + * @returns {Promise} + */ + async getSchemaClient(): Promise { + if (!this.schemaClient) { + const options = await this.getClientConfig(); + this.schemaClient = new v1.SchemaServiceClient(options); + } + + return this.schemaClient!; + } + + /** + * Callback function to PubSub.getClient_(). + * @private + * @callback GetClientCallback + * @param err - Error, if any. + * @param gaxClient - The gax client specified in RequestConfig.client. + * Typed any since it's importing Javascript source. + */ + /** + * Get the PubSub client object. + * + * @private + * + * @param {object} config Configuration object. + * @param {object} config.gaxOpts GAX options. + * @param {function} config.method The gax method to call. + * @param {object} config.reqOpts Request options. + * @param {function} [callback] The callback function. + */ + getClient_(config: GetClientConfig, callback: GetClientCallback) { + this.getClientAsync_(config).then( + client => callback(null, client), + callback, + ); + } + /** + * Get the PubSub client object. + * + * @private + * + * @param {object} config Configuration object. + * @param {object} config.gaxOpts GAX options. + * @param {function} config.method The gax method to call. + * @param {object} config.reqOpts Request options. + * @returns {Promise} + */ + async getClientAsync_(config: GetClientConfig): Promise { + // Make sure we've got a fully created config with projectId and such. + const options = await this.getClientConfig(); + + let gaxClient = this.api[config.client]; + + if (!gaxClient) { + // Lazily instantiate client. + gaxClient = new v1[config.client](options) as gax.ClientStub; + this.api[config.client] = gaxClient; + } + + return gaxClient; + } + /** + * Close all open client objects. + * + * @private + * + * @returns {Promise} + */ + async closeAllClients_(): Promise { + const promises = []; + for (const clientConfig of Object.keys(this.api)) { + const gaxClient = this.api[clientConfig]; + promises.push(gaxClient.close()); + delete this.api[clientConfig]; + } + + await Promise.all(promises); + } + /** + * Funnel all API requests through this method, to be sure we have a project + * ID. + * + * @private + * + * @param {object} config Configuration object. + * @param {object} config.gaxOpts GAX options. + * @param {function} config.method The gax method to call. + * @param {object} config.reqOpts Request options. + * @param {function} [callback] The callback function. + */ + request(config: RequestConfig, callback: RequestCallback) { + // This prevents further requests, in case any publishers were hanging around. + if (!this.isOpen) { + const statusObject = { + code: 0, + details: 'Cannot use a closed PubSub object.', + metadata: null, + }; + const err = new Error(statusObject.details); + Object.assign(err, statusObject); + callback(err as gax.grpc.ServiceError); + return; + } + + this.getClient_(config, (err, client) => { + if (err) { + callback(err as gax.grpc.ServiceError); + return; + } + let reqOpts = extend(true, {}, config.reqOpts); + reqOpts = replaceProjectIdToken(reqOpts, this.projectId); + client![config.method](reqOpts, config.gaxOpts, callback); + }); + } + + /** + * Create a Schema object, representing a schema within the project. + * See {@link PubSub#createSchema} or {@link Schema#create} to create a schema. + * + * @throws {Error} If a name is not provided. + * + * @param {string} name The ID or name of the schema. + * @returns {Schema} A {@link Schema} instance. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const schema = pubsub.schema('my-schema'); + * ``` + */ + schema(idOrName: string): Schema { + return new Schema(this, idOrName); + } + + /** + * Create a Snapshot object. See {@link Subscription#createSnapshot} to + * create a snapshot. + * + * @throws {Error} If a name is not provided. + * + * @param {string} name The name of the snapshot. + * @returns {Snapshot} A {@link Snapshot} instance. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const snapshot = pubsub.snapshot('my-snapshot'); + * ``` + */ + snapshot(name: string): Snapshot { + if (typeof name !== 'string') { + throw new Error('You must supply a valid name for the snapshot.'); + } + return new Snapshot(this, name); + } + /** + * Create a Subscription object. This command by itself will not run any API + * requests. You will receive a {@link Subscription} object, + * which will allow you to interact with a subscription. + * + * @throws {Error} If subscription name is omitted. + * + * @param {string} name Name of the subscription. + * @param {SubscriberOptions} [options] Configuration object. + * @returns {Subscription} A {@link Subscription} instance. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const subscription = pubsub.subscription('my-subscription'); + * + * // Register a listener for `message` events. + * subscription.on('message', function(message) { + * // Called every time a message is received. + * // message.id = ID of the message. + * // message.ackId = ID used to acknowledge the message receival. + * // message.data = Contents of the message. + * // message.attributes = Attributes of the message. + * // message.publishTime = Date when Pub/Sub received the message. + * }); + * ``` + */ + subscription(name: string, options?: SubscriptionOptions): Subscription { + if (!name) { + throw new Error('A name must be specified for a subscription.'); + } + return new Subscription(this, name, options); + } + /** + * Create a Topic object. See {@link PubSub#createTopic} to create a topic. + * + * @throws {Error} If a name is not provided. + * + * @param {string} name The name of the topic. + * @param {PublishOptions} [options] Publisher configuration object. + * @returns {Topic} A {@link Topic} instance. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * ``` + */ + topic(name: string, options?: PublishOptions): Topic { + if (!name) { + throw new Error('A name must be specified for a topic.'); + } + return new Topic(this, name, options); + } + + /** + * Validate a schema definition. + * + * @see [Schemas: validateSchema API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/validate} + * + * @throws {Error} if the validation fails. + * + * @param {ISchema} schema The schema definition you wish to validate. + * @param {object} [options] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @returns {Promise} + */ + async validateSchema(schema: ISchema, gaxOpts?: CallOptions): Promise { + const client = await this.getSchemaClient(); + await client.validateSchema( + { + parent: this.name, + schema, + }, + gaxOpts, + ); + } + + /*! + * Format the name of a project. A project's full name is in the + * format of projects/{projectId}. + * + * The GAPIC client should do this for us, but since we maintain + * names rather than IDs, this is simpler. + * + * @private + */ + static formatName_(name: string): string { + if (typeof name !== 'string') { + throw new Error('A name is required to identify a project.'); + } + + // Simple check if the name is already formatted. + if (name.indexOf('/') > -1) { + return name; + } + return `projects/${name}`; + } +} + +/** + * Get a list of the {@link Snapshot} objects as a readable object stream. + * + * @method PubSub#getSnapshotsStream + * @param {GetSnapshotsRequest} [options] Configuration object. See + * {@link PubSub#getSnapshots} for a complete list of options. + * @returns {ReadableStream} A readable stream of {@link Snapshot} instances. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getSnapshotsStream() + * .on('error', console.error) + * .on('data', function(snapshot) { + * // snapshot is a Snapshot object. + * }) + * .on('end', function() { + * // All snapshots retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * pubsub.getSnapshotsStream() + * .on('data', function(snapshot) { + * this.end(); + * }); + * ``` + */ + +/** + * Get a list of the {@link Subscription} objects registered to all of + * your project's topics as a readable object stream. + * + * @method PubSub#getSubscriptionsStream + * @param {GetSubscriptionsRequest} [options] Configuration object. See + * {@link PubSub#getSubscriptions} for a complete list of options. + * @returns {ReadableStream} A readable stream of {@link Subscription} instances. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getSubscriptionsStream() + * .on('error', console.error) + * .on('data', function(subscription) { + * // subscription is a Subscription object. + * }) + * .on('end', function() { + * // All subscriptions retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * pubsub.getSubscriptionsStream() + * .on('data', function(subscription) { + * this.end(); + * }); + * ``` + */ + +/** + * Get a list of the {module:pubsub/topic} objects registered to your project as + * a readable object stream. + * + * @method PubSub#getTopicsStream + * @param {GetTopicsRequest} [options] Configuration object. See + * {@link PubSub#getTopics} for a complete list of options. + * @returns {ReadableStream} A readable stream of {@link Topic} instances. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getTopicsStream() + * .on('error', console.error) + * .on('data', function(topic) { + * // topic is a Topic object. + * }) + * .on('end', function() { + * // All topics retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * pubsub.getTopicsStream() + * .on('data', function(topic) { + * this.end(); + * }); + * ``` + */ + +/*! Developer Documentation + * + * These methods can be auto-paginated. + */ +paginator.extend(PubSub, ['getSnapshots', 'getSubscriptions', 'getTopics']); + +/*! Developer Documentation + * + * Existing async methods (except for streams) will return a Promise in the event + * that a callback is omitted. Future methods will not allow for a callback. + * (Use .then() on the returned Promise instead.) + */ +promisifySome(PubSub, PubSub.prototype, [ + 'close', + 'createSubscription', + 'createTopic', + 'detachSubscription', + 'getSnapshots', + 'getSubscriptions', + 'getTopics', +]); diff --git a/handwritten/pubsub/src/pull-retry.ts b/handwritten/pubsub/src/pull-retry.ts new file mode 100644 index 00000000000..4e2e725b259 --- /dev/null +++ b/handwritten/pubsub/src/pull-retry.ts @@ -0,0 +1,68 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {grpc} from 'google-gax'; + +/*! + * retryable grpc.status codes + */ +export const RETRY_CODES: grpc.status[] = [ + grpc.status.DEADLINE_EXCEEDED, + grpc.status.RESOURCE_EXHAUSTED, + grpc.status.ABORTED, + grpc.status.INTERNAL, + grpc.status.UNAVAILABLE, + grpc.status.CANCELLED, +]; + +/** + * Used to track pull requests and determine if additional requests should be + * made, etc. + * + * @class + * @private + */ +export class PullRetry { + /** + * Determines if a request grpc.status should be retried. + * + * Deadlines behave kind of unexpectedly on streams, rather than using it as + * an indicator of when to give up trying to connect, it actually dictates + * how long the stream should stay open. Because of this, it is virtually + * impossible to determine whether or not a deadline error is the result of + * the server closing the stream or if we timed out waiting for a connection. + * + * @private + * @param {object} grpc.status The request grpc.status. + * @returns {boolean} + */ + static retry(err: grpc.StatusObject): boolean { + if ( + err.code === grpc.status.UNAVAILABLE && + err.details && + err.details.match(/Server shutdownNow invoked/) + ) { + return true; + } + + return RETRY_CODES.includes(err.code); + } + + static resetFailures(err: grpc.StatusObject): boolean { + return ( + err.code === grpc.status.OK || err.code === grpc.status.DEADLINE_EXCEEDED + ); + } +} diff --git a/handwritten/pubsub/src/schema.ts b/handwritten/pubsub/src/schema.ts new file mode 100644 index 00000000000..f2c97cb67a5 --- /dev/null +++ b/handwritten/pubsub/src/schema.ts @@ -0,0 +1,300 @@ +// 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {CallOptions} from 'google-gax'; +import {google} from '../protos/protos'; +import {Attributes} from './publisher'; +import {PubSub} from './pubsub'; + +// Unlike the earlier classes, this one does not do its own gax access. +// Rather, it calls back through the schemaClient instance PubSub holds. +// This class is a very lightweight syntactic wrapper around the GAPIC client. + +/** + * A Schema object allows you to interact with a Cloud Pub/Sub schema. + * + * This should only be instantiated by the PubSub class. To obtain an + * instance for end user usage, call pubsub.schema(). + * + * @class + * @param {PubSub} pubsub The PubSub object creating this object. + * @param {id} id name or ID of the schema. + * + * @example Creating an instance of this class. + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const schema = pubsub.schema('my-schema'); + * + * ``` + * @example Getting the details of a schema. Note that Schema methods do not provide a callback interface. Use .then() or await. + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const schema = pubsub.schema('my-schema'); + * schema.get(SchemaViews.Basic).then(console.log); + * ``` + */ +export class Schema { + id: string; + name_?: string; + pubsub: PubSub; + + constructor(pubsub: PubSub, idOrName: string) { + /** + * The parent {@link PubSub} instance of this topic instance. + * @name Schema#pubsub + * @type {PubSub} + */ + this.pubsub = pubsub; + + /** + * The fully qualified name of this schema. We will qualify this if + * it's only an ID passed (assuming the parent project). Unfortunately, + * we might not be able to do that if our pubsub's client hasn't been + * initialized. In that case, we just set the id and get the name later. + * @name Schema#id + * @type {string} + */ + this.id = + idOrName.indexOf('/') >= 0 + ? idOrName.substr(idOrName.lastIndexOf('/') + 1) + : idOrName; + } + + /** + * Return the fully qualified name of this schema. + * + * Note that we have to verify that we have a projectId before returning this, + * so we have to check that first. + * + * @return {Promise} a Promise that resolves to the full schema name + */ + async getName(): Promise { + if (!this.name_) { + if (!this.pubsub.isIdResolved) { + await this.pubsub.getClientConfig(); + } + this.name_ = Schema.formatName_(this.pubsub.projectId, this.id); + } + return this.name_; + } + + /** + * Create a schema. + * + * @see [Schemas: create API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/create} + * + * @throws {Error} if the schema type is incorrect. + * @throws {Error} if the definition is invalid. + * + * @param {SchemaType} type The type of the schema (Protobuf, Avro, etc). + * @param {string} definition The text describing the schema in terms of the type. + * @param {object} [options] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @returns {Promise} + * + * @example Create a schema. + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const schema = pubsub.schema('messageType'); + * await schema.create( + * SchemaTypes.Avro, + * '{...avro definition...}' + * ); + * ``` + */ + async create( + type: SchemaType, + definition: string, + gaxOpts?: CallOptions, + ): Promise { + const name = await this.getName(); + await this.pubsub.createSchema(name, type, definition, gaxOpts); + } + + /** + * Get full information about the schema from the service. + * + * @see [Schemas: getSchema API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/get} + * + * @param {google.pubsub.v1.SchemaView} [view] The type of schema object + * requested, which should be an enum value from {@link SchemaViews}. Defaults + * to Full. + * @param {object} [options] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @returns {Promise} + */ + async get( + view: SchemaView = SchemaViews.Full, + gaxOpts?: CallOptions, + ): Promise { + const client = await this.pubsub.getSchemaClient(); + const name = await this.getName(); + const [schema] = await client.getSchema( + { + name, + view, + }, + gaxOpts, + ); + + return schema; + } + + /** + * Delete the schema from the project. + * + * @see [Schemas: deleteSchema API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/delete} + * + * @param {object} [options] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @returns {Promise} + */ + async delete(gaxOpts?: CallOptions): Promise { + const client = await this.pubsub.getSchemaClient(); + const name = await this.getName(); + await client.deleteSchema( + { + name, + }, + gaxOpts, + ); + } + + /** + * Validate a message against this schema's definition. + * + * If you would like to validate a message against an arbitrary schema, please + * use the {@link SchemaServiceClient} GAPIC class directly, using your + * {@link PubSub} instance's configuration, via {@link PubSub#getClientConfig}. + * + * @see [Schemas: validateMessage API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/validateMessage} + * + * @throws {Error} if the validation fails. + * @throws {Error} if other parameters are invalid. + * + * @param {string} message The message to validate. + * @param {Encoding | "JSON" | "BINARY"} encoding The encoding of the message to validate. + * @param {object} [options] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @returns {Promise} + */ + async validateMessage( + message: string, + encoding: + | google.pubsub.v1.Encoding + | keyof typeof google.pubsub.v1.Encoding, + gaxOpts?: CallOptions, + ): Promise { + const client = await this.pubsub.getSchemaClient(); + const name = await this.getName(); + + await client.validateMessage( + { + parent: this.pubsub.name, + name, + message, + encoding, + }, + gaxOpts, + ); + } + + /*! + * Format the name of a schema. A schema's full name is in the + * format of projects/{projectId}/schemas/{schemaName}. + * + * The GAPIC client should do this for us, but since we maintain + * names rather than IDs, this is simpler. + * + * @private + */ + static formatName_(projectId: string, nameOrId: string): string { + if (typeof nameOrId !== 'string') { + throw new Error('A name is required to identify a schema.'); + } + + // Simple check if the name is already formatted. + if (nameOrId.indexOf('/') > -1) { + return nameOrId; + } + return `projects/${projectId}/schemas/${nameOrId}`; + } + + /** + * Translates the schema attributes in messages delivered from Pub/Sub. + * All resulting fields may end up being blank. + */ + static metadataFromMessage(attributes: Attributes): SchemaMessageMetadata { + return { + name: attributes['googclient_schemaname'], + revision: attributes['googclient_schemarevisionid'], + encoding: attributes[ + 'googclient_schemaencoding' + ] as unknown as SchemaEncoding, + }; + } +} + +/** + * Schema metadata that might be gathered from a Pub/Sub message. + * This is created for you from {@link Schema#metadataForMessage}. + */ +export interface SchemaMessageMetadata { + /** + * Schema name; may be queried using {@link PubSub#schema}. + */ + name?: string; + + /** + * Schema revision; this goes with {@link name} as needed. + */ + revision?: string; + + /** + * Encoding; this will be Encodings.Json or Encodings.Binary. + */ + encoding: SchemaEncoding | undefined; +} + +// Export all of these so that clients don't have to dig for them. +export type CreateSchemaResponse = google.pubsub.v1.Schema; +export type ISchema = google.pubsub.v1.ISchema; +export type SchemaType = keyof typeof google.pubsub.v1.Schema.Type; +export type SchemaView = keyof typeof google.pubsub.v1.SchemaView; +export type ICreateSchemaRequest = google.pubsub.v1.ICreateSchemaRequest; +export type SchemaEncoding = keyof typeof google.pubsub.v1.Encoding; + +// Also export these for JavaScript compatible usage. +export const SchemaTypes = { + ProtocolBuffer: 'PROTOCOL_BUFFER' as const, + Avro: 'AVRO' as const, +}; + +export const SchemaViews = { + Basic: 'BASIC' as const, + Full: 'FULL' as const, +}; + +// These are not schema-specific, but this seems to be the +// only place that exports methods that need them. +export const Encodings = { + Json: 'JSON' as const, + Binary: 'BINARY' as const, +}; diff --git a/handwritten/pubsub/src/snapshot.ts b/handwritten/pubsub/src/snapshot.ts new file mode 100644 index 00000000000..1924015e5cf --- /dev/null +++ b/handwritten/pubsub/src/snapshot.ts @@ -0,0 +1,278 @@ +/*! + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {CallOptions} from 'google-gax'; + +import {google} from '../protos/protos'; +import {PubSub} from './pubsub'; +import { + EmptyCallback, + EmptyResponse, + RequestCallback, + ResourceCallback, +} from './pubsub'; +import {Subscription} from './subscription'; +import {promisifySome} from './util'; + +export type CreateSnapshotCallback = ResourceCallback< + Snapshot, + google.pubsub.v1.ISnapshot +>; +export type CreateSnapshotResponse = [Snapshot, google.pubsub.v1.ISnapshot]; + +export type SeekCallback = RequestCallback; +export type SeekResponse = [google.pubsub.v1.ISeekResponse]; + +/** + * A Snapshot object will give you access to your Cloud Pub/Sub snapshot. + * + * Snapshots are sometimes retrieved when using various methods: + * + * - {@link PubSub#getSnapshots} + * - {@link PubSub#getSnapshotsStream} + * - {@link PubSub#snapshot} + * + * Snapshots may be created with: + * + * - {@link Subscription#createSnapshot} + * + * You can use snapshots to seek a subscription to a specific point in time. + * + * - {@link Subscription#seek} + * + * @class + * + * @example + * ``` + * //- + * // From {@link PubSub#getSnapshots}: + * //- + * pubsub.getSnapshots((err, snapshots) => { + * // `snapshots` is an array of Snapshot objects. + * }); + * + * //- + * // From {@link PubSub#getSnapshotsStream}: + * //- + * pubsub.getSnapshotsStream() + * .on('error', console.error) + * .on('data', (snapshot) => { + * // `snapshot` is a Snapshot object. + * }); + * + * //- + * // From {@link PubSub#snapshot}: + * //- + * const snapshot = pubsub.snapshot('my-snapshot'); + * // snapshot is a Snapshot object. + * + * //- + * // Create a snapshot with {module:pubsub/subscription#createSnapshot}: + * //- + * const subscription = pubsub.subscription('my-subscription'); + * + * subscription.createSnapshot('my-snapshot', (err, snapshot) => { + * if (!err) { + * // `snapshot` is a Snapshot object. + * } + * }); + * + * //- + * // Seek to your snapshot: + * //- + * const subscription = pubsub.subscription('my-subscription'); + * + * subscription.seek('my-snapshot', (err) => { + * if (err) { + * // Error handling omitted. + * } + * }); + * ``` + */ +export class Snapshot { + parent: Subscription | PubSub; + name: string; + metadata?: google.pubsub.v1.ISnapshot; + constructor(parent: Subscription | PubSub, name: string) { + this.parent = parent; + this.name = Snapshot.formatName_(parent.projectId, name); + } + + /** + * Delete the snapshot. + * + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse The full API response from the + * service. + * + * @example + * ``` + * snapshot.delete((err, apiResponse) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * snapshot.delete().then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + delete(): Promise; + delete(callback: EmptyCallback): void; + delete(callback?: EmptyCallback): void | Promise { + const reqOpts = { + snapshot: this.name, + }; + + this.parent.request( + { + client: 'SubscriberClient', + method: 'deleteSnapshot', + reqOpts, + }, + callback!, + ); + } + + /*@ + * Format the name of a snapshot. A snapshot's full name is in the format of + * projects/{projectId}/snapshots/{snapshotName} + * + * @private + */ + static formatName_(projectId: string, name: string) { + return 'projects/' + projectId + '/snapshots/' + name.split('/').pop(); + } + + /** + * Create a snapshot with the given name. + * + * **This is only available if you accessed this object through + * {@link Subscription#snapshot}.** + * + * @method Snapshot#create + * @param {string} name Name of the snapshot. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error from the API call, may be null. + * @param {Snapshot} callback.snapshot The newly created + * snapshot. + * @param {object} callback.apiResponse The full API response from the + * service. + * + * @example + * ``` + * const subscription = pubsub.subscription('my-subscription'); + * const snapshot = subscription.snapshot('my-snapshot'); + * + * const callback = (err, snapshot, apiResponse) => { + * if (!err) { + * // The snapshot was created successfully. + * } + * }; + * + * snapshot.create('my-snapshot', callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * snapshot.create('my-snapshot').then((data) => { + * const snapshot = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + create(gaxOpts?: CallOptions): Promise; + create(callback: CreateSnapshotCallback): void; + create(gaxOpts: CallOptions, callback: CreateSnapshotCallback): void; + create( + optsOrCallback?: CallOptions | CreateSnapshotCallback, + callback?: CreateSnapshotCallback, + ): void | Promise { + if (!(this.parent instanceof Subscription)) { + throw new Error( + 'This is only available if you accessed this object through Subscription#snapshot', + ); + } + + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + return this.parent.createSnapshot( + this.name, + options, + (err, snapshot, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + Object.assign(this, snapshot); + callback!(null, this, resp); + }, + ); + } + + /** + * Seeks an existing subscription to the snapshot. + * + * **This is only available if you accessed this object through + * {@link Subscription#snapshot}.** + * + * @method Snapshot#seek + * @param {function} callback The callback function. + * @param {?error} callback.err An error from the API call, may be null. + * @param {object} callback.apiResponse The full API response from the + * service. + * + * @example + * ``` + * const subscription = pubsub.subscription('my-subscription'); + * const snapshot = subscription.snapshot('my-snapshot'); + * + * snapshot.seek((err, apiResponse) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * snapshot.seek().then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + seek(gaxOpts?: CallOptions): Promise; + seek(callback: SeekCallback): void; + seek(gaxOpts: CallOptions, callback: SeekCallback): void; + seek( + gaxOpts?: CallOptions | SeekCallback, + callback?: SeekCallback, + ): void | Promise { + if (!(this.parent instanceof Subscription)) { + throw new Error( + 'This is only available if you accessed this object through Subscription#snapshot', + ); + } + return this.parent.seek(this.name, gaxOpts! as CallOptions, callback!); + } +} + +/*! Developer Documentation + * + * Existing async methods (except for streams) will return a Promise in the event + * that a callback is omitted. Future methods will not allow for a callback. + * (Use .then() on the returned Promise instead.) + */ +promisifySome(Snapshot, Snapshot.prototype, ['delete', 'create', 'seek']); diff --git a/handwritten/pubsub/src/subscriber.ts b/handwritten/pubsub/src/subscriber.ts new file mode 100644 index 00000000000..a08dc6d6646 --- /dev/null +++ b/handwritten/pubsub/src/subscriber.ts @@ -0,0 +1,1372 @@ +/*! + * Copyright 2018 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {DateStruct, PreciseDate} from '@google-cloud/precise-date'; +import {replaceProjectIdToken} from '@google-cloud/projectify'; +import {promisify} from '@google-cloud/promisify'; +import defer = require('p-defer'); + +import {google} from '../protos/protos'; +import {Histogram} from './histogram'; +import {FlowControlOptions, LeaseManager} from './lease-manager'; +import {AckQueue, BatchOptions, ModAckQueue} from './message-queues'; +import {MessageStream, MessageStreamOptions} from './message-stream'; +import {Subscription} from './subscription'; +import {defaultOptions} from './default-options'; +import {SubscriberClient} from './v1'; +import * as tracing from './telemetry-tracing'; +import {Duration, atMost as durationAtMost} from './temporal'; +import {EventEmitter} from 'events'; + +import {awaitWithTimeout} from './util'; +import {logs as baseLogs} from './logs'; + +export {StatusError} from './message-stream'; + +/** + * Loggers. Exported for unit tests. + * + * @private + */ +export const logs = { + slowAck: baseLogs.pubsub.sublog('slow-ack'), + ackNack: baseLogs.pubsub.sublog('ack-nack'), + debug: baseLogs.pubsub.sublog('debug'), +}; + +export type PullResponse = google.pubsub.v1.IStreamingPullResponse; +export type SubscriptionProperties = + google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties; + +type ValueOf = T[keyof T]; +export const AckResponses = { + PermissionDenied: 'PERMISSION_DENIED' as const, + FailedPrecondition: 'FAILED_PRECONDITION' as const, + Success: 'SUCCESS' as const, + Invalid: 'INVALID' as const, + Other: 'OTHER' as const, +}; +export type AckResponse = ValueOf; + +/** + * Enum values for behaviors of the Subscriber.close() method. + */ +export const SubscriberCloseBehaviors = { + NackImmediately: 'NACK' as const, + WaitForProcessing: 'WAIT' as const, +}; +export type SubscriberCloseBehavior = ValueOf; + +/** + * Options to modify the behavior of the Subscriber.close() method. If + * none is passed, the default is SubscriberCloseBehaviors.Wait. + */ +export interface SubscriberCloseOptions { + behavior?: SubscriberCloseBehavior; + timeout?: Duration; +} + +/** + * Specifies how long before the final close timeout, in WaitForProcessing mode, + * that we should give up and start shutting down cleanly. + */ +const FINAL_NACK_TIMEOUT = Duration.from({seconds: 1}); + +/** + * Thrown when an error is detected in an ack/nack/modack call, when + * exactly-once delivery is enabled on the subscription. This will + * only be thrown for actual errors that can't be retried. + */ +export class AckError extends Error { + errorCode: AckResponse; + + constructor(errorCode: AckResponse, message?: string) { + let finalMessage = `${errorCode}`; + if (message) { + finalMessage += ` : ${message}`; + } + super(finalMessage); + this.errorCode = errorCode; + } +} + +/** + * Tracks the various spans related to subscriber/receive tracing. + * + * @private + */ +export class SubscriberSpans { + parent: tracing.MessageWithAttributes; + + // These are always attached to a message. + constructor(parent: tracing.MessageWithAttributes) { + this.parent = parent; + } + + // Start a flow control span if needed. + flowStart() { + if (!this.flow) { + this.flow = tracing.PubsubSpans.createReceiveFlowSpan(this.parent); + } + } + + // End any flow control span. + flowEnd() { + if (this.flow) { + this.flow.end(); + this.flow = undefined; + } + } + + // Emit an event for starting to send an ack. + ackStart() { + tracing.PubsubEvents.ackStart(this.parent); + } + + // Emit an event for the ack having been sent. + ackEnd() { + tracing.PubsubEvents.ackEnd(this.parent); + } + + // Emit an event for calling ack. + ackCall() { + if (this.processing) { + tracing.PubsubEvents.ackCalled(this.processing); + } + } + + // Emit an event for starting to send a nack. + nackStart() { + tracing.PubsubEvents.nackStart(this.parent); + } + + // Emit an event for the nack having been sent. + nackEnd() { + tracing.PubsubEvents.nackEnd(this.parent); + } + + // Emit an event for calling nack. + nackCall() { + if (this.processing) { + tracing.PubsubEvents.nackCalled(this.processing); + } + } + + // Emit an event for starting to send a modAck. + modAckStart(deadline: Duration, isInitial: boolean) { + tracing.PubsubEvents.modAckStart(this.parent, deadline, isInitial); + } + + // Emit an event for the modAck having been sent. + modAckEnd() { + tracing.PubsubEvents.modAckEnd(this.parent); + } + + // Emit an event for calling modAck. + // Note that we don't currently support users calling modAck directly, but + // this may be used in the future for things like fully managed pull + // subscriptions. + modAckCall(deadline: Duration) { + if (this.processing) { + tracing.PubsubEvents.modAckCalled(this.processing, deadline); + } + } + + // Start a scheduler span if needed. + // Note: This is not currently used in Node, because there is no + // scheduler process, due to the way messages are delivered one at a time. + schedulerStart() { + if (!this.scheduler) { + this.scheduler = tracing.PubsubSpans.createReceiveSchedulerSpan( + this.parent, + ); + } + } + + // End any scheduler span. + schedulerEnd() { + if (this.scheduler) { + this.scheduler.end(); + this.scheduler = undefined; + } + } + + // Start a processing span if needed. + // This is for user processing, during on('message') delivery. + processingStart(subName: string) { + if (!this.processing) { + this.processing = tracing.PubsubSpans.createReceiveProcessSpan( + this.parent, + subName, + ); + } + } + + // End any processing span. + processingEnd() { + if (this.processing) { + this.processing.end(); + this.processing = undefined; + } + } + + // If we shut down before processing can finish. + shutdown() { + tracing.PubsubEvents.shutdown(this.parent); + } + + private flow?: tracing.Span; + private scheduler?: tracing.Span; + private processing?: tracing.Span; +} + +/** + * Date object with nanosecond precision. Supports all standard Date arguments + * in addition to several custom types. + * + * @external PreciseDate + * @see {@link https://github.com/googleapis/nodejs-precise-date|PreciseDate} + */ +/** + * Message objects provide a simple interface for users to get message data and + * acknowledge the message. + * + * @example + * ``` + * subscription.on('message', message => { + * // { + * // ackId: 'RUFeQBJMJAxESVMrQwsqWBFOBCEhPjA', + * // attributes: {key: 'value'}, + * // data: Buffer.from('Hello, world!'), + * // id: '1551297743043', + * // orderingKey: 'ordering-key', + * // publishTime: new PreciseDate('2019-02-27T20:02:19.029534186Z'), + * // received: 1551297743043, + * // length: 13 + * // } + * }); + * ``` + */ +export class Message implements tracing.MessageWithAttributes { + ackId: string; + attributes: {[key: string]: string}; + data: Buffer; + deliveryAttempt: number; + id: string; + orderingKey?: string; + publishTime: PreciseDate; + received: number; + private _handledPromise: defer.DeferredPromise; + private _handled: boolean; + private _length: number; + private _subscriber: Subscriber; + private _ackFailed?: AckError; + private _dispatched: boolean; + + /** + * @private + * + * Tracks a telemetry tracing parent span through the receive process. This will + * be the original publisher-side span if we have one; otherwise we'll create + * a "publisher" span to hang new subscriber spans onto. + * + * This needs to be declared explicitly here, because having a public class + * implement a private interface seems to confuse TypeScript. (And it's needed + * in unit tests.) + */ + parentSpan?: tracing.Span; + + /** + * We'll save the state of the subscription's exactly once delivery flag at the + * time the message was received. This is pretty much only for tracing, as we will + * generally use the live state of the subscription to figure out how to respond. + * + * @private + * @internal + */ + isExactlyOnceDelivery: boolean; + + /** + * @private + * + * Ends any open subscribe telemetry tracing span. + */ + endParentSpan() { + this.parentSpan?.end(); + delete this.parentSpan; + } + + /** + * @private + * + * Tracks subscriber-specific telemetry objects through the library. + */ + subSpans: SubscriberSpans; + + /** + * @hideconstructor + * + * @param {Subscriber} sub The parent subscriber. + * @param {object} message The raw message response. + */ + constructor( + sub: Subscriber, + {ackId, message, deliveryAttempt}: google.pubsub.v1.IReceivedMessage, + ) { + /** + * This ID is used to acknowledge the message. + * + * @name Message#ackId + * @type {string} + */ + this.ackId = ackId!; + /** + * Optional attributes for this message. + * + * @name Message#attributes + * @type {object} + */ + this.attributes = message!.attributes || {}; + /** + * The message data as a Buffer. + * + * @name Message#data + * @type {Buffer} + */ + this.data = message!.data as Buffer; + /** + * Delivery attempt counter is 1 + (the sum of number of NACKs and number of + * ack_deadline exceeds) for this message. + * + * @name Message#deliveryAttempt + * @type {number} + */ + this.deliveryAttempt = Number(deliveryAttempt || 0); + /** + * ID of the message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. + * + * @name Message#id + * @type {string} + */ + this.id = message!.messageId!; + /** + * Identifies related messages for which publish order should be respected. + * If a `Subscription` has `enableMessageOrdering` set to `true`, messages + * published with the same `orderingKey` value will be delivered to + * subscribers in the order in which they are received by the Pub/Sub + * system. + * + * **EXPERIMENTAL:** This feature is part of a closed alpha release. This + * API might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * + * @name Message#orderingKey + * @type {string} + */ + this.orderingKey = message!.orderingKey!; + /** + * The time at which the message was published. + * + * @name Message#publishTime + * @type {external:PreciseDate} + */ + this.publishTime = new PreciseDate(message!.publishTime as DateStruct); + /** + * The time at which the message was recieved by the subscription. + * + * @name Message#received + * @type {number} + */ + this.received = Date.now(); + + /** + * Telemetry tracing objects. + * + * @private + */ + this.subSpans = new SubscriberSpans(this); + + /** + * Save the state of the subscription into the message for later tracing. + * + * @private + * @internal + */ + this.isExactlyOnceDelivery = sub.isExactlyOnceDelivery; + + this._dispatched = false; + this._handled = false; + this._handledPromise = defer(); + this._length = this.data.length; + this._subscriber = sub; + } + + /** + * The length of the message data. + * + * @type {number} + */ + get length() { + return this._length; + } + + /** + * Resolves when the message has been handled fully; a handled message may + * not have any further operations performed on it. + * + * @private + */ + get handledPromise(): Promise { + return this._handledPromise.promise; + } + + /** + * When this message is dispensed to user callback code, this should be called. + * The time between the dispatch and the handledPromise resolving is when the + * message is with the user. + * + * @private + */ + dispatched(): void { + if (!this._dispatched) { + this.subSpans.processingStart(this._subscriber.name); + this._dispatched = true; + } + } + + /** + * @private + * @returns True if this message has been dispatched to user callback code. + */ + isDispatched(): boolean { + return this._dispatched; + } + + /** + * Sets this message's exactly once delivery acks to permanent failure. This is + * meant for internal library use only. + * + * @private + */ + ackFailed(error: AckError): void { + this._ackFailed = error; + } + + /** + * Acknowledges the message. + * + * @example + * ``` + * subscription.on('message', message => { + * message.ack(); + * }); + * ``` + */ + ack(): void { + if (!this._handled) { + this._handled = true; + this.subSpans.ackCall(); + this.subSpans.processingEnd(); + void this._subscriber.ack(this); + this._handledPromise.resolve(); + } + } + + /** + * Acknowledges the message, expecting a response (for exactly-once delivery subscriptions). + * If exactly-once delivery is not enabled, this will immediately resolve successfully. + * + * @example + * ``` + * subscription.on('message', async (message) => { + * const response = await message.ackWithResponse(); + * }); + * ``` + */ + async ackWithResponse(): Promise { + if (!this._subscriber.isExactlyOnceDelivery) { + this.ack(); + return AckResponses.Success; + } + + if (this._ackFailed) { + throw this._ackFailed; + } + + if (!this._handled) { + this._handled = true; + this.subSpans.ackCall(); + this.subSpans.processingEnd(); + try { + return await this._subscriber.ackWithResponse(this); + } catch (e) { + this.ackFailed(e as AckError); + throw e; + } finally { + this._handledPromise.resolve(); + } + } else { + return AckResponses.Invalid; + } + } + + /** + * Modifies the ack deadline. + * At present time, this should generally not be called by users. + * + * @param {number} deadline The number of seconds to extend the deadline. + * @private + */ + modAck(deadline: number): void { + if (!this._handled) { + this.subSpans.modAckCall(Duration.from({seconds: deadline})); + void this._subscriber.modAck(this, deadline); + } + } + + /** + * Modifies the ack deadline, expecting a response (for exactly-once delivery subscriptions). + * If exactly-once delivery is not enabled, this will immediately resolve successfully. + * At present time, this should generally not be called by users. + * + * @param {number} deadline The number of seconds to extend the deadline. + * @private + */ + async modAckWithResponse(deadline: number): Promise { + if (!this._subscriber.isExactlyOnceDelivery) { + this.modAck(deadline); + return AckResponses.Success; + } + + if (this._ackFailed) { + throw this._ackFailed; + } + + if (!this._handled) { + this.subSpans.modAckCall(Duration.from({seconds: deadline})); + try { + return await this._subscriber.modAckWithResponse(this, deadline); + } catch (e) { + this.ackFailed(e as AckError); + throw e; + } + } else { + return AckResponses.Invalid; + } + } + + /** + * Removes the message from our inventory and schedules it to be redelivered. + * + * @example + * ``` + * subscription.on('message', message => { + * message.nack(); + * }); + * ``` + */ + nack(): void { + if (!this._handled) { + this._handled = true; + this.subSpans.nackCall(); + this.subSpans.processingEnd(); + void this._subscriber.nack(this); + this._handledPromise.resolve(); + } + } + + /** + * Removes the message from our inventory and schedules it to be redelivered, + * with the modAck response being returned (for exactly-once delivery subscriptions). + * If exactly-once delivery is not enabled, this will immediately resolve successfully. + * + * @example + * ``` + * subscription.on('message', async (message) => { + * const response = await message.nackWithResponse(); + * }); + * ``` + */ + async nackWithResponse(): Promise { + if (!this._subscriber.isExactlyOnceDelivery) { + this.nack(); + return AckResponses.Success; + } + + if (this._ackFailed) { + throw this._ackFailed; + } + + if (!this._handled) { + this._handled = true; + this.subSpans.nackCall(); + this.subSpans.processingEnd(); + try { + return await this._subscriber.nackWithResponse(this); + } catch (e) { + this.ackFailed(e as AckError); + throw e; + } finally { + this._handledPromise.resolve(); + } + } else { + return AckResponses.Invalid; + } + } +} + +/** + * @typedef {object} SubscriberOptions + * @property {number} [ackDeadline=10] Acknowledge deadline in seconds. If left + * unset, the initial value will be 10 seconds, but it will evolve into the + * 99th percentile time it takes to acknowledge a message, subject to the + * limitations of minAckDeadline and maxAckDeadline. If ackDeadline is set + * by the user, then the min/max values will be set to match it. New code + * should prefer setting minAckDeadline and maxAckDeadline directly. + * @property {Duration} [minAckDeadline] The minimum time that ackDeadline should + * ever have, while it's under library control. + * @property {Duration} [maxAckDeadline] The maximum time that ackDeadline should + * ever have, while it's under library control. + * @property {Duration} [maxExtensionTime] The maximum time that ackDeadline should + * ever have, while it's under library control. + * @property {BatchOptions} [batching] Request batching options; this is for + * batching acks and modacks being sent back to the server. + * @property {FlowControlOptions} [flowControl] Flow control options. + * @property {boolean} [useLegacyFlowControl] Disables enforcing flow control + * settings at the Cloud PubSub server and uses the less accurate method + * of only enforcing flow control at the client side. + * @property {MessageStreamOptions} [streamingOptions] Streaming options. + * If no options are passed, it behaves like `SubscriberCloseBehaviors.Wait`. + * @property {SubscriberCloseOptions} [options] Determines the basic behavior of the + * close() function. + * @property {SubscriberCloseBehavior} [options.behavior] The behavior of the close operation. + * - NackImmediately: Sends nacks for all messages held by the client library, and + * wait for them to send. (default to match old behavior) + * - WaitForProcessing: Continues normal ack/nack and leasing processes until close + * to the timeout, then switches to NackImmediately behavior to close down. + * Use {@link SubscriberCloseBehaviors} for enum values. + * @property {Duration} [options.timeout] In the case of Timeout, the maximum duration + * to wait for pending ack/nack requests to complete before resolving (or rejecting) + * the promise. + */ +export interface SubscriberOptions { + minAckDeadline?: Duration; + maxAckDeadline?: Duration; + maxExtensionTime?: Duration; + batching?: BatchOptions; + flowControl?: FlowControlOptions; + useLegacyFlowControl?: boolean; + streamingOptions?: MessageStreamOptions; + closeOptions?: SubscriberCloseOptions; +} + +const minAckDeadlineForExactlyOnceDelivery = Duration.from({seconds: 60}); + +/** + * Subscriber class is used to manage all message related functionality. + * + * @private + * @class + * + * @param {Subscription} subscription The corresponding subscription. + * @param {SubscriberOptions} options The subscriber options. + */ +export class Subscriber extends EventEmitter { + ackDeadline: number; + maxMessages: number; + maxBytes: number; + useLegacyFlowControl: boolean; + isOpen: boolean; + maxExtensionTime: Duration; + private _acks!: AckQueue; + private _histogram: Histogram; + private _inventory!: LeaseManager; + private _latencies: Histogram; + private _modAcks!: ModAckQueue; + private _name!: string; + private _options!: SubscriberOptions; + private _stream!: MessageStream; + private _subscription: Subscription; + + // We keep this separate from ackDeadline, because ackDeadline could + // end up being bound by min/max deadline configs. + private _99th: number; + + subscriptionProperties?: SubscriptionProperties; + + constructor(subscription: Subscription, options = {}) { + super(); + + this.ackDeadline = + defaultOptions.subscription.startingAckDeadline.totalOf('second'); + this._99th = this.ackDeadline; + this.maxMessages = defaultOptions.subscription.maxOutstandingMessages; + this.maxBytes = defaultOptions.subscription.maxOutstandingBytes; + this.maxExtensionTime = defaultOptions.subscription.maxExtensionTime; + this.useLegacyFlowControl = false; + this.isOpen = false; + this._histogram = new Histogram({min: 10, max: 600}); + this._latencies = new Histogram(); + this._subscription = subscription; + + this.setOptions(options); + } + + /** + * Update our ack extension time that will be used by the lease manager + * for sending modAcks. + * + * Should not be called from outside this class, except for unit tests. + * + * @param {number} [ackTimeSeconds] The number of seconds that the last + * ack took after the message was received. If this is undefined, then + * we won't update the histogram, but we will still recalculate the + * ackDeadline based on the situation. + * + * @private + */ + updateAckDeadline(ackTimeSeconds?: number) { + // Start with the value we already have. + let ackDeadline = this.ackDeadline; + + // If we got an ack time reading, update the histogram (and ackDeadline). + if (ackTimeSeconds) { + this._histogram.add(ackTimeSeconds); + this._99th = ackDeadline = this._histogram.percentile(99); + } + + // Grab our current min/max deadline values, based on whether exactly-once + // delivery is enabled, and the defaults. + const [minDeadline, maxDeadline] = this.getMinMaxDeadlines(); + + if (minDeadline) { + ackDeadline = Math.max(ackDeadline, minDeadline.totalOf('second')); + } + if (maxDeadline) { + ackDeadline = Math.min(ackDeadline, maxDeadline.totalOf('second')); + } + + // Set the bounded result back. + this.ackDeadline = ackDeadline; + } + + private getMinMaxDeadlines(): [Duration?, Duration?] { + // If this is an exactly-once delivery subscription, and the user + // didn't set their own minimum ack periods, set it to the default + // for exactly-once delivery. + const defaultMinDeadline = this.isExactlyOnceDelivery + ? minAckDeadlineForExactlyOnceDelivery + : defaultOptions.subscription.minAckDeadline; + const defaultMaxDeadline = defaultOptions.subscription.maxAckDeadline; + + // Pull in any user-set min/max. + const minDeadline = this._options.minAckDeadline ?? defaultMinDeadline; + const maxDeadline = this._options.maxAckDeadline ?? defaultMaxDeadline; + + return [minDeadline, maxDeadline]; + } + + /** + * Returns true if an exactly-once delivery subscription has been detected. + * + * @private + */ + get isExactlyOnceDelivery(): boolean { + if (!this.subscriptionProperties) { + return false; + } + + return !!this.subscriptionProperties.exactlyOnceDeliveryEnabled; + } + + /** + * Sets our subscription properties from incoming messages. + * + * @param {SubscriptionProperties} subscriptionProperties The new properties. + * @private + */ + setSubscriptionProperties(subscriptionProperties: SubscriptionProperties) { + const previouslyEnabled = this.isExactlyOnceDelivery; + + this.subscriptionProperties = subscriptionProperties; + + // Update ackDeadline in case the flag switched. + if (previouslyEnabled !== this.isExactlyOnceDelivery) { + this.updateAckDeadline(); + + // For exactly-once delivery, make sure the subscription ack deadline is 60. + // (Otherwise fall back to the default of 10 seconds.) + const subscriptionAckDeadlineSeconds = this.isExactlyOnceDelivery + ? 60 + : 10; + this._stream.setStreamAckDeadline( + Duration.from({seconds: subscriptionAckDeadlineSeconds}), + ); + } + } + + /** + * The 99th percentile of request latencies. + * + * @type {number} + * @private + */ + get modAckLatency() { + const latency = this._latencies.percentile(99); + let bufferTime = 0; + + if (this._modAcks) { + bufferTime = this._modAcks.maxMilliseconds; + } + + return latency * 1000 + bufferTime; + } + + /** + * The full name of the Subscription. + * + * @type {string} + * @private + */ + get name(): string { + if (!this._name) { + const {name, projectId} = this._subscription; + this._name = replaceProjectIdToken(name, projectId); + } + + return this._name; + } + + /** + * Acknowledges the supplied message. + * + * @param {Message} message The message to acknowledge. + * @returns {Promise} + * @private + */ + async ack(message: Message): Promise { + const ackTimeSeconds = (Date.now() - message.received) / 1000; + this.updateAckDeadline(ackTimeSeconds); + + logs.ackNack.info( + 'message (ID %s, ackID %s) ack', + message.id, + message.ackId, + ); + + if (ackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) ack took longer than the 99th percentile of message processing time (%s s)', + message.id, + message.ackId, + ackTimeSeconds, + ); + } + + tracing.PubsubEvents.ackStart(message); + + // Ignore this in this version of the method (but hook catch + // to avoid unhandled exceptions). + const resultPromise = this._acks.add(message); + resultPromise.catch(() => {}); + + await this._acks.onFlush(); + + tracing.PubsubEvents.ackEnd(message); + message.endParentSpan(); + + this._inventory.remove(message); + } + + /** + * Acknowledges the supplied message, expecting a response (for exactly + * once subscriptions). + * + * @param {Message} message The message to acknowledge. + * @returns {Promise} + * @private + */ + async ackWithResponse(message: Message): Promise { + const ackTimeSeconds = (Date.now() - message.received) / 1000; + this.updateAckDeadline(ackTimeSeconds); + + logs.ackNack.info( + 'message (ID %s, ackID %s) ack with response', + message.id, + message.ackId, + ); + + if (ackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) ack took longer than the 99th percentile (%s s)', + message.id, + message.ackId, + ackTimeSeconds, + ); + } + + tracing.PubsubEvents.ackStart(message); + + await this._acks.add(message); + + tracing.PubsubEvents.ackEnd(message); + message.endParentSpan(); + + this._inventory.remove(message); + + // No exception means Success. + return AckResponses.Success; + } + + async #awaitTimeoutAndCheck( + promise: Promise, + timeout: Duration, + ): Promise { + const result = await awaitWithTimeout(promise, timeout); + if (result.exception || result.timedOut) { + // Don't try to deal with errors at this point, just warn-log. + if (result.timedOut === false) { + // This wasn't a timeout. + logs.debug.warn( + 'Error during Subscriber.close(): %j', + result.exception, + ); + } + } + } + + /** + * Closes the subscriber, stopping the reception of new messages and shutting + * down the underlying stream. The behavior of the returned Promise will depend + * on the closeOptions in the subscriber options. + * + * @returns {Promise} A promise that resolves when the subscriber is closed + * and pending operations are flushed or the timeout is reached. + * + * @private + */ + async close(): Promise { + if (!this.isOpen) { + return; + } + + // Always close the stream right away so we don't receive more messages. + this.isOpen = false; + this._stream.destroy(); + + const options = this._options.closeOptions; + + // If no behavior is specified, default to Nack. This most closely matches + // the old behavior. + const behavior = + options?.behavior ?? SubscriberCloseBehaviors.NackImmediately; + + // The timeout can't realistically be longer than the longest time we're willing + // to lease messages. + let timeout = durationAtMost( + options?.timeout ?? this.maxExtensionTime, + this.maxExtensionTime, + ); + + // If the user specified a zero timeout, just bail immediately. + if (!timeout.milliseconds) { + this._inventory.clear(); + return; + } + + // Warn the user if the timeout is too short for NackImmediately. + if (Duration.compare(timeout, FINAL_NACK_TIMEOUT) < 0) { + logs.debug.warn( + 'Subscriber.close() timeout is less than the final shutdown time (%i ms). This may result in lost nacks.', + timeout.milliseconds, + ); + } + + // If we're in WaitForProcessing mode, then we first need to derive a NackImmediately + // timeout point. If everything finishes before then, we also want to go ahead and bail cleanly. + const shutdownStart = Date.now(); + if ( + behavior === SubscriberCloseBehaviors.WaitForProcessing && + !this._inventory.isEmpty() + ) { + const waitTimeout = timeout.subtract(FINAL_NACK_TIMEOUT); + + const emptyPromise = new Promise(r => { + this._inventory.on('empty', r); + }); + + await this.#awaitTimeoutAndCheck(emptyPromise, waitTimeout); + } + + // Now we head into immediate shutdown mode with what time is left. + timeout = timeout.subtract({ + milliseconds: Date.now() - shutdownStart, + }); + if (timeout.milliseconds <= 0) { + // This probably won't work out, but go through the motions. + timeout = Duration.from({milliseconds: 0}); + } + + // Grab everything left in inventory. This includes messages that have already + // been dispatched to user callbacks. + const remaining = this._inventory.clear(); + remaining.forEach(m => m.nack()); + + // Wait for user callbacks to complete. + const flushCompleted = this._waitForFlush(); + await this.#awaitTimeoutAndCheck(flushCompleted, timeout); + + // Clean up OTel spans for any remaining messages. + remaining.forEach(m => { + m.subSpans.shutdown(); + m.endParentSpan(); + }); + + this.emit('close'); + + this._acks.close(); + this._modAcks.close(); + } + + /** + * Gets the subscriber client instance. + * + * @returns {Promise} + * @private + */ + async getClient(): Promise { + const pubsub = this._subscription.pubsub; + const [client] = await promisify(pubsub.getClient_).call(pubsub, { + client: 'SubscriberClient', + }); + + return client; + } + + /** + * Modifies the acknowledge deadline for the provided message. + * + * @param {Message} message The message to modify. + * @param {number} deadline The deadline in seconds. + * @returns {Promise} + * @private + */ + async modAck(message: Message, deadline: number): Promise { + const startTime = Date.now(); + + const responsePromise = this._modAcks.add(message, deadline); + responsePromise.catch(() => {}); + + await this._modAcks.onFlush(); + + const latency = (Date.now() - startTime) / 1000; + this._latencies.add(latency); + } + + /** + * Modifies the acknowledge deadline for the provided message, expecting + * a reply (for exactly-once delivery subscriptions). + * + * @param {Message} message The message to modify. + * @param {number} deadline The deadline. + * @returns {Promise} + * @private + */ + async modAckWithResponse( + message: Message, + deadline: number, + ): Promise { + const startTime = Date.now(); + + await this._modAcks.add(message, deadline); + + const latency = (Date.now() - startTime) / 1000; + this._latencies.add(latency); + + // No exception means Success. + return AckResponses.Success; + } + + /** + * Modfies the acknowledge deadline for the provided message and then removes + * it from our inventory. + * + * @param {Message} message The message. + * @return {Promise} + * @private + */ + async nack(message: Message): Promise { + logs.ackNack.info( + 'message (ID %s, ackID %s) nack', + message.id, + message.ackId, + ); + + const nackTimeSeconds = (Date.now() - message.received) / 1000; + if (nackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) nack took longer than the 99th percentile (%s s)', + message.id, + message.ackId, + nackTimeSeconds, + ); + } + + message.subSpans.nackStart(); + await this.modAck(message, 0); + message.subSpans.nackEnd(); + message.endParentSpan(); + this._inventory.remove(message); + } + + /** + * Modfies the acknowledge deadline for the provided message and then removes + * it from our inventory, expecting a response from modAck (for + * exactly-once delivery subscriptions). + * + * @param {Message} message The message. + * @return {Promise} + * @private + */ + async nackWithResponse(message: Message): Promise { + logs.ackNack.info( + 'message (ID %s, ackID %s) nack with response', + message.id, + message.ackId, + ); + + const nackTimeSeconds = (Date.now() - message.received) / 1000; + if (nackTimeSeconds > this._99th) { + logs.slowAck.info( + 'message (ID %s, ackID %s) nack took longer than the 99th percentile (%s s)', + message.id, + message.ackId, + nackTimeSeconds, + ); + } + + message.subSpans.nackStart(); + const response = await this.modAckWithResponse(message, 0); + message.subSpans.nackEnd(); + message.endParentSpan(); + return response; + } + + /** + * Starts pulling messages. + * @private + */ + open(): void { + const {batching, flowControl, streamingOptions} = this._options; + + this._acks = new AckQueue(this, batching); + this._modAcks = new ModAckQueue(this, batching); + this._inventory = new LeaseManager(this, flowControl); + this._stream = new MessageStream(this, streamingOptions); + + this._stream + .on('error', err => this.emit('error', err)) + .on('debug', msg => this.emit('debug', msg)) + .on('data', (data: PullResponse) => this._onData(data)) + .once('close', () => this.close()); + + this._inventory + .on('full', () => this._stream.pause()) + .on('free', () => this._stream.resume()); + + this._stream.start().catch(err => { + this.emit('error', err); + void this.close(); + }); + + this.isOpen = true; + } + + /** + * Sets subscriber options. + * + * @param {SubscriberOptions} options The options. + * @private + */ + setOptions(options: SubscriberOptions): void { + this._options = options; + + this.useLegacyFlowControl = options.useLegacyFlowControl || false; + if (options.flowControl) { + this.maxMessages = + options.flowControl.maxMessages || + defaultOptions.subscription.maxOutstandingMessages; + this.maxBytes = + options.flowControl.maxBytes || + defaultOptions.subscription.maxOutstandingBytes; + + // In the event that the user has specified the maxMessages option, we + // want to make sure that the maxStreams option isn't higher. + // It doesn't really make sense to open 5 streams if the user only wants + // 1 message at a time. + if (!options.streamingOptions) { + options.streamingOptions = {} as MessageStreamOptions; + } + + const {maxStreams = defaultOptions.subscription.maxStreams} = + options.streamingOptions; + + options.streamingOptions.maxStreams = Math.min( + maxStreams, + this.maxMessages, + ); + } + + if (this._options.maxExtensionTime) { + this.maxExtensionTime = this._options.maxExtensionTime; + } + + if (this._inventory) { + this._inventory.setOptions(this._options.flowControl!); + } + + this.updateAckDeadline(); + } + + /** + * Retrieves our effective options. This is mostly for unit test use. + * + * @private + * @returns {SubscriberOptions} The options. + */ + getOptions(): SubscriberOptions { + return this._options; + } + + /** + * Constructs a telemetry span from the incoming message. + * + * @param {Message} message One of the received messages + * @private + */ + private createParentSpan(message: Message): void { + const enabled = tracing.isEnabled(); + if (enabled) { + tracing.extractSpan(message, this.name); + } + } + + /** + * Callback to be invoked when a new message is available. + * + * New messages will be added to the subscribers inventory, which in turn will + * automatically extend the messages ack deadline until either: + * a. the user acks/nacks it + * b. the maxExtension option is hit + * + * If the message puts us at/over capacity, then we'll pause our message + * stream until we've freed up some inventory space. + * + * New messages must immediately issue a ModifyAckDeadline request + * (aka receipt) to confirm with the backend that we did infact receive the + * message and its ok to start ticking down on the deadline. + * + * @private + */ + private _onData(response: PullResponse): void { + // Grab the subscription properties for exactly-once delivery and ordering flags. + if (response.subscriptionProperties) { + this.setSubscriptionProperties(response.subscriptionProperties); + } + + const {receivedMessages} = response; + for (const data of receivedMessages!) { + const message = new Message(this, data); + + this.createParentSpan(message); + + if (this.isOpen) { + if (this.isExactlyOnceDelivery) { + // For exactly-once delivery, we must validate that we got a valid + // lease on the message before actually leasing it. + message.subSpans.modAckStart( + Duration.from({seconds: this.ackDeadline}), + true, + ); + message + .modAckWithResponse(this.ackDeadline) + .then(() => { + this._inventory.add(message); + }) + .catch(() => { + // Temporary failures will retry, so if an error reaches us + // here, that means a permanent failure. Silently drop these. + this._discardMessage(message); + }) + .finally(() => { + message.subSpans.modAckEnd(); + }); + } else { + message.subSpans.modAckStart( + Duration.from({seconds: this.ackDeadline}), + true, + ); + message.modAck(this.ackDeadline); + message.subSpans.modAckEnd(); + this._inventory.add(message); + } + } else { + message.subSpans.shutdown(); + message.nack(); + } + } + } + + // Internal: This is here to provide a hook for unit testing, at least for now. + private _discardMessage(message: Message): void { + message; + } + + /** + * Returns a promise that will resolve once all pending requests have settled. + * + * @private + * + * @returns {Promise} + */ + private async _waitForFlush(): Promise { + const promises: Array> = []; + + // Flush any batched requests immediately. + if (this._acks.numPendingRequests) { + promises.push(this._acks.onFlush()); + this._acks.flush('message count').catch(() => {}); + } + + if (this._modAcks.numPendingRequests) { + promises.push(this._modAcks.onFlush()); + this._modAcks.flush('message count').catch(() => {}); + } + + // Now, prepare the drain promises. + if (this._acks.numInFlightRequests) { + promises.push(this._acks.onDrain()); + } + + if (this._modAcks.numInFlightRequests) { + promises.push(this._modAcks.onDrain()); + } + + // Wait for the flush promises. + await Promise.all(promises); + } +} diff --git a/handwritten/pubsub/src/subscription.ts b/handwritten/pubsub/src/subscription.ts new file mode 100644 index 00000000000..06e4ad602c8 --- /dev/null +++ b/handwritten/pubsub/src/subscription.ts @@ -0,0 +1,1239 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as extend from 'extend'; +import {CallOptions} from 'google-gax'; +import snakeCase = require('lodash.snakecase'); + +import {google} from '../protos/protos'; + +import {IAM} from './iam'; +import {FlowControlOptions} from './lease-manager'; +import { + DetachedCallback, + DetachedResponse, + EmptyCallback, + EmptyResponse, + ExistsCallback, + ExistsResponse, + Omit, + PubSub, + RequestCallback, + ResourceCallback, +} from './pubsub'; +import { + CreateSnapshotCallback, + CreateSnapshotResponse, + SeekCallback, + SeekResponse, + Snapshot, +} from './snapshot'; +import { + Message, + Subscriber, + SubscriberOptions, + SubscriberCloseOptions, + SubscriberCloseBehaviors, +} from './subscriber'; +import {Topic} from './topic'; +import {promisifySome} from './util'; +import {StatusError} from './message-stream'; +import {DebugMessage} from './debug'; +import {EventEmitter} from 'stream'; + +export {AckError, AckResponse, AckResponses} from './subscriber'; + +export type PushConfig = google.pubsub.v1.IPushConfig; +export type OidcToken = google.pubsub.v1.PushConfig.IOidcToken; + +export type SubscriptionMetadata = { + messageRetentionDuration?: google.protobuf.IDuration | number; + pushEndpoint?: string; + oidcToken?: OidcToken; +} & Omit; + +export type SubscriptionOptions = SubscriberOptions & {topic?: Topic}; +export type SubscriptionCloseCallback = (err?: Error) => void; +export type SubscriptionCloseOptions = SubscriberCloseOptions; +export const SubscriptionCloseBehaviors = SubscriberCloseBehaviors; + +type SubscriptionCallback = ResourceCallback< + Subscription, + google.pubsub.v1.ISubscription +>; +type SubscriptionResponse = [Subscription, google.pubsub.v1.ISubscription]; + +export type CreateSubscriptionOptions = SubscriptionMetadata & { + gaxOpts?: CallOptions; + flowControl?: FlowControlOptions; +}; + +export type CreateSubscriptionCallback = SubscriptionCallback; +export type CreateSubscriptionResponse = SubscriptionResponse; + +export type GetSubscriptionOptions = CallOptions & {autoCreate?: boolean}; +export type GetSubscriptionCallback = SubscriptionCallback; +export type GetSubscriptionResponse = SubscriptionResponse; + +type MetadataCallback = RequestCallback; +type MetadataResponse = [google.pubsub.v1.ISubscription]; + +export type GetSubscriptionMetadataCallback = MetadataCallback; +export type GetSubscriptionMetadataResponse = MetadataResponse; + +export type SetSubscriptionMetadataCallback = MetadataCallback; +export type SetSubscriptionMetadataResponse = MetadataResponse; + +export type DetachSubscriptionCallback = EmptyCallback; +export type DetachSubscriptionResponse = EmptyResponse; + +// JSDoc won't see these, so this is just to let you get typings +// in your editor of choice. +export declare interface Subscription { + on(event: 'message', listener: (message: Message) => void): this; + on(event: 'error', listener: (error: StatusError) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'debug', listener: (msg: DebugMessage) => void): this; + + // Only used internally. + on( + event: 'newListener', + listener: (event: string | symbol, listener: Function) => void, + ): this; + on( + event: 'removeListener', + listener: (event: string | symbol, listener: Function) => void, + ): this; + + // Catch-all. If you get an error about this line, it means you're + // using an unsupported event type or listener type. + on(event: string, listener: void): this; +} + +/** + * @typedef {object} ExpirationPolicy + * A policy that specifies the conditions for this subscription's expiration. A + * subscription is considered active as long as any connected subscriber is + * successfully consuming messages from the subscription or is issuing + * operations on the subscription. If expirationPolicy is not set, a default + * policy with ttl of 31 days will be used. The minimum allowed value for + * expirationPolicy.ttl is 1 day. + * @property {google.protobuf.Duration} ttl Specifies the "time-to-live" + * duration for an associated resource. The resource expires if it is not + * active for a period of `ttl`. The definition of "activity" depends on the + * type of the associated resource. The minimum and maximum allowed values + * for `ttl` depend on the type of the associated resource, as well. If + * `ttl` is not set, the associated resource never expires. + */ +/** + * A Subscription object will give you access to your Cloud Pub/Sub + * subscription. + * + * Subscriptions are sometimes retrieved when using various methods: + * + * - {@link PubSub#getSubscriptions} + * - {@link Topic#getSubscriptions} + * + * Subscription objects may be created directly with: + * + * - {@link PubSub#createSubscription} + * - {@link Topic#createSubscription} + * + * All Subscription objects are instances of an + * [EventEmitter](http://nodejs.org/api/events.html). The subscription will pull + * for messages automatically as long as there is at least one listener assigned + * for the `message` event. Available events: + * + * Upon receipt of a message: + * on(event: 'message', listener: (message: {@link Message}) => void): this; + * + * Upon receipt of an error: + * on(event: 'error', listener: (error: Error) => void): this; + * + * Upon receipt of a (non-fatal) debug warning: + * on(event: 'debug', listener: (msg: DebugMessage) => void): this; + * + * Upon the closing of the subscriber: + * on(event: 'close', listener: Function): this; + * + * By default Subscription objects allow you to process 1000 messages at the same + * time. You can fine tune this value by adjusting the + * `options.flowControl.maxMessages` option. + * + * If your subscription is seeing more re-deliveries than preferable, you might + * try increasing your `options.ackDeadline` value or decreasing the + * `options.streamingOptions.maxStreams` value. + * + * Subscription objects handle ack management, by automatically extending the + * ack deadline while the message is being processed, to then issue the ack or + * nack of such message when the processing is done. **Note:** message + * redelivery is still possible. + * + * By default each {@link PubSub} instance can handle 100 open streams, with + * default options this translates to less than 20 Subscriptions per PubSub + * instance. If you wish to create more Subscriptions than that, you can either + * create multiple PubSub instances or lower the + * `options.streamingOptions.maxStreams` value on each Subscription object. + * + * @class + * + * @param {PubSub} pubsub PubSub object. + * @param {string} name The name of the subscription. + * @param {SubscriberOptions} [options] Options for handling messages. + * + * @example From {@link PubSub#getSubscriptions} + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * pubsub.getSubscriptions((err, subscriptions) => { + * // `subscriptions` is an array of Subscription objects. + * }); + * + * ``` + * @example From {@link Topic#getSubscriptions} + * ``` + * const topic = pubsub.topic('my-topic'); + * topic.getSubscriptions((err, subscriptions) => { + * // `subscriptions` is an array of Subscription objects. + * }); + * + * ``` + * @example {@link Topic#createSubscription} + * ``` + * const topic = pubsub.topic('my-topic'); + * topic.createSubscription('new-subscription', (err, subscription) => { + * // `subscription` is a Subscription object. + * }); + * + * ``` + * @example {@link Topic#subscription} + * ``` + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * // `subscription` is a Subscription object. + * + * ``` + * @example Once you have obtained a subscription object, you may begin to register listeners. This will automatically trigger pulling for messages. + * ``` + * // Register an error handler. + * subscription.on('error', (err) => {}); + * + * // Register a debug handler, to catch non-fatal errors and other messages. + * subscription.on('debug', msg => { console.log(msg.message); }); + * + * // Register a close handler in case the subscriber closes unexpectedly + * subscription.on('close', () => {}); + * + * // Register a listener for `message` events. + * function onMessage(message) { + * // Called every time a message is received. + * + * // message.id = ID of the message. + * // message.ackId = ID used to acknowledge the message receival. + * // message.data = Contents of the message. + * // message.attributes = Attributes of the message. + * // message.publishTime = Date when Pub/Sub received the message. + * + * // Ack the message: + * // message.ack(); + * + * // This doesn't ack the message, but allows more messages to be retrieved + * // if your limit was hit or if you don't want to ack the message. + * // message.nack(); + * } + * subscription.on('message', onMessage); + * + * // Remove the listener from receiving `message` events. + * subscription.removeListener('message', onMessage); + * + * ``` + * @example To apply a fine level of flow control, consider the following configuration + * ``` + * const subscription = topic.subscription('my-sub', { + * flowControl: { + * maxMessages: 1, + * // this tells the client to manage and lock any excess messages + * allowExcessMessages: false + * } + * }); + * ``` + */ +export class Subscription extends EventEmitter { + // Note: WrappingEmitter is used here to wrap user processing callbacks. + // We do this to be able to build telemetry spans around them. + pubsub: PubSub; + iam: IAM; + topic?: Topic | string; + metadata?: google.pubsub.v1.ISubscription; + request: typeof PubSub.prototype.request; + + private _subscriber: Subscriber; + + constructor(pubsub: PubSub, name: string, options?: SubscriptionOptions) { + super(); + + options = options || {}; + + this.pubsub = pubsub; + this.request = pubsub.request.bind(pubsub); + this.id_ = name; + this.topic = options.topic; + + /** + * [IAM (Identity and Access + * Management)](https://cloud.google.com/pubsub/access_control) allows you + * to set permissions on individual resources and offers a wider range of + * roles: editor, owner, publisher, subscriber, and viewer. This gives you + * greater flexibility and allows you to set more fine-grained access + * control. + * + * *The IAM access control features described in this document are Beta, + * including the API methods to get and set IAM policies, and to test IAM + * permissions. Cloud Pub/Sub's use of IAM features is not covered by + * any SLA or deprecation policy, and may be subject to + * backward-incompatible changes.* + * + * @name Subscription#iam + * @mixes IAM + * + * @see [Access Control Overview]{@link https://cloud.google.com/pubsub/access_control} + * @see [What is Cloud IAM?]{@link https://cloud.google.com/iam/} + * + * @example + * ``` + * //- + * // Get the IAM policy for your subscription. + * //- + * subscription.iam.getPolicy((err, policy) => { + * console.log(policy); + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.iam.getPolicy().then((data) => { + * const policy = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + this.iam = new IAM(pubsub, this); + + this._subscriber = new Subscriber(this, options); + this._subscriber + .on('error', err => this.emit('error', err)) + .on('debug', msg => this.emit('debug', msg)) + .on('message', message => this.emit('message', message)) + .on('close', () => this.emit('close')); + + this._listen(); + } + + private id_: string; + get name(): string { + return Subscription.formatName_(this.pubsub.projectId, this.id_); + } + + /** + * Indicates if the Subscription is open and receiving messages. + * + * @type {boolean} + */ + get isOpen(): boolean { + return !!(this._subscriber && this._subscriber.isOpen); + } + + /** + * @type {string} + */ + get projectId(): string { + return (this.pubsub && this.pubsub.projectId) || '{{projectId}}'; + } + + /** + * Closes the Subscription. Once this is called you will no longer receive + * message events unless you call {Subscription#open} or add new message + * listeners. + * + * @param {function} [callback] The callback function, if not using the Promise-based + * call signature. + * @param {?error} [callback.err] An error returned while closing the Subscription. + * + * @example + * ``` + * await subscription.close(); + * ``` + */ + close(): Promise; + close(callback: SubscriptionCloseCallback): void; + close(callback?: SubscriptionCloseCallback): void | Promise { + this._subscriber.close().then(() => callback!(), callback); + } + + /** + * Create a subscription. + * + * @see [Subscriptions: create API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create} + * + * @throws {Error} If subscription name is omitted. + * + * @param {string} name The name of the subscription. + * @param {CreateSubscriptionRequest} [options] See a + * [Subscription + * resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions). + * @param {CreateSubscriptionCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('newMessages'); + * const callback = function(err, subscription, apiResponse) {}; + * + * subscription.create(callback); + * + * ``` + * @example With options + * ``` + * subscription.create({ + * ackDeadlineSeconds: 90 + * }, callback); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * const [sub, apiResponse] = await subscription.create(); + * ``` + */ + create( + options?: CreateSubscriptionOptions, + ): Promise; + create(callback: CreateSubscriptionCallback): void; + create( + options: CreateSubscriptionOptions, + callback: CreateSubscriptionCallback, + ): void; + create( + optsOrCallback?: CreateSubscriptionOptions | CreateSubscriptionCallback, + callback?: CreateSubscriptionCallback, + ): void | Promise { + if (!this.topic) { + throw new Error( + 'Subscriptions can only be created when accessed through Topics', + ); + } + + const name = this.name.split('/').pop(); + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + this.pubsub.createSubscription( + this.topic, + name!, + options, + (err, sub, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + Object.assign(this, sub); + callback!(null, this, resp); + }, + ); + } + + /** + * @typedef {array} CreateSnapshotResponse + * @property {Snapshot} 0 The new {@link Snapshot}. + * @property {object} 1 The full API response. + */ + /** + * @callback CreateSnapshotCallback + * @param {?Error} err Request error, if any. + * @param {Snapshot} snapshot The new {@link Snapshot}. + * @param {object} apiResponse The full API response. + */ + /** + * Create a snapshot with the given name. + * + * @param {string} name Name of the snapshot. + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {CreateSnapshotCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * const callback = (err, snapshot, apiResponse) => { + * if (!err) { + * // The snapshot was created successfully. + * } + * }; + * + * subscription.createSnapshot('my-snapshot', callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.createSnapshot('my-snapshot').then((data) => { + * const snapshot = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + createSnapshot( + name: string, + gaxOpts?: CallOptions, + ): Promise; + createSnapshot(name: string, callback: CreateSnapshotCallback): void; + createSnapshot( + name: string, + gaxOpts: CallOptions, + callback: CreateSnapshotCallback, + ): void; + createSnapshot( + name: string, + optsOrCallback?: CallOptions | CreateSnapshotCallback, + callback?: CreateSnapshotCallback, + ): void | Promise { + if (typeof name !== 'string') { + throw new Error('A name is required to create a snapshot.'); + } + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const snapshot = this.snapshot(name); + const reqOpts = { + name: snapshot.name, + subscription: this.name, + }; + this.request( + { + client: 'SubscriberClient', + method: 'createSnapshot', + reqOpts, + gaxOpts, + }, + (err, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + snapshot.metadata = resp!; + callback!(null, snapshot, resp!); + }, + ); + } + + /** + * Delete the subscription. Pull requests from the current subscription will + * be errored once unsubscription is complete. + * + * @see [Subscriptions: delete API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/delete} + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse Raw API response. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * subscription.delete((err, apiResponse) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.delete().then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + delete(gaxOpts?: CallOptions): Promise; + delete(callback: EmptyCallback): void; + delete(gaxOpts: CallOptions, callback: EmptyCallback): void; + delete( + optsOrCallback?: CallOptions | EmptyCallback, + callback?: EmptyCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + subscription: this.name, + }; + + if (this.isOpen) { + void this._subscriber.close(); + } + + this.request( + { + client: 'SubscriberClient', + method: 'deleteSubscription', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + + /** + * @typedef {array} SubscriptionDetachedResponse + * @property {boolean} 0 Whether the subscription is detached. + */ + /** + * @callback SubscriptionDetachedCallback + * @param {?Error} err Request error, if any. + * @param {boolean} exists Whether the subscription is detached. + */ + /** + * Check if a subscription is detached. + * + * @param {SubscriptionDetachedCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * subscription.detached((err, exists) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.detached().then((data) => { + * const detached = data[0]; + * }); + * ``` + */ + detached(): Promise; + detached(callback: DetachedCallback): void; + detached(callback?: DetachedCallback): void | Promise { + this.getMetadata((err, metadata) => { + if (err) { + callback!(err); + } else { + callback!(null, metadata!.detached); + } + }); + } + + /** + * @typedef {array} SubscriptionExistsResponse + * @property {boolean} 0 Whether the subscription exists + */ + /** + * @callback SubscriptionExistsCallback + * @param {?Error} err Request error, if any. + * @param {boolean} exists Whether the subscription exists. + */ + /** + * Check if a subscription exists. + * + * @param {SubscriptionExistsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * subscription.exists((err, exists) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.exists().then((data) => { + * const exists = data[0]; + * }); + * ``` + */ + exists(): Promise; + exists(callback: ExistsCallback): void; + exists(callback?: ExistsCallback): void | Promise { + this.getMetadata(err => { + if (!err) { + callback!(null, true); + return; + } + + if (err.code === 5) { + callback!(null, false); + return; + } + callback!(err); + }); + } + + /** + * @typedef {array} GetSubscriptionResponse + * @property {Subscription} 0 The {@link Subscription}. + * @property {object} 1 The full API response. + */ + /** + * @callback GetSubscriptionCallback + * @param {?Error} err Request error, if any. + * @param {Subscription} subscription The {@link Subscription}. + * @param {object} apiResponse The full API response. + */ + /** + * Get a subscription if it exists. + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {boolean} [gaxOpts.autoCreate=false] Automatically create the + * subscription if it does not already exist. + * @param {GetSubscriptionCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * subscription.get((err, subscription, apiResponse) => { + * // The `subscription` data has been populated. + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.get().then((data) => { + * const subscription = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + get(gaxOpts?: GetSubscriptionOptions): Promise; + get(callback: GetSubscriptionCallback): void; + get(gaxOpts: GetSubscriptionOptions, callback: GetSubscriptionCallback): void; + get( + optsOrCallback?: GetSubscriptionOptions | GetSubscriptionCallback, + callback?: GetSubscriptionCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const autoCreate = !!gaxOpts.autoCreate && this.topic; + delete gaxOpts.autoCreate; + + this.getMetadata(gaxOpts, (err, apiResponse) => { + if (!err) { + callback!(null, this, apiResponse!); + return; + } + + if (err.code !== 5 || !autoCreate) { + callback!(err, null, apiResponse); + return; + } + + this.create({gaxOpts}, callback!); + }); + } + + /** + * @typedef {array} GetSubscriptionMetadataResponse + * @property {object} 0 The full API response. + */ + /** + * @callback GetSubscriptionMetadataCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ + /** + * Fetches the subscriptions metadata. + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {GetSubscriptionMetadataCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * subscription.getMetadata((err, apiResponse) => { + * if (err) { + * // Error handling omitted. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.getMetadata().then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + getMetadata(gaxOpts?: CallOptions): Promise; + getMetadata(callback: GetSubscriptionMetadataCallback): void; + getMetadata( + gaxOpts: CallOptions, + callback: GetSubscriptionMetadataCallback, + ): void; + getMetadata( + optsOrCallback?: CallOptions | GetSubscriptionMetadataCallback, + callback?: GetSubscriptionMetadataCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + subscription: this.name, + }; + + this.request( + { + client: 'SubscriberClient', + method: 'getSubscription', + reqOpts, + gaxOpts, + }, + (err, apiResponse) => { + if (!err) { + this.metadata = apiResponse!; + } + callback!(err!, apiResponse!); + }, + ); + } + + /** + * @typedef {array} ModifyPushConfigResponse + * @property {object} 0 The full API response. + */ + /** + * @callback ModifyPushConfigCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ + /** + * Modify the push config for the subscription. + * + * @param {object} config The push config. + * @param {string} config.pushEndpoint A URL locating the endpoint to which + * messages should be published. + * @param {object} config.attributes [PushConfig attributes](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#google.pubsub.v1.PushConfig). + * @param {object} config.oidcToken If specified, Pub/Sub will generate and + * attach an OIDC JWT token as an `Authorization` header in the HTTP + * request for every pushed message. This object should have the same + * structure as [OidcToken]{@link google.pubsub.v1.OidcToken} + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {ModifyPushConfigCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * const pushConfig = { + * pushEndpoint: 'https://mydomain.com/push', + * attributes: { + * key: 'value' + * }, + * oidcToken: { + * serviceAccountEmail: 'myproject@appspot.gserviceaccount.com', + * audience: 'myaudience' + * } + * }; + * + * subscription.modifyPushConfig(pushConfig, (err, apiResponse) => { + * if (err) { + * // Error handling omitted. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.modifyPushConfig(pushConfig).then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + modifyPushConfig( + config: PushConfig, + gaxOpts?: CallOptions, + ): Promise; + modifyPushConfig(config: PushConfig, callback: EmptyCallback): void; + modifyPushConfig( + config: PushConfig, + gaxOpts: CallOptions, + callback: EmptyCallback, + ): void; + modifyPushConfig( + config: PushConfig, + optsOrCallback?: CallOptions | EmptyCallback, + callback?: EmptyCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + subscription: this.name, + pushConfig: config, + }; + + this.request( + { + client: 'SubscriberClient', + method: 'modifyPushConfig', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + + /** + * Opens the Subscription to receive messages. In general this method + * shouldn't need to be called, unless you wish to receive messages after + * calling {@link Subscription#close}. Alternatively one could just assign a + * new `message` event listener which will also re-open the Subscription. + * + * @example + * ``` + * subscription.on('message', message => message.ack()); + * + * // Close the subscription. + * subscription.close(err => { + * if (err) { + * // Error handling omitted. + * } + * + * The subscription has been closed and messages will no longer be received. + * }); + * + * // Resume receiving messages. + * subscription.open(); + * ``` + */ + open() { + if (!this._subscriber.isOpen) { + this._subscriber.open(); + } + } + + /** + * @typedef {array} SeekResponse + * @property {object} 0 The full API response. + */ + /** + * @callback SeekCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ + /** + * Seeks an existing subscription to a point in time or a given snapshot. + * + * @param {string|date} snapshot The point to seek to. This will accept the + * name of the snapshot or a Date object. + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {SeekCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const callback = (err, resp) => { + * if (!err) { + * // Seek was successful. + * } + * }; + * + * subscription.seek('my-snapshot', callback); + * + * //- + * // Alternatively, to specify a certain point in time, you can provide a + * Date + * // object. + * //- + * const date = new Date('October 21 2015'); + * + * subscription.seek(date, callback); + * ``` + */ + seek(snapshot: string | Date, gaxOpts?: CallOptions): Promise; + seek(snapshot: string | Date, callback: SeekCallback): void; + seek( + snapshot: string | Date, + gaxOpts: CallOptions, + callback: SeekCallback, + ): void; + seek( + snapshot: string | Date, + optsOrCallback?: CallOptions | SeekCallback, + callback?: SeekCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts: google.pubsub.v1.ISeekRequest = { + subscription: this.name, + }; + + if (typeof snapshot === 'string') { + reqOpts.snapshot = Snapshot.formatName_(this.pubsub.projectId, snapshot); + } else if (Object.prototype.toString.call(snapshot) === '[object Date]') { + const dateMillis = (snapshot as Date).getTime(); + reqOpts.time = { + seconds: Math.floor(dateMillis / 1000), + nanos: Math.floor(dateMillis % 1000) * 1000, + }; + } else { + throw new Error('Either a snapshot name or Date is needed to seek to.'); + } + + this.request( + { + client: 'SubscriberClient', + method: 'seek', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + + /** + * @typedef {array} SetSubscriptionMetadataResponse + * @property {object} 0 The full API response. + */ + /** + * @callback SetSubscriptionMetadataCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ + /** + * Update the subscription object. + * + * @param {object} metadata The subscription metadata. + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {SetSubscriptionMetadataCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const metadata = { + * key: 'value' + * }; + * + * subscription.setMetadata(metadata, (err, apiResponse) => { + * if (err) { + * // Error handling omitted. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * subscription.setMetadata(metadata).then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + setMetadata( + metadata: SubscriptionMetadata, + gaxOpts?: CallOptions, + ): Promise; + setMetadata( + metadata: SubscriptionMetadata, + callback: SetSubscriptionMetadataCallback, + ): void; + setMetadata( + metadata: SubscriptionMetadata, + gaxOpts: CallOptions, + callback: SetSubscriptionMetadataCallback, + ): void; + setMetadata( + metadata: SubscriptionMetadata, + optsOrCallback?: CallOptions | SetSubscriptionMetadataCallback, + callback?: SetSubscriptionMetadataCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const subscription = Subscription.formatMetadata_(metadata); + const fields = Object.keys(subscription).map(snakeCase); + subscription.name = this.name; + const reqOpts = { + subscription, + updateMask: { + paths: fields, + }, + }; + this.request( + { + client: 'SubscriberClient', + method: 'updateSubscription', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + /** + * Sets the Subscription options. + * + * @param {SubscriberOptions} options The options. + */ + setOptions(options: SubscriberOptions): void { + this._subscriber.setOptions(options); + } + /** + * Create a Snapshot object. See {@link Subscription#createSnapshot} to + * create a snapshot. + * + * @throws {Error} If a name is not provided. + * + * @param {string} name The name of the snapshot. + * @returns {Snapshot} + * + * @example + * ``` + * const snapshot = subscription.snapshot('my-snapshot'); + * ``` + */ + snapshot(name: string): Snapshot { + return this.pubsub.snapshot.call(this, name); + } + /** + * Watches for incoming message event handlers and open/closes the + * subscriber as needed. + * + * @private + */ + private _listen(): void { + this.on('newListener', event => { + if (!this.isOpen && event === 'message') { + this._subscriber.open(); + } + }); + + this.on('removeListener', () => { + if (this.isOpen && this.listenerCount('message') === 0) { + void this._subscriber.close(); + } + }); + } + /*! + * Formats Subscription metadata. + * + * @private + */ + static formatMetadata_( + metadata: SubscriptionMetadata, + ): google.pubsub.v1.ISubscription { + const formatted = extend(true, {}, metadata); + + if (typeof metadata.messageRetentionDuration === 'number') { + (formatted as google.pubsub.v1.ISubscription).messageRetentionDuration = { + seconds: metadata.messageRetentionDuration, + nanos: 0, + }; + } + + if (metadata.pushEndpoint) { + formatted.pushConfig = { + pushEndpoint: metadata.pushEndpoint, + }; + delete formatted.pushEndpoint; + } + + if (metadata.oidcToken) { + formatted.pushConfig = { + ...formatted.pushConfig, + oidcToken: metadata.oidcToken, + }; + delete formatted.oidcToken; + } + + return formatted as google.pubsub.v1.ISubscription; + } + + /*! + * Format the name of a subscription. A subscription's full name is in the + * format of projects/{projectId}/subscriptions/{subName}. + * + * @private + */ + static formatName_(projectId: string, name: string) { + // Simple check if the name is already formatted. + if (name.indexOf('/') > -1) { + return name; + } + return 'projects/' + projectId + '/subscriptions/' + name; + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifySome(Subscription, Subscription.prototype, [ + 'close', + 'create', + 'createSnapshot', + 'delete', + 'detached', + 'exists', + 'get', + 'getMetadata', + 'modifyPushConfig', + 'seek', + 'setMetadata', +]); diff --git a/handwritten/pubsub/src/telemetry-tracing.ts b/handwritten/pubsub/src/telemetry-tracing.ts new file mode 100644 index 00000000000..54a516d1b6b --- /dev/null +++ b/handwritten/pubsub/src/telemetry-tracing.ts @@ -0,0 +1,841 @@ +/*! + * Copyright 2020-2024 Google LLC + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { + Tracer, + SpanContext, + Span, + context, + trace, + SpanKind, + TextMapGetter, + TextMapSetter, + ROOT_CONTEXT, + Context, + Link, +} from '@opentelemetry/api'; +import {W3CTraceContextPropagator} from '@opentelemetry/core'; +import {Attributes, PubsubMessage} from './publisher/pubsub-message'; +import {Duration} from './temporal'; + +export {Span}; + +// We need this to get the library version. +// eslint-disable-next-line @typescript-eslint/no-var-requires +const packageJson = require('../../package.json'); + +/** + * Instantiates a Opentelemetry tracer for the library + * + * @private + * @internal + */ +let cachedTracer: Tracer | undefined; +function getTracer(): Tracer { + const tracer = + cachedTracer ?? + trace.getTracer('@google-cloud/pubsub', packageJson.version); + cachedTracer = tracer; + return cachedTracer; +} + +/** + * Determination of the level of OTel support we're providing. + * + * @private + * @internal + */ +export enum OpenTelemetryLevel { + /** + * None: OTel support is not enabled because we found no trace provider, or + * the user has not enabled it. + */ + None = 0, + + /** + * Modern: We will only inject/extract the modern propagation attribute. + */ + Modern = 2, +} + +/** + * The W3C trace context propagator, used for injecting/extracting trace context. + * + * @private + * @internal + */ +const w3cTraceContextPropagator = new W3CTraceContextPropagator(); + +// True if user code elsewhere wants to enable OpenTelemetry support. +let globallyEnabled = false; + +/** + * Manually set the OpenTelemetry enabledness. + * + * @param enabled The enabled flag to use, to override any automated methods. + * @private + * @internal + */ +export function setGloballyEnabled(enabled: boolean) { + globallyEnabled = enabled; +} + +/** + * Tries to divine what sort of OpenTelemetry we're supporting. See the enum + * for the meaning of the values, and other notes. + * + * @private + * @internal + */ +export function isEnabled(): OpenTelemetryLevel { + return globallyEnabled ? OpenTelemetryLevel.Modern : OpenTelemetryLevel.None; +} + +/** + * Our Carrier object for propagation is anything with an 'attributes' + * object, which is one of several possible Message classes. (They're + * different for publish and subscribe.) + * + * Also we add a parentSpan optional member for passing around the + * actual Span object within the client library. This can be a publish + * or subscriber span, depending on the context. + * + * @private + */ +export interface MessageWithAttributes { + attributes?: Attributes | null | undefined; + parentSpan?: Span; +} + +/** + * Implements common members for the TextMap getter and setter interfaces for Pub/Sub messages. + * + * @private + * @internal + */ +export class PubsubMessageGetSet { + static keyPrefix = 'googclient_'; + + keys(carrier: MessageWithAttributes): string[] { + return Object.getOwnPropertyNames(carrier.attributes) + .filter(n => n.startsWith(PubsubMessageGetSet.keyPrefix)) + .map(n => n.substring(PubsubMessageGetSet.keyPrefix.length)); + } + + protected attributeName(key: string): string { + return `${PubsubMessageGetSet.keyPrefix}${key}`; + } +} + +/** + * Implements the TextMap getter interface for Pub/Sub messages. + * + * @private + * @internal + */ +export class PubsubMessageGet + extends PubsubMessageGetSet + implements TextMapGetter +{ + get( + carrier: MessageWithAttributes, + key: string, + ): string | string[] | undefined { + return carrier?.attributes?.[this.attributeName(key)]; + } +} + +/** + * Implements the TextMap setter interface for Pub/Sub messages. + * + * @private + * @internal + */ +export class PubsubMessageSet + extends PubsubMessageGetSet + implements TextMapSetter +{ + set(carrier: MessageWithAttributes, key: string, value: string): void { + if (!carrier.attributes) { + carrier.attributes = {}; + } + carrier.attributes[this.attributeName(key)] = value; + } +} + +/** + * The getter to use when calling extract() on a Pub/Sub message. + * + * @private + * @internal + */ +export const pubsubGetter = new PubsubMessageGet(); + +/** + * The setter to use when calling inject() on a Pub/Sub message. + * + * @private + * @internal + */ +export const pubsubSetter = new PubsubMessageSet(); + +/** + * Description of the data structure passed for span attributes. + * + * @private + * @internal + */ +export interface SpanAttributes { + [x: string]: string | number | boolean; +} + +/** + * Converts a SpanContext to a full Context, as needed. + * + * @private + * @internal + */ +export function spanContextToContext( + parent?: SpanContext, +): Context | undefined { + return parent ? trace.setSpanContext(context.active(), parent) : undefined; +} + +/** + * The modern propagation attribute name. + * + * Technically this is determined by the OpenTelemetry library, but + * in practice, it follows the W3C spec, so this should be the right + * one. The only thing we're using it for, anyway, is emptying user + * supplied attributes. + * + * @private + * @internal + */ +export const modernAttributeName = 'googclient_traceparent'; + +export interface AttributeParams { + // Fully qualified. + topicName?: string; + subName?: string; + + // These are generally split from the fully qualified names. + projectId?: string; + topicId?: string; + subId?: string; +} + +/** + * Break down the subscription's full name into its project and ID. + * + * @private + * @internal + */ +export function getSubscriptionInfo(fullName: string): AttributeParams { + const results = fullName.match(/projects\/([^/]+)\/subscriptions\/(.+)/); + if (!results?.[0]) { + return { + subName: fullName, + }; + } + + return { + subName: fullName, + projectId: results[1], + subId: results[2], + }; +} + +/** + * Break down the subscription's full name into its project and ID. + * + * @private + * @internal + */ +export function getTopicInfo(fullName: string): AttributeParams { + const results = fullName.match(/projects\/([^/]+)\/topics\/(.+)/); + if (!results?.[0]) { + return { + topicName: fullName, + }; + } + + return { + topicName: fullName, + projectId: results[1], + topicId: results[2], + }; +} + +// Determines if a trace is to be sampled. There doesn't appear to be a sanctioned +// way to do this currently (isRecording does something different). +// +// Based on this: https://github.com/open-telemetry/opentelemetry-js/issues/4193 +function isSampled(span: Span) { + const FLAG_MASK_SAMPLED = 0x1; + const spanContext = span.spanContext(); + const traceFlags = spanContext?.traceFlags; + const sampled = !!( + traceFlags && (traceFlags & FLAG_MASK_SAMPLED) === FLAG_MASK_SAMPLED + ); + + return sampled; +} + +/** + * Contains utility methods for creating spans. + * + * @private + * @internal + */ +export class PubsubSpans { + static createAttributes( + params: AttributeParams, + message?: PubsubMessage, + caller?: string, + operation?: string, + ): SpanAttributes { + const destinationName = params.topicName ?? params.subName; + const destinationId = params.topicId ?? params.subId; + const projectId = params.projectId; + + // Purposefully leaving this debug check here as a comment - this should + // always be true, but we don't want to fail in prod if it's not. + /*if ( + (params.topicName && params.subName) || + (!destinationName && !projectId && !destinationId) + ) { + throw new Error( + 'One of topicName or subName must be specified, and must be fully qualified' + ); + }*/ + + const spanAttributes = { + // Add Opentelemetry semantic convention attributes to the span, based on: + // https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/messaging/messaging-spans.md + ['messaging.system']: 'gcp_pubsub', + ['messaging.destination.name']: destinationId ?? destinationName, + ['gcp.project_id']: projectId, + ['code.function']: caller ?? 'unknown', + } as SpanAttributes; + + if (message) { + if (message.calculatedSize) { + spanAttributes['messaging.message.envelope.size'] = + message.calculatedSize; + } else { + if (message.data?.length) { + spanAttributes['messaging.message.envelope.size'] = + message.data?.length; + } + } + if (message.orderingKey) { + spanAttributes['messaging.gcp_pubsub.message.ordering_key'] = + message.orderingKey; + } + if (message.isExactlyOnceDelivery) { + spanAttributes['messaging.gcp_pubsub.message.exactly_once_delivery'] = + message.isExactlyOnceDelivery; + } + if (message.ackId) { + spanAttributes['messaging.gcp_pubsub.message.ack_id'] = message.ackId; + } + if (operation) { + spanAttributes['messaging.operation'] = operation; + } + } + + return spanAttributes; + } + + static createPublisherSpan( + message: PubsubMessage, + topicName: string, + caller: string, + ): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + const topicInfo = getTopicInfo(topicName); + const span: Span = getTracer().startSpan(`${topicName} create`, { + kind: SpanKind.PRODUCER, + attributes: PubsubSpans.createAttributes( + topicInfo, + message, + caller, + 'create', + ), + }); + if (topicInfo.topicId) { + span.updateName(`${topicInfo.topicId} create`); + span.setAttribute('messaging.destination.name', topicInfo.topicId); + } + + return span; + } + + static updatePublisherTopicName(span: Span, topicName: string) { + const topicInfo = getTopicInfo(topicName); + if (topicInfo.topicId) { + span.updateName(`${topicInfo.topicId} create`); + span.setAttribute('messaging.destination.name', topicInfo.topicId); + } else { + span.updateName(`${topicName} create`); + } + if (topicInfo.projectId) { + span.setAttribute('gcp.project_id', topicInfo.projectId); + } + } + + static createReceiveSpan( + message: PubsubMessage, + subName: string, + parent: Context | undefined, + caller: string, + ): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + const subInfo = getSubscriptionInfo(subName); + const name = `${subInfo.subId ?? subName} subscribe`; + const attributes = this.createAttributes( + subInfo, + message, + caller, + 'receive', + ); + if (subInfo.subId) { + attributes['messaging.destination.name'] = subInfo.subId; + } + + if (context) { + return getTracer().startSpan( + name, + { + kind: SpanKind.CONSUMER, + attributes, + }, + parent, + ); + } else { + return getTracer().startSpan(name, { + kind: SpanKind.CONSUMER, + attributes, + }); + } + } + + static createChildSpan( + name: string, + message?: PubsubMessage, + parentSpan?: Span, + attributes?: SpanAttributes, + ): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + const parent = message?.parentSpan ?? parentSpan; + if (parent) { + return getTracer().startSpan( + name, + { + kind: SpanKind.INTERNAL, + attributes: attributes ?? {}, + }, + spanContextToContext(parent.spanContext()), + ); + } else { + return undefined; + } + } + + static createPublishFlowSpan(message: PubsubMessage): Span | undefined { + return PubsubSpans.createChildSpan('publisher flow control', message); + } + + static createPublishSchedulerSpan(message: PubsubMessage): Span | undefined { + return PubsubSpans.createChildSpan('publisher batching', message); + } + + static createPublishRpcSpan( + messages: MessageWithAttributes[], + topicName: string, + caller: string, + ): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + const spanAttributes = PubsubSpans.createAttributes( + getTopicInfo(topicName), + undefined, + caller, + 'create', + ); + const links: Link[] = messages + .filter(m => m.parentSpan && isSampled(m.parentSpan)) + .map(m => ({context: m.parentSpan!.spanContext()}) as Link) + .filter(l => l.context); + const span: Span = getTracer().startSpan( + `${topicName} send`, + { + kind: SpanKind.PRODUCER, + attributes: spanAttributes, + links, + }, + ROOT_CONTEXT, + ); + span?.setAttribute('messaging.batch.message_count', messages.length); + if (span) { + // Also attempt to link from message spans back to the publish RPC span. + messages.forEach(m => { + if (m.parentSpan && isSampled(m.parentSpan)) { + m.parentSpan.addLink({context: span.spanContext()}); + } + }); + } + + return span; + } + + static createAckRpcSpan( + messageSpans: (Span | undefined)[], + subName: string, + caller: string, + ): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + const subInfo = getSubscriptionInfo(subName); + + const spanAttributes = PubsubSpans.createAttributes( + subInfo, + undefined, + caller, + 'receive', + ); + const links: Link[] = messageSpans + .filter(m => m && isSampled(m)) + .map(m => ({context: m!.spanContext()}) as Link) + .filter(l => l.context); + const span: Span = getTracer().startSpan( + `${subInfo.subId ?? subInfo.subName} ack`, + { + kind: SpanKind.CLIENT, + attributes: spanAttributes, + links, + }, + ROOT_CONTEXT, + ); + + span?.setAttribute('messaging.batch.message_count', messageSpans.length); + + if (span) { + // Also attempt to link from the subscribe span(s) back to the publish RPC span. + messageSpans.forEach(m => { + if (m && isSampled(m)) { + m.addLink({context: span.spanContext()}); + } + }); + } + + return span; + } + + static createModackRpcSpan( + messageSpans: (Span | undefined)[], + subName: string, + type: 'modack' | 'nack', + caller: string, + deadline?: Duration, + isInitial?: boolean, + ): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + const subInfo = getSubscriptionInfo(subName); + + const spanAttributes = PubsubSpans.createAttributes( + subInfo, + undefined, + caller, + 'receive', + ); + const links: Link[] = messageSpans + .filter(m => m && isSampled(m)) + .map(m => ({context: m!.spanContext()}) as Link) + .filter(l => l.context); + const span: Span = getTracer().startSpan( + `${subInfo.subId ?? subInfo.subName} ${type}`, + { + kind: SpanKind.CLIENT, + attributes: spanAttributes, + links, + }, + ROOT_CONTEXT, + ); + + span?.setAttribute('messaging.batch.message_count', messageSpans.length); + + if (span) { + // Also attempt to link from the subscribe span(s) back to the publish RPC span. + messageSpans.forEach(m => { + if (m && isSampled(m)) { + m.addLink({context: span.spanContext()}); + } + }); + } + + if (deadline) { + span?.setAttribute( + 'messaging.gcp_pubsub.message.ack_deadline_seconds', + deadline.totalOf('second'), + ); + } + + if (isInitial !== undefined) { + span?.setAttribute('messaging.gcp_pubsub.is_receipt_modack', isInitial); + } + + return span; + } + + static createReceiveFlowSpan( + message: MessageWithAttributes, + ): Span | undefined { + return PubsubSpans.createChildSpan( + 'subscriber concurrency control', + message, + ); + } + + static createReceiveSchedulerSpan( + message: MessageWithAttributes, + ): Span | undefined { + return PubsubSpans.createChildSpan('subscriber scheduler', message); + } + + static createReceiveProcessSpan( + message: MessageWithAttributes, + subName: string, + ): Span | undefined { + const subInfo = getSubscriptionInfo(subName); + return PubsubSpans.createChildSpan( + `${subInfo.subId ?? subName} process`, + message, + ); + } + + static setReceiveProcessResult(span: Span, isAck: boolean) { + span?.setAttribute('messaging.gcp_pubsub.result', isAck ? 'ack' : 'nack'); + } +} + +/** + * Creates and manipulates Pub/Sub-related events on spans. + * + * @private + * @internal + */ +export class PubsubEvents { + static addEvent( + text: string, + message: MessageWithAttributes, + attributes?: Attributes, + ): void { + const parent = message.parentSpan; + if (!parent) { + return; + } + + parent.addEvent(text, attributes); + } + + static publishStart(message: MessageWithAttributes) { + PubsubEvents.addEvent('publish start', message); + } + + static publishEnd(message: MessageWithAttributes) { + PubsubEvents.addEvent('publish end', message); + } + + static ackStart(message: MessageWithAttributes) { + PubsubEvents.addEvent('ack start', message); + } + + static ackEnd(message: MessageWithAttributes) { + PubsubEvents.addEvent('ack end', message); + } + + static modackStart(message: MessageWithAttributes) { + PubsubEvents.addEvent('modack start', message); + } + + static modackEnd(message: MessageWithAttributes) { + PubsubEvents.addEvent('modack end', message); + } + + static nackStart(message: MessageWithAttributes) { + PubsubEvents.addEvent('nack start', message); + } + + static nackEnd(message: MessageWithAttributes) { + PubsubEvents.addEvent('nack end', message); + } + + static ackCalled(span: Span) { + span.addEvent('ack called'); + } + + static nackCalled(span: Span) { + span.addEvent('nack called'); + } + + static modAckCalled(span: Span, deadline: Duration) { + // User-called modAcks are never initial ones. + span.addEvent('modack called', { + 'messaging.gcp_pubsub.modack_deadline_seconds': `${deadline.totalOf( + 'second', + )}`, + 'messaging.gcp_pubsub.is_receipt_modack': 'false', + }); + } + + static modAckStart( + message: MessageWithAttributes, + deadline: Duration, + isInitial: boolean, + ) { + PubsubEvents.addEvent('modack start', message, { + 'messaging.gcp_pubsub.modack_deadline_seconds': `${deadline.totalOf( + 'second', + )}`, + 'messaging.gcp_pubsub.is_receipt_modack': isInitial ? 'true' : 'false', + }); + } + + static modAckEnd(message: MessageWithAttributes) { + PubsubEvents.addEvent('modack end', message); + } + + // Add this event any time the process is shut down before processing + // of the message can complete. + static shutdown(message: MessageWithAttributes) { + PubsubEvents.addEvent('shutdown', message); + } +} + +/** + * Injects the trace context into a Pub/Sub message (or other object with + * an 'attributes' object) for propagation. + * + * This is for the publish side. + * + * @private + * @internal + */ +export function injectSpan(span: Span, message: MessageWithAttributes): void { + if (!globallyEnabled) { + return; + } + + if (!message.attributes) { + message.attributes = {}; + } + + if (message.attributes[modernAttributeName]) { + console.warn( + `${modernAttributeName} key set as message attribute, but will be overridden.`, + ); + + delete message.attributes[modernAttributeName]; + } + + // Always do propagation injection with the trace context. + const context = trace.setSpanContext(ROOT_CONTEXT, span.spanContext()); + w3cTraceContextPropagator.inject(context, message, pubsubSetter); + + // Also put the direct reference to the Span object for while we're + // passing it around in the client library. + message.parentSpan = span; +} + +/** + * Returns true if this message potentially contains a span context. + * + * @private + * @internal + */ +export function containsSpanContext(message: MessageWithAttributes): boolean { + if (message.parentSpan) { + return true; + } + + if (!message.attributes) { + return false; + } + + const keys = Object.getOwnPropertyNames(message.attributes); + return !!keys.find(n => n === modernAttributeName); +} + +/** + * Extracts the trace context from a Pub/Sub message (or other object with + * an 'attributes' object) from a propagation, for receive processing. If no + * context was present, create a new parent span. + * + * This is for the receive side. + * + * @private + * @internal + */ +export function extractSpan( + message: MessageWithAttributes, + subName: string, +): Span | undefined { + if (!globallyEnabled) { + return undefined; + } + + if (message.parentSpan) { + return message.parentSpan; + } + + const keys = Object.getOwnPropertyNames(message.attributes ?? {}); + + let context: Context | undefined; + + if (keys.includes(modernAttributeName)) { + context = w3cTraceContextPropagator.extract( + ROOT_CONTEXT, + message, + pubsubGetter, + ); + } + + const span = PubsubSpans.createReceiveSpan( + message, + subName, + context, + 'extractSpan', + ); + message.parentSpan = span; + return span; +} diff --git a/handwritten/pubsub/src/temporal.ts b/handwritten/pubsub/src/temporal.ts new file mode 100644 index 00000000000..d92aa0c1aaa --- /dev/null +++ b/handwritten/pubsub/src/temporal.ts @@ -0,0 +1,226 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + * We'd like to use the tc39 Temporal standard, but it isn't out of + * proposal, still, and won't be present in all versions of Node until + * much later. Since even some of the polyfills aren't compatible with + * all of our supported versions of Node, this is a very simplified + * version of the pieces we need. When we're ready to turn on the tap + * for the built-in, we'll just export that here instead of this. + */ + +/** + * Simplified interface analogous to the tc39 Temporal.Duration + * parameter to from(). This doesn't support the full gamut (years, days). + */ +export interface DurationLike { + hours?: number; + minutes?: number; + seconds?: number; + milliseconds?: number; + + /** + * tc39 has renamed this to milliseconds. + * + * @deprecated + */ + millis?: number; +} + +/** + * Simplified list of values to pass to Duration.totalOf(). This + * list is taken from the tc39 Temporal.Duration proposal, but + * larger and smaller units have been left off. The latest tc39 spec + * allows for both singular and plural forms. + */ +export type TotalOfUnit = + | 'hour' + | 'minute' + | 'second' + | 'millisecond' + | 'hours' + | 'minutes' + | 'seconds' + | 'milliseconds'; + +interface TypeCheck { + total(): number; +} + +/** + * Is it a Duration or a DurationLike? + * + * @private + */ +export function isDurationObject(value: unknown): value is Duration { + return typeof value === 'object' && !!(value as TypeCheck).total; +} + +/** + * Duration class with an interface similar to the tc39 Temporal + * proposal. Since it's not fully finalized, and polyfills have + * inconsistent compatibility, for now this shim class will be + * used to set durations in Pub/Sub. + * + * This class will remain here for at least the next major version, + * eventually to be replaced by the tc39 Temporal.Duration built-in. + * + * https://tc39.es/proposal-temporal/docs/duration.html + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Duration + */ +export class Duration { + private millis: number; + + private static secondInMillis = 1000; + private static minuteInMillis = Duration.secondInMillis * 60; + private static hourInMillis = Duration.minuteInMillis * 60; + + private constructor(millis: number) { + this.millis = millis; + } + + /** + * Calculates the total number of units of type 'totalOf' that would + * fit inside this duration. + * + * No longer part of the tc39 spec, superseded by total(). + * + * @deprecated + */ + totalOf(totalOf: TotalOfUnit): number { + return this.total(totalOf); + } + + /** + * Calculates the total number of units of type 'totalOf' that would + * fit inside this duration. The tc39 `options` parameter is not supported. + */ + total(totalOf: TotalOfUnit): number { + switch (totalOf) { + case 'hour': + case 'hours': + return this.millis / Duration.hourInMillis; + case 'minute': + case 'minutes': + return this.millis / Duration.minuteInMillis; + case 'second': + case 'seconds': + return this.millis / Duration.secondInMillis; + case 'millisecond': + case 'milliseconds': + return this.millis; + default: + throw new Error(`Invalid unit in call to total(): ${totalOf}`); + } + } + + /** + * Equivalent to `total('hour')`. + */ + get hours(): number { + return this.total('hour'); + } + + /** + * Equivalent to `total('minute')`. + */ + get minutes(): number { + return this.total('minute'); + } + + /** + * Equivalent to `total('second')`. + */ + get seconds(): number { + return this.total('second'); + } + + /** + * Equivalent to `total('millisecond')`. + */ + get milliseconds(): number { + return this.total('millisecond'); + } + + /** + * Adds another Duration to this one and returns a new Duration. + * + * @param other A Duration or Duration-like object, like from() takes. + * @returns A new Duration. + */ + add(other: DurationLike | Duration): Duration { + const otherDuration = Duration.from(other); + return Duration.from({ + millis: this.milliseconds + otherDuration.milliseconds, + }); + } + + /** + * Subtracts another Duration from this one and returns a new Duration. + * + * @param other A Duration or Duration-like object, like from() takes. + * @returns A new Duration. + */ + subtract(other: DurationLike | Duration): Duration { + const otherDuration = Duration.from(other); + return Duration.from({ + millis: this.milliseconds - otherDuration.milliseconds, + }); + } + + /** + * Creates a Duration from a DurationLike, which is an object + * containing zero or more of the following: hours, seconds, + * minutes, millis. + */ + static from(durationLike: DurationLike | Duration): Duration { + if (isDurationObject(durationLike)) { + const d = durationLike as Duration; + return new Duration(d.milliseconds); + } + + let millis = durationLike.milliseconds ?? durationLike.millis ?? 0; + millis += (durationLike.seconds ?? 0) * Duration.secondInMillis; + millis += (durationLike.minutes ?? 0) * Duration.minuteInMillis; + millis += (durationLike.hours ?? 0) * Duration.hourInMillis; + + return new Duration(millis); + } + + /** + * Compare two Duration objects. Returns -1 if the first is less than the + * second, zero if they are equal, 1 if the first is greater than the second. + * + * Unlike tc39, this version does not accept options for relativeTo. + */ + static compare(first: Duration, second: Duration) { + const diffMs = first.total('millisecond') - second.total('millisecond'); + if (diffMs < 0) { + return -1; + } + if (diffMs > 0) { + return 1; + } + return 0; + } +} + +// Simple accessors that can be used independent of the class. These are +// functions and not methods because we don't want to add to what's in +// the tc39 spec. +export const atLeast = (d: Duration, min: Duration) => + Duration.compare(d, min) < 0 ? min : d; +export const atMost = (d: Duration, max: Duration) => + Duration.compare(d, max) > 0 ? max : d; diff --git a/handwritten/pubsub/src/topic.ts b/handwritten/pubsub/src/topic.ts new file mode 100644 index 00000000000..633c5f4cbd1 --- /dev/null +++ b/handwritten/pubsub/src/topic.ts @@ -0,0 +1,1132 @@ +/*! + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {paginator} from '@google-cloud/paginator'; +import {CallOptions} from 'google-gax'; + +import {google} from '../protos/protos'; + +import {IAM} from './iam'; +import { + Attributes, + PublishCallback, + Publisher, + PublishOptions, + PubsubMessage, +} from './publisher'; +import {FlowControlledPublisher} from './publisher/flow-publisher'; +import { + EmptyCallback, + EmptyResponse, + ExistsCallback, + ExistsResponse, + ObjectStream, + PagedResponse, + PageOptions, + PubSub, + RequestCallback, + ResourceCallback, +} from './pubsub'; +import { + CreateSubscriptionCallback, + CreateSubscriptionOptions, + CreateSubscriptionResponse, + Subscription, + SubscriptionOptions, +} from './subscription'; +import {promisifySome} from './util'; +import snakeCase = require('lodash.snakecase'); + +export type TopicMetadata = google.pubsub.v1.ITopic; + +type TopicCallback = ResourceCallback; +type TopicResponse = [Topic, TopicMetadata]; + +export type CreateTopicCallback = TopicCallback; +export type CreateTopicResponse = TopicResponse; + +export type GetTopicCallback = TopicCallback; +export type GetTopicResponse = TopicResponse; + +export type GetTopicOptions = CallOptions & {autoCreate?: boolean}; + +type MetadataCallback = RequestCallback; +type MetadataResponse = [TopicMetadata]; + +export type GetTopicMetadataCallback = MetadataCallback; +export type GetTopicMetadataResponse = MetadataResponse; + +export type SetTopicMetadataCallback = MetadataCallback; +export type SetTopicMetadataResponse = MetadataResponse; + +export type GetTopicSubscriptionsCallback = RequestCallback< + Subscription, + google.pubsub.v1.IListTopicSubscriptionsResponse +>; +export type GetTopicSubscriptionsResponse = PagedResponse< + Subscription, + google.pubsub.v1.IListTopicSubscriptionsResponse +>; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type MessageOptions = PubsubMessage & {json?: any}; + +/** + * A Topic object allows you to interact with a Cloud Pub/Sub topic. + * + * @class + * @param {PubSub} pubsub PubSub object. + * @param {string} name Name of the topic. + * @param {PublishOptions} [options] Publisher configuration object. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * ``` + * @example To enable message ordering, set `enableMessageOrdering` to true. Please note that this does not persist to an actual topic. + * ``` + * const topic = pubsub.topic('ordered-topic', {enableMessageOrdering: true}); + * ``` + */ +export class Topic { + parent: PubSub; + pubsub: PubSub; + request: typeof PubSub.prototype.request; + iam: IAM; + metadata?: TopicMetadata; + publisher: Publisher; + getSubscriptionsStream = paginator.streamify( + 'getSubscriptions', + ) as () => ObjectStream; + + constructor(pubsub: PubSub, name: string, options?: PublishOptions) { + /** + * The fully qualified name of this topic. May have a placeholder for + * the projectId if it's not been resolved. + * @name Topic#name + * @type {string} + */ + this.id_ = name; + /** + * The parent {@link PubSub} instance of this topic instance. + * @name Topic#pubsub + * @type {PubSub} + */ + /** + * The parent {@link PubSub} instance of this topic instance. + * @name Topic#parent + * @type {PubSub} + */ + this.parent = this.pubsub = pubsub; + this.publisher = new Publisher(this, options); + this.request = pubsub.request.bind(pubsub); + /** + * [IAM (Identity and Access + * Management)](https://cloud.google.com/pubsub/access_control) allows you + * to set permissions on individual resources and offers a wider range of + * roles: editor, owner, publisher, subscriber, and viewer. This gives you + * greater flexibility and allows you to set more fine-grained access + * control. + * + * *The IAM access control features described in this document are Beta, + * including the API methods to get and set IAM policies, and to test IAM + * permissions. Cloud Pub/Sub's use of IAM features is not covered by + * any SLA or deprecation policy, and may be subject to + * backward-incompatible changes.* + * + * @name Topic#iam + * @mixes IAM + * + * @see [Access Control Overview]{@link https://cloud.google.com/pubsub/access_control} + * @see [What is Cloud IAM?]{@link https://cloud.google.com/iam/} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * //- + * // Get the IAM policy for your topic. + * //- + * topic.iam.getPolicy((err, policy) => { + * console.log(policy); + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.iam.getPolicy().then((data) => { + * const policy = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + this.iam = new IAM(pubsub, this); + } + + private id_: string; + get name(): string { + return Topic.formatName_(this.parent.projectId, this.id_); + } + + /** + * Immediately sends all remaining queued data. This is mostly useful + * if you are planning to call close() on the PubSub object that holds + * the server connections. + * + * @param {EmptyCallback} [callback] Callback function. + * @returns {Promise} + */ + flush(): Promise; + flush(callback: EmptyCallback): void; + flush(callback?: EmptyCallback): Promise | void { + // It doesn't matter here if callback is undefined; the Publisher + // flush() will handle it. + this.publisher.flush(callback!); + } + + /** + * Create a topic. + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {CreateTopicCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.create((err, topic, apiResponse) => { + * if (!err) { + * // The topic was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.create().then((data) => { + * const topic = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + create(gaxOpts?: CallOptions): Promise; + create(callback: CreateTopicCallback): void; + create(gaxOpts: CallOptions, callback: CreateTopicCallback): void; + create( + optsOrCallback?: CallOptions | CreateTopicCallback, + callback?: CreateTopicCallback, + ): Promise | void { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + this.pubsub.createTopic(this.name, gaxOpts, callback!); + } + + /** + * Create a subscription to this topic. + * + * @see [Subscriptions: create API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create} + * + * @throws {Error} If subscription name is omitted. + * + * @param {string} name The name of the subscription. + * @param {CreateSubscriptionRequest} [options] See a + * [Subscription + * resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions). + * @param {CreateSubscriptionCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const callback = function(err, subscription, apiResponse) {}; + * + * // Without specifying any options. + * topic.createSubscription('newMessages', callback); + * + * // With options. + * topic.createSubscription('newMessages', { + * ackDeadlineSeconds: 90 + * }, callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.createSubscription('newMessages').then((data) => { + * const subscription = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + createSubscription(name: string, callback: CreateSubscriptionCallback): void; + createSubscription( + name: string, + options?: CreateSubscriptionOptions, + ): Promise; + createSubscription( + name: string, + options: CreateSubscriptionOptions, + callback: CreateSubscriptionCallback, + ): void; + createSubscription( + name: string, + optsOrCallback?: CreateSubscriptionOptions | CreateSubscriptionCallback, + callback?: CreateSubscriptionCallback, + ): void | Promise { + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + this.pubsub.createSubscription( + this, + name, + options as CreateSubscriptionOptions, + callback!, + ); + } + + /** + * Delete the topic. This will not delete subscriptions to this topic. + * + * @see [Topics: delete API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/delete} + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {function} [callback] The callback function. + * @param {?error} callback.err An error returned while making this + * request. + * @param {object} callback.apiResponse Raw API response. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.delete((err, apiResponse) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.delete().then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + delete(callback: EmptyCallback): void; + delete(gaxOpts?: CallOptions): Promise; + delete(gaxOpts: CallOptions, callback: EmptyCallback): void; + delete( + optsOrCallback?: CallOptions | EmptyCallback, + callback?: EmptyCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + topic: this.name, + }; + + this.request( + { + client: 'PublisherClient', + method: 'deleteTopic', + reqOpts, + gaxOpts: gaxOpts as CallOptions, + }, + callback!, + ); + } + + /** + * @typedef {array} TopicExistsResponse + * @property {boolean} 0 Whether the topic exists + */ + /** + * @callback TopicExistsCallback + * @param {?Error} err Request error, if any. + * @param {boolean} exists Whether the topic exists. + */ + /** + * Check if a topic exists. + * + * @param {TopicExistsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.exists((err, exists) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.exists().then((data) => { + * const exists = data[0]; + * }); + * ``` + */ + exists(): Promise; + exists(callback: ExistsCallback): void; + exists(callback?: ExistsCallback): void | Promise { + this.getMetadata(err => { + if (!err) { + callback!(null, true); + return; + } + if (err.code === 5) { + callback!(null, false); + return; + } + callback!(err); + }); + } + + /** + * @typedef {array} GetTopicResponse + * @property {Topic} 0 The {@link Topic}. + * @property {object} 1 The full API response. + */ + /** + * @callback GetTopicCallback + * @param {?Error} err Request error, if any. + * @param {Topic} topic The {@link Topic}. + * @param {object} apiResponse The full API response. + */ + /** + * Get a topic if it exists. + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {boolean} [gaxOpts.autoCreate=false] Automatically create the topic + * does not already exist. + * @param {GetTopicCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.get((err, topic, apiResponse) => { + * // The `topic` data has been populated. + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.get().then((data) => { + * const topic = data[0]; + * const apiResponse = data[1]; + * }); + * ``` + */ + get(callback: GetTopicCallback): void; + get(gaxOpts?: GetTopicOptions): Promise; + get(gaxOpts: GetTopicOptions, callback: GetTopicCallback): void; + get( + optsOrCallback?: GetTopicOptions | GetTopicCallback, + callback?: GetTopicCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const autoCreate = !!gaxOpts.autoCreate; + delete gaxOpts.autoCreate; + + this.getMetadata(gaxOpts, (err, apiResponse) => { + if (!err) { + callback!(null, this, apiResponse!); + return; + } + if (err.code !== 5 || !autoCreate) { + callback!(err, null, apiResponse!); + return; + } + this.create(gaxOpts, callback!); + }); + } + + /** + * @typedef {array} GetTopicMetadataResponse + * @property {object} 0 The full API response. + */ + /** + * @callback GetTopicMetadataCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ + /** + * Get the official representation of this topic from the API. + * + * @see [Topics: get API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/get} + * + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {GetTopicMetadataCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.getMetadata((err, apiResponse) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.getMetadata().then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + getMetadata(callback: GetTopicMetadataCallback): void; + getMetadata(gaxOpts: CallOptions, callback: GetTopicMetadataCallback): void; + getMetadata(gaxOpts?: CallOptions): Promise; + getMetadata( + optsOrCallback?: CallOptions | GetTopicMetadataCallback, + callback?: GetTopicMetadataCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts = { + topic: this.name, + }; + + this.request( + { + client: 'PublisherClient', + method: 'getTopic', + reqOpts, + gaxOpts: gaxOpts as CallOptions, + }, + (err, apiResponse) => { + if (!err) { + this.metadata = apiResponse!; + } + callback!(err, apiResponse!); + }, + ); + } + + /** + * Get a list of the subscriptions registered to this topic. You may + * optionally provide a query object as the first argument to customize the + * response. + * + * Your provided callback will be invoked with an error object if an API error + * occurred or an array of {module:pubsub/subscription} objects. + * + * @see [Subscriptions: list API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics.subscriptions/list} + * + * @param {GetSubscriptionsRequest} [query] Query object for listing subscriptions. + * @param {GetSubscriptionsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.getSubscriptions((err, subscriptions) => { + * // subscriptions is an array of `Subscription` objects. + * }); + * + * // Customize the query. + * topic.getSubscriptions({ + * pageSize: 3 + * }, callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * topic.getSubscriptions().then((data) => { + * const subscriptions = data[0]; + * }); + * ``` + */ + getSubscriptions(callback: GetTopicSubscriptionsCallback): void; + getSubscriptions( + options: PageOptions, + callback: GetTopicSubscriptionsCallback, + ): void; + getSubscriptions( + options?: PageOptions, + ): Promise; + getSubscriptions( + optsOrCallback?: PageOptions | GetTopicSubscriptionsCallback, + callback?: GetTopicSubscriptionsCallback, + ): void | Promise { + const options = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const reqOpts: google.pubsub.v1.IListTopicSubscriptionsRequest = + Object.assign( + { + topic: this.name, + }, + options as SubscriptionOptions, + ); + + delete (reqOpts as PageOptions).gaxOpts; + delete (reqOpts as PageOptions).autoPaginate; + + const gaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + this.request( + { + client: 'PublisherClient', + method: 'listTopicSubscriptions', + reqOpts, + gaxOpts, + }, + (err, subNames, ...args) => { + let subscriptions: Subscription[]; + + if (subNames) { + subscriptions = subNames.map((sub: string) => this.subscription(sub)); + } + + callback!(err, subscriptions!, ...args); + }, + ); + } + + /** + * Publish the provided message. + * + * @deprecated Please use {@link Topic#publishMessage}. + * + * @throws {TypeError} If data is not a Buffer object. + * @throws {TypeError} If any value in `attributes` object is not a string. + * + * @param {buffer} data The message data. This must come in the form of a + * Buffer object. + * @param {object.} [attributes] Attributes for this message. + * @param {PublishCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const data = Buffer.from('Hello, world!'); + * + * const callback = (err, messageId) => { + * if (err) { + * // Error handling omitted. + * } + * }; + * + * topic.publish(data, callback); + * + * ``` + * @example Optionally you can provide an object containing attributes for the message. Note that all values in the object must be strings. + * ``` + * const attributes = { + * key: 'value' + * }; + * + * topic.publish(data, attributes, callback); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * topic.publish(data).then((messageId) => {}); + * ``` + */ + publish(data: Buffer, attributes?: Attributes): Promise; + publish(data: Buffer, callback: PublishCallback): void; + publish( + data: Buffer, + attributes: Attributes, + callback: PublishCallback, + ): void; + publish( + data: Buffer, + attrsOrCb?: Attributes | PublishCallback, + callback?: PublishCallback, + ): Promise | void { + const attributes = typeof attrsOrCb === 'object' ? attrsOrCb : {}; + callback = typeof attrsOrCb === 'function' ? attrsOrCb : callback; + return this.publishMessage({data, attributes}, callback!); + } + + /** + * Publish the provided JSON. It should be noted that all messages published + * are done so in the form of a Buffer. This is simply a convenience method + * that will transform JSON into a Buffer before publishing. + * {@link Subscription} objects will always return message data in the form of + * a Buffer, so any JSON published will require manual deserialization. + * + * @deprecated Please use the `json` option via {@link Topic#publishMessage}. + * + * @throws {Error} If non-object data is provided. + * + * @param {object} json The JSON data to publish. + * @param {object} [attributes] Attributes for this message. + * @param {PublishCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * const topic = pubsub.topic('my-topic'); + * + * const data = { + * foo: 'bar' + * }; + * + * const callback = (err, messageId) => { + * if (err) { + * // Error handling omitted. + * } + * }; + * + * topic.publishJSON(data, callback); + * + * ``` + * @example Optionally you can provide an object containing attributes for the message. Note that all values in the object must be strings. + * ``` + * const attributes = { + * key: 'value' + * }; + * + * topic.publishJSON(data, attributes, callback); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * topic.publishJSON(data).then((messageId) => {}); + * ``` + */ + publishJSON(json: object, attributes?: Attributes): Promise; + publishJSON(json: object, callback: PublishCallback): void; + publishJSON( + json: object, + attributes: Attributes, + callback: PublishCallback, + ): void; + publishJSON( + json: object, + attrsOrCb?: Attributes | PublishCallback, + callback?: PublishCallback, + ): Promise | void { + if (!json || typeof json !== 'object') { + throw new Error('First parameter should be an object.'); + } + const attributes = typeof attrsOrCb === 'object' ? attrsOrCb : {}; + callback = typeof attrsOrCb === 'function' ? attrsOrCb : callback; + + return this.publishMessage({json, attributes}, callback!); + } + + /** + * @typedef {object} MessageOptions + * @property {buffer} [data] The message data. + * @property {object} [json] Convenience property to publish JSON data. This + * will transform the provided JSON into a Buffer before publishing. + * {@link Subscription} objects will always return message data in the + * form of a Buffer, so any JSON published will require manual + * deserialization. + * @property {object.} [attributes] Attributes for this + * message. + * @property {string} [orderingKey] A message ordering key. + */ + /** + * Publish the provided message. + * + * @throws {TypeError} If data is not a Buffer object. + * @throws {TypeError} If any value in `attributes` object is not a string. + * + * @param {MessageOptions} message Message object. + * @param {PublishCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * const topic = pubsub.topic('my-topic'); + * + * const data = Buffer.from('Hello, world!'); + * + * const callback = (err, messageId) => { + * if (err) { + * // Error handling omitted. + * } + * }; + * + * topic.publishMessage({data}, callback); + * + * ``` + * @example Publish JSON message data. + * ``` + * const json = {foo: 'bar'}; + * + * topic.publishMessage({json}, callback); + * + * ``` + * @example To publish messages in order (this is still experimental), make sure message ordering is enabled and provide an ordering key + * ``` + * const topic = pubsub.topic('ordered-topic', {messageOrdering: true}); + * const orderingKey = 'my-key'; + * + * topic.publishMessage({data, orderingKey}, callback); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * const messageId = await topic.publishMessage({data}); + * ``` + */ + publishMessage(message: MessageOptions): Promise; + publishMessage(message: MessageOptions, callback: PublishCallback): void; + publishMessage( + message: MessageOptions, + callback?: PublishCallback, + ): Promise | void { + // Make a copy to ensure that any changes we make to it will not + // propagate up to the user's data. + message = Object.assign({}, message); + + if (message.json && typeof message.json === 'object') { + message.data = Buffer.from(JSON.stringify(message.json)); + delete message.json; + } + + return this.publisher.publishMessage(message, callback!); + } + + /** + * Creates a FlowControlledPublisher for this Topic. + * + * FlowControlledPublisher is a helper that lets you control how many messages + * are simultaneously queued to send, to avoid ballooning memory usage on + * a low bandwidth connection to Pub/Sub. + * + * Note that it's perfectly fine to create more than one on the same Topic. + * The actual flow control settings on the Topic will apply across all + * FlowControlledPublisher objects on that Topic. + * + * @returns {FlowControlledPublisher} The flow control helper. + */ + flowControlled(): FlowControlledPublisher { + return new FlowControlledPublisher(this.publisher); + } + + /** + * In the event that the client fails to publish an ordered message, all + * subsequent publish calls using the same ordering key will fail. Calling + * this method will disregard the publish failure, allowing the supplied + * ordering key to be used again in the future. + * + * @param {string} orderingKey The ordering key in question. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * const topic = pubsub.topic('my-topic', {messageOrdering: true}); + * + * const orderingKey = 'foo'; + * const data = Buffer.from('Hello, order!'); + * + * topic.publishMessage({data, orderingKey}, err => { + * if (err) { + * topic.resumePublishing(orderingKey); + * } + * }); + * ``` + */ + resumePublishing(orderingKey: string): void { + this.publisher.resumePublishing(orderingKey); + } + + /** + * @typedef {array} SetTopicMetadataResponse + * @property {object} 0 The full API response. + */ + /** + * @callback SetTopicMetadataCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ + /** + * Updates the topic. + * + * @see [UpdateTopicRequest API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#google.pubsub.v1.UpdateTopicRequest} + * + * @param {object} metadata The fields to update. This should be structured + * like a {@link + * https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic|Topic + * object}. + * @param {object} [gaxOpts] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html. + * @param {SetTopicMetadataCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const metadata = { + * labels: {foo: 'bar'} + * }; + * + * topic.setMetadata(metadata, err => { + * if (err) { + * // Error handling omitted. + * } + * }); + * + * ``` + * @example If the callback is omitted, we'll return a Promise. + * ``` + * topic.setMetadata(metadata).then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + setMetadata( + options: TopicMetadata, + gaxOpts?: CallOptions, + ): Promise; + setMetadata(options: TopicMetadata, callback: SetTopicMetadataCallback): void; + setMetadata( + options: TopicMetadata, + gaxOpts: CallOptions, + callback: SetTopicMetadataCallback, + ): void; + setMetadata( + options: TopicMetadata, + optsOrCallback?: CallOptions | SetTopicMetadataCallback, + callback?: SetTopicMetadataCallback, + ): void | Promise { + const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {}; + callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback; + + const topic = Object.assign({name: this.name}, options); + const updateMask = {paths: Object.keys(options).map(snakeCase)}; + const reqOpts = {topic, updateMask}; + + this.request( + { + client: 'PublisherClient', + method: 'updateTopic', + reqOpts, + gaxOpts, + }, + callback!, + ); + } + + /** + * Set the publisher options. + * + * @param {PublishOptions} options The publisher options. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.setPublishOptions({ + * batching: { + * maxMilliseconds: 10 + * } + * }); + * ``` + */ + setPublishOptions(options: PublishOptions): void { + this.publisher.setOptions(options); + } + + /** + * Get the default publisher options. These may be modified and passed + * back into {@link Topic#setPublishOptions}. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * const defaults = topic.getPublishOptionDefaults(); + * defaults.batching.maxMilliseconds = 10; + * topic.setPublishOptions(defaults); + * ``` + */ + getPublishOptionDefaults(): PublishOptions { + // Generally I'd leave this as a static, but it'll be easier for users to + // get at when they're using the veneer objects. + return this.publisher.getOptionDefaults(); + } + + /** + * Create a Subscription object. This command by itself will not run any API + * requests. You will receive a {module:pubsub/subscription} object, + * which will allow you to interact with a subscription. + * + * @throws {Error} If subscription name is omitted. + * + * @param {string} name Name of the subscription. + * @param {SubscriberOptions} [options] Configuration object. + * @return {Subscription} + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * const subscription = topic.subscription('my-subscription'); + * + * // Register a listener for `message` events. + * subscription.on('message', (message) => { + * // Called every time a message is received. + * // message.id = ID of the message. + * // message.ackId = ID used to acknowledge the message receival. + * // message.data = Contents of the message. + * // message.attributes = Attributes of the message. + * // message.publishTime = Timestamp when Pub/Sub received the message. + * }); + * ``` + */ + subscription(name: string, options?: SubscriptionOptions): Subscription { + options = options || {}; + options.topic = this; + return this.pubsub.subscription(name, options); + } + + /** + * Format the name of a topic. A Topic's full name is in the format of + * 'projects/{projectId}/topics/{topicName}'. + * + * @private + * + * @return {string} + */ + static formatName_(projectId: string, name: string) { + // Simple check if the name is already formatted. + if (name.indexOf('/') > -1) { + return name; + } + return 'projects/' + projectId + '/topics/' + name; + } +} + +/** + * Get a list of the {module:pubsub/subscription} objects registered to this + * topic as a readable object stream. + * + * @method PubSub#getSubscriptionsStream + * @param {GetSubscriptionsRequest} [options] Configuration object. See + * {@link PubSub#getSubscriptions} for a complete list of options. + * @returns {ReadableStream} A readable stream of {@link Subscription} instances. + * + * @example + * ``` + * const {PubSub} = require('@google-cloud/pubsub'); + * const pubsub = new PubSub(); + * + * const topic = pubsub.topic('my-topic'); + * + * topic.getSubscriptionsStream() + * .on('error', console.error) + * .on('data', (subscription) => { + * // subscription is a Subscription object. + * }) + * .on('end', () => { + * // All subscriptions retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * topic.getSubscriptionsStream() + * .on('data', function(subscription) { + * this.end(); + * }); + * ``` + */ + +/*! Developer Documentation + * + * These methods can be agto-paginated. + */ +paginator.extend(Topic, ['getSubscriptions']); + +/*! Developer Documentation + * + * Existing async methods (except for streams) will return a Promise in the event + * that a callback is omitted. Future methods will not allow for a callback. + * (Use .then() on the returned Promise instead.) + */ +promisifySome(Topic, Topic.prototype, [ + 'flush', + 'create', + 'createSubscription', + 'delete', + 'exists', + 'get', + 'getMetadata', + 'getSubscriptions', + 'setMetadata', +]); + +export {PublishOptions}; diff --git a/handwritten/pubsub/src/util.ts b/handwritten/pubsub/src/util.ts new file mode 100644 index 00000000000..9ee6a5e2883 --- /dev/null +++ b/handwritten/pubsub/src/util.ts @@ -0,0 +1,135 @@ +/*! + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {promisify, PromisifyOptions} from '@google-cloud/promisify'; +import {Duration} from './temporal'; + +/** + * This replaces usage of promisifyAll(), going forward. Instead of opting + * some methods out, you will need to opt methods in. Additionally, this + * function validates method names against the class using TypeScript, + * to generate compile-time failures for misspellings and changes. + * + * Future work in the library should all be Promise-first. + * + * @private + */ +export function promisifySome( + class_: Function, + classProto: T, + methods: (keyof T)[], + options?: PromisifyOptions, +): void { + methods.forEach(methodName => { + // Do the same stream checks as promisifyAll(). + const m = classProto[methodName] as unknown as Function; + classProto[methodName] = promisify(m, options); + }); +} + +export function noop() {} + +/** + * Provides a very simple throttling capability for tasks like error logs. + * This ensures that no task is actually completed unless N millis have passed + * since the last one. + * + * @private + */ +export class Throttler { + minMillis: number; + lastTime?: number; + + constructor(minMillis: number) { + this.minMillis = minMillis; + } + + /** + * Performs the task requested, if enough time has passed since the + * last successful call. + */ + doMaybe(task: Function) { + const now = Date.now(); + const doTask = + !this.lastTime || + (this.lastTime && now - this.lastTime >= this.minMillis); + + if (doTask) { + task(); + this.lastTime = now; + } + } +} + +/** + * Takes care of managing a Map of buckets to the bucket arrays themselves. + * + * @private + */ +export function addToBucket(map: Map, bucket: T, item: U) { + const items = map.get(bucket) ?? []; + items.push(item); + map.set(bucket, items); +} + +const timeoutToken: unique symbol = Symbol('pubsub promise timeout'); + +/** + * Return value from `awaitWithTimeout`. There are several variations on what + * might happen here, so this bundles it all up into a "report". + */ +export interface TimeoutReturn { + returnedValue?: T; + exception?: Error; + timedOut: boolean; +} + +/** + * Awaits on Promise with a timeout. Resolves on the passed promise resolving or + * rejecting, or on timeout. + * + * @param promise An existing Promise returning type T. + * @param timeout A timeout value as a Duration; if the timeout is exceeded while + * waiting for the promise, the Promise this function returns will resolve, but + * with `timedOut` set. + * @returns A TimeoutReturn with the returned value, if applicable, an exception if + * the promise rejected, or the timedOut set to true if it timed out. + */ +export async function awaitWithTimeout( + promise: Promise, + timeout: Duration, +): Promise> { + let timeoutId: NodeJS.Timeout | undefined; + const timeoutPromise = new Promise((_, rej) => { + timeoutId = setTimeout(() => rej(timeoutToken), timeout.milliseconds); + }); + try { + const value = await Promise.race([timeoutPromise, promise]); + clearTimeout(timeoutId); + return { + returnedValue: value, + timedOut: false, + }; + } catch (e) { + const err: Error | symbol = e as unknown as Error | symbol; + // The timeout passed or the promise rejected. + clearTimeout(timeoutId); + return { + exception: (err !== timeoutToken ? err : undefined) as Error | undefined, + timedOut: err === timeoutToken, + }; + } +} diff --git a/handwritten/pubsub/src/v1/index.ts b/handwritten/pubsub/src/v1/index.ts new file mode 100644 index 00000000000..6131eef9934 --- /dev/null +++ b/handwritten/pubsub/src/v1/index.ts @@ -0,0 +1,21 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {PublisherClient} from './publisher_client'; +export {SchemaServiceClient} from './schema_service_client'; +export {SubscriberClient} from './subscriber_client'; diff --git a/handwritten/pubsub/src/v1/publisher_client.ts b/handwritten/pubsub/src/v1/publisher_client.ts new file mode 100644 index 00000000000..9c3fe64a7fc --- /dev/null +++ b/handwritten/pubsub/src/v1/publisher_client.ts @@ -0,0 +1,2142 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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, + IamClient, + IamProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/publisher_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './publisher_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that an application uses to manipulate topics, and to send + * messages to a topic. + * @class + * @memberof v1 + */ +export class PublisherClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('pubsub'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + publisherStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PublisherClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PublisherClient({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 PublisherClient; + 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 = 'pubsub.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + // 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 = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}', + ), + schemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/schemas/{schema}', + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}', + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}', + ), + }; + + // 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 = { + listTopics: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'topics', + ), + listTopicSubscriptions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subscriptions', + ), + listTopicSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots', + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // Some methods on this API support automatically batching + // requests; denote this. + + this.descriptors.batching = { + publish: new this._gaxModule.BundleDescriptor( + 'messages', + ['topic'], + 'message_ids', + this._gaxModule.GrpcClient.createByteLengthFunction( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + protoFilesRoot.lookupType('google.pubsub.v1.PubsubMessage') as any, + ), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.Publisher', + 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.publisherStub) { + return this.publisherStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.Publisher. + this.publisherStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.pubsub.v1.Publisher', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.pubsub.v1.Publisher, + 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 publisherStubMethods = [ + 'createTopic', + 'updateTopic', + 'publish', + 'getTopic', + 'listTopics', + 'listTopicSubscriptions', + 'listTopicSnapshots', + 'deleteTopic', + 'detachSubscription', + ]; + for (const methodName of publisherStubMethods) { + const callPromise = this.publisherStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.batching?.[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.publisherStub; + } + + /** + * 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 'pubsub.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 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + } + + 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 the given topic with the given name. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing labels] + * (https://cloud.google.com/pubsub/docs/labels). + * @param {google.pubsub.v1.MessageStoragePolicy} [request.messageStoragePolicy] + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * @param {string} [request.kmsKeyName] + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. + * + * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. + * @param {google.pubsub.v1.SchemaSettings} [request.schemaSettings] + * Optional. Settings for validating messages published against a schema. + * @param {boolean} [request.satisfiesPzs] + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * @param {google.protobuf.Duration} [request.messageRetentionDuration] + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a + * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + * that is up to `message_retention_duration` in the past. If this field is + * not set, message retention is controlled by settings on individual + * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * @param {google.pubsub.v1.Topic.State} request.state + * Output only. An output-only field indicating the state of the topic. + * @param {google.pubsub.v1.IngestionDataSourceSettings} [request.ingestionDataSourceSettings] + * Optional. Settings for ingestion from a data source into this topic. + * @param {number[]} [request.messageTransforms] + * Optional. Transforms to be applied to messages published to the topic. + * Transforms are applied in the order specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createTopic( + request?: protos.google.pubsub.v1.ITopic, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | undefined, + {} | undefined, + ] + >; + createTopic( + request: protos.google.pubsub.v1.ITopic, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + >, + ): void; + createTopic( + request: protos.google.pubsub.v1.ITopic, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + >, + ): void; + createTopic( + request?: protos.google.pubsub.v1.ITopic, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('createTopic request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTopic response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTopic(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | undefined, + {} | undefined, + ]) => { + this._log.info('createTopic response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Updates an existing topic by updating the fields specified in the update + * mask. Note that certain properties of a topic are not modifiable. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Topic} request.topic + * Required. The updated topic object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" but the `message_storage_policy` is not set in + * the `topic` provided above, then the updated value is determined by the + * policy configured at the project or organization level. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateTopic( + request?: protos.google.pubsub.v1.IUpdateTopicRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | undefined, + {} | undefined, + ] + >; + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateTopic( + request?: protos.google.pubsub.v1.IUpdateTopicRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'topic.name': request.topic!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('updateTopic request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTopic response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTopic(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateTopic response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + * does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * @param {number[]} request.messages + * Required. The messages to publish. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.PublishResponse|PublishResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + publish( + request?: protos.google.pubsub.v1.IPublishRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | undefined, + {} | undefined, + ] + >; + publish( + request: protos.google.pubsub.v1.IPublishRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + >, + ): void; + publish( + request: protos.google.pubsub.v1.IPublishRequest, + callback: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + >, + ): void; + publish( + request?: protos.google.pubsub.v1.IPublishRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + topic: request.topic ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('publish request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('publish response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .publish(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | undefined, + {} | undefined, + ]) => { + this._log.info('publish response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Gets the configuration of a topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getTopic( + request?: protos.google.pubsub.v1.IGetTopicRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | undefined, + {} | undefined, + ] + >; + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTopic( + request?: protos.google.pubsub.v1.IGetTopicRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + topic: request.topic ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getTopic request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTopic response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTopic(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTopic response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + * does not exist. After a topic is deleted, a new topic may be created with + * the same name; this is an entirely new topic with none of the old + * configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for 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. + */ + deleteTopic( + request?: protos.google.pubsub.v1.IDeleteTopicRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | undefined, + {} | undefined, + ] + >; + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteTopic( + request?: protos.google.pubsub.v1.IDeleteTopicRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + topic: request.topic ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteTopic request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTopic response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTopic(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteTopic response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Detaches a subscription from this topic. All messages retained in the + * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + * will return FAILED_PRECONDITION. If the subscription is a push + * subscription, pushes to the endpoint will stop. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to detach. + * Format is `projects/{project}/subscriptions/{subscription}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.DetachSubscriptionResponse|DetachSubscriptionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + detachSubscription( + request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | undefined, + {} | undefined, + ] + >; + detachSubscription( + request: protos.google.pubsub.v1.IDetachSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + detachSubscription( + request: protos.google.pubsub.v1.IDetachSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + detachSubscription( + request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('detachSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('detachSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .detachSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.IDetachSubscriptionResponse, + protos.google.pubsub.v1.IDetachSubscriptionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('detachSubscription response %j', response); + return [response, options, rawResponse]; + }, + ); + } + + /** + * Lists matching topics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.pubsub.v1.Topic|Topic}. + * 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 `listTopicsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopics( + request?: protos.google.pubsub.v1.IListTopicsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest | null, + protos.google.pubsub.v1.IListTopicsResponse, + ] + >; + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + >, + ): void; + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + >, + ): void; + listTopics( + request?: protos.google.pubsub.v1.IListTopicsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + >, + ): Promise< + [ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest | null, + protos.google.pubsub.v1.IListTopicsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project: request.project ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTopics values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTopics request %j', request); + return this.innerApiCalls + .listTopics(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest | null, + protos.google.pubsub.v1.IListTopicsResponse, + ]) => { + this._log.info('listTopics values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTopics`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * @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.pubsub.v1.Topic|Topic} 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 `listTopicsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicsStream( + request?: protos.google.pubsub.v1.IListTopicsRequest, + 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({ + project: request.project ?? '', + }); + const defaultCallSettings = this._defaults['listTopics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTopics stream %j', request); + return this.descriptors.page.listTopics.createStream( + this.innerApiCalls.listTopics as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTopics`, 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.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. + * @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.pubsub.v1.Topic|Topic}. 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. + */ + listTopicsAsync( + request?: protos.google.pubsub.v1.IListTopicsRequest, + 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({ + project: request.project ?? '', + }); + const defaultCallSettings = this._defaults['listTopics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTopics iterate %j', request); + return this.descriptors.page.listTopics.asyncIterate( + this.innerApiCalls['listTopics'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists the names of the attached subscriptions on this topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 string. + * 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 `listTopicSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSubscriptions( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: CallOptions, + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest | null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse, + ] + >; + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + >, + ): void; + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + >, + ): void; + listTopicSubscriptions( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + >, + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest | null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + topic: request.topic ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTopicSubscriptions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTopicSubscriptions request %j', request); + return this.innerApiCalls + .listTopicSubscriptions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest | null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse, + ]) => { + this._log.info('listTopicSubscriptions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTopicSubscriptions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * @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 string 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 `listTopicSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSubscriptionsStream( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + 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({ + topic: request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTopicSubscriptions stream %j', request); + return this.descriptors.page.listTopicSubscriptions.createStream( + this.innerApiCalls.listTopicSubscriptions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTopicSubscriptions`, 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.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. + * @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 + * string. 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. + */ + listTopicSubscriptionsAsync( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + 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({ + topic: request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTopicSubscriptions iterate %j', request); + return this.descriptors.page.listTopicSubscriptions.asyncIterate( + this.innerApiCalls['listTopicSubscriptions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists the names of the snapshots on this topic. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 string. + * 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 `listTopicSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSnapshots( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: CallOptions, + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest | null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse, + ] + >; + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, + string + >, + ): void; + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, + string + >, + ): void; + listTopicSnapshots( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + | protos.google.pubsub.v1.IListTopicSnapshotsResponse + | null + | undefined, + string + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, + string + >, + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest | null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + topic: request.topic ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + | protos.google.pubsub.v1.IListTopicSnapshotsResponse + | null + | undefined, + string + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTopicSnapshots values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTopicSnapshots request %j', request); + return this.innerApiCalls + .listTopicSnapshots(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest | null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse, + ]) => { + this._log.info('listTopicSnapshots values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTopicSnapshots`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * @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 string 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 `listTopicSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTopicSnapshotsStream( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + 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({ + topic: request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTopicSnapshots stream %j', request); + return this.descriptors.page.listTopicSnapshots.createStream( + this.innerApiCalls.listTopicSnapshots as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTopicSnapshots`, 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.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. + * @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 + * string. 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. + */ + listTopicSnapshotsAsync( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + 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({ + topic: request.topic ?? '', + }); + const defaultCallSettings = this._defaults['listTopicSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listTopicSnapshots iterate %j', request); + return this.descriptors.page.listTopicSnapshots.asyncIterate( + this.innerApiCalls['listTopicSnapshots'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project: string, topic: string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .topic; + } + + /** + * Return a fully-qualified schema resource name string. + * + * @param {string} project + * @param {string} schema + * @returns {string} Resource name string. + */ + schemaPath(project: string, schema: string) { + return this.pathTemplates.schemaPathTemplate.render({ + project: project, + schema: schema, + }); + } + + /** + * Parse the project from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).project; + } + + /** + * Parse the schema from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project: string, snapshot: string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * 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.publisherStub && !this._terminated) { + return this.publisherStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/handwritten/pubsub/src/v1/publisher_client_config.json b/handwritten/pubsub/src/v1/publisher_client_config.json new file mode 100644 index 00000000000..187d70936fc --- /dev/null +++ b/handwritten/pubsub/src/v1/publisher_client_config.json @@ -0,0 +1,103 @@ +{ + "interfaces": { + "google.pubsub.v1.Publisher": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ + "CANCELLED", + "UNKNOWN", + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ], + "unknown_aborted_unavailable": [ + "UNKNOWN", + "ABORTED", + "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 + }, + "693222d32e887d96c8faeadca469f7763ccda85a": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 4, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Publish": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable", + "retry_params_name": "693222d32e887d96c8faeadca469f7763ccda85a", + "bundling": { + "element_count_threshold": 100, + "request_byte_threshold": 1048576, + "delay_threshold_millis": 10, + "element_count_limit": 1000 + } + }, + "GetTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListTopics": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListTopicSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListTopicSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "DeleteTopic": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DetachSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/handwritten/pubsub/src/v1/publisher_proto_list.json b/handwritten/pubsub/src/v1/publisher_proto_list.json new file mode 100644 index 00000000000..91011aec150 --- /dev/null +++ b/handwritten/pubsub/src/v1/publisher_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/pubsub/v1/pubsub.proto", + "../../protos/google/pubsub/v1/schema.proto" +] diff --git a/handwritten/pubsub/src/v1/schema_service_client.ts b/handwritten/pubsub/src/v1/schema_service_client.ts new file mode 100644 index 00000000000..c2e03bdfe73 --- /dev/null +++ b/handwritten/pubsub/src/v1/schema_service_client.ts @@ -0,0 +1,2107 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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, + IamClient, + IamProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/schema_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './schema_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for doing schema-related operations. + * @class + * @memberof v1 + */ +export class SchemaServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('pubsub'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + schemaServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SchemaServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SchemaServiceClient({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 SchemaServiceClient; + 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 = 'pubsub.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + // 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 = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}', + ), + schemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/schemas/{schema}', + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}', + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}', + ), + }; + + // 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 = { + listSchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'schemas', + ), + listSchemaRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'schemas', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.SchemaService', + 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.schemaServiceStub) { + return this.schemaServiceStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.SchemaService. + this.schemaServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.pubsub.v1.SchemaService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.pubsub.v1.SchemaService, + 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 schemaServiceStubMethods = [ + 'createSchema', + 'getSchema', + 'listSchemas', + 'listSchemaRevisions', + 'commitSchema', + 'rollbackSchema', + 'deleteSchemaRevision', + 'deleteSchema', + 'validateSchema', + 'validateMessage', + ]; + for (const methodName of schemaServiceStubMethods) { + const callPromise = this.schemaServiceStub.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.schemaServiceStub; + } + + /** + * 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 'pubsub.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 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + } + + 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 schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to create the schema. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.Schema} request.schema + * Required. The schema object to create. + * + * This schema's `name` parameter is ignored. The schema object returned + * by CreateSchema will have a `name` made using the given `parent` and + * `schema_id`. + * @param {string} request.schemaId + * The ID to use for the schema, which will become the final component of + * the schema's resource name. + * + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSchema( + request?: protos.google.pubsub.v1.ICreateSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | undefined, + {} | undefined, + ] + >; + createSchema( + request: protos.google.pubsub.v1.ICreateSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + createSchema( + request: protos.google.pubsub.v1.ICreateSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + createSchema( + request?: protos.google.pubsub.v1.ICreateSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('createSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICreateSchemaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSchema response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Gets a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to get. + * Format is `projects/{project}/schemas/{schema}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of fields to return in the response. If not set, returns a Schema + * with all fields filled out. Set to `BASIC` to omit the `definition`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSchema( + request?: protos.google.pubsub.v1.IGetSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | undefined, + {} | undefined, + ] + >; + getSchema( + request: protos.google.pubsub.v1.IGetSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSchema( + request: protos.google.pubsub.v1.IGetSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSchema( + request?: protos.google.pubsub.v1.IGetSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IGetSchemaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSchema response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Commits a new schema revision to an existing schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema we are revising. + * Format is `projects/{project}/schemas/{schema}`. + * @param {google.pubsub.v1.Schema} request.schema + * Required. The schema revision to commit. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + commitSchema( + request?: protos.google.pubsub.v1.ICommitSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | undefined, + {} | undefined, + ] + >; + commitSchema( + request: protos.google.pubsub.v1.ICommitSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + commitSchema( + request: protos.google.pubsub.v1.ICommitSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + commitSchema( + request?: protos.google.pubsub.v1.ICommitSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('commitSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('commitSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .commitSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.ICommitSchemaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('commitSchema response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Creates a new schema revision that is a copy of the provided revision_id. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The schema being rolled back with revision id. + * @param {string} request.revisionId + * Required. The revision ID to roll back to. + * It must be a revision of the same schema. + * + * Example: c7cfa2a8 + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + rollbackSchema( + request?: protos.google.pubsub.v1.IRollbackSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | undefined, + {} | undefined, + ] + >; + rollbackSchema( + request: protos.google.pubsub.v1.IRollbackSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + rollbackSchema( + request: protos.google.pubsub.v1.IRollbackSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + rollbackSchema( + request?: protos.google.pubsub.v1.IRollbackSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('rollbackSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('rollbackSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .rollbackSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IRollbackSchemaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('rollbackSchema response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Deletes a specific schema revision. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + * + * Example: `projects/123/schemas/my-schema@c7cfa2a8` + * @param {string} [request.revisionId] + * Optional. This field is deprecated and should not be used for specifying + * the revision ID. The revision ID should be specified via the `name` + * parameter. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Schema|Schema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + deleteSchemaRevision( + request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | undefined, + {} | undefined, + ] + >; + deleteSchemaRevision( + request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSchemaRevision( + request: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + callback: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSchemaRevision( + request?: protos.google.pubsub.v1.IDeleteSchemaRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISchema, + | protos.google.pubsub.v1.IDeleteSchemaRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteSchemaRevision request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISchema, + | protos.google.pubsub.v1.IDeleteSchemaRevisionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSchemaRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSchemaRevision(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISchema, + protos.google.pubsub.v1.IDeleteSchemaRevisionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSchemaRevision response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Deletes a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the schema to delete. + * Format is `projects/{project}/schemas/{schema}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for 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. + */ + deleteSchema( + request?: protos.google.pubsub.v1.IDeleteSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | undefined, + {} | undefined, + ] + >; + deleteSchema( + request: protos.google.pubsub.v1.IDeleteSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSchema( + request: protos.google.pubsub.v1.IDeleteSchemaRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSchema( + request?: protos.google.pubsub.v1.IDeleteSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSchemaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSchema response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Validates a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.Schema} request.schema + * Required. The schema object to validate. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.ValidateSchemaResponse|ValidateSchemaResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + validateSchema( + request?: protos.google.pubsub.v1.IValidateSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | undefined, + {} | undefined, + ] + >; + validateSchema( + request: protos.google.pubsub.v1.IValidateSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + validateSchema( + request: protos.google.pubsub.v1.IValidateSchemaRequest, + callback: Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | null | undefined, + {} | null | undefined + >, + ): void; + validateSchema( + request?: protos.google.pubsub.v1.IValidateSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('validateSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.IValidateSchemaResponse, + protos.google.pubsub.v1.IValidateSchemaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('validateSchema response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Validates a message against a schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to validate schemas. + * Format is `projects/{project-id}`. + * @param {string} request.name + * Name of the schema against which to validate. + * + * Format is `projects/{project}/schemas/{schema}`. + * @param {google.pubsub.v1.Schema} request.schema + * Ad-hoc schema against which to validate + * @param {Buffer} request.message + * Message to validate against the provided `schema_spec`. + * @param {google.pubsub.v1.Encoding} request.encoding + * The encoding expected for messages + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.ValidateMessageResponse|ValidateMessageResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + validateMessage( + request?: protos.google.pubsub.v1.IValidateMessageRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | undefined, + {} | undefined, + ] + >; + validateMessage( + request: protos.google.pubsub.v1.IValidateMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | null | undefined, + {} | null | undefined + >, + ): void; + validateMessage( + request: protos.google.pubsub.v1.IValidateMessageRequest, + callback: Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | null | undefined, + {} | null | undefined + >, + ): void; + validateMessage( + request?: protos.google.pubsub.v1.IValidateMessageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('validateMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.IValidateMessageResponse, + protos.google.pubsub.v1.IValidateMessageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('validateMessage response %j', response); + return [response, options, rawResponse]; + }, + ); + } + + /** + * Lists schemas in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * Maximum number of schemas to return. + * @param {string} request.pageToken + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.pubsub.v1.Schema|Schema}. + * 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 `listSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemas( + request?: protos.google.pubsub.v1.IListSchemasRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemasRequest | null, + protos.google.pubsub.v1.IListSchemasResponse, + ] + >; + listSchemas( + request: protos.google.pubsub.v1.IListSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + ): void; + listSchemas( + request: protos.google.pubsub.v1.IListSchemasRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + ): void; + listSchemas( + request?: protos.google.pubsub.v1.IListSchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemasRequest | null, + protos.google.pubsub.v1.IListSchemasResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListSchemasRequest, + protos.google.pubsub.v1.IListSchemasResponse | null | undefined, + protos.google.pubsub.v1.ISchema + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSchemas values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSchemas request %j', request); + return this.innerApiCalls + .listSchemas(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemasRequest | null, + protos.google.pubsub.v1.IListSchemasResponse, + ]) => { + this._log.info('listSchemas values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSchemas`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * Maximum number of schemas to return. + * @param {string} request.pageToken + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * @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.pubsub.v1.Schema|Schema} 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 `listSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemasStream( + request?: protos.google.pubsub.v1.IListSchemasRequest, + 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['listSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSchemas stream %j', request); + return this.descriptors.page.listSchemas.createStream( + this.innerApiCalls.listSchemas as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which to list schemas. + * Format is `projects/{project-id}`. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * Maximum number of schemas to return. + * @param {string} request.pageToken + * The value returned by the last `ListSchemasResponse`; indicates that + * this is a continuation of a prior `ListSchemas` call, and that the + * system should return the next page of data. + * @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.pubsub.v1.Schema|Schema}. 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. + */ + listSchemasAsync( + request?: protos.google.pubsub.v1.IListSchemasRequest, + 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['listSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSchemas iterate %j', request); + return this.descriptors.page.listSchemas.asyncIterate( + this.innerApiCalls['listSchemas'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all schema revisions for the named schema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to list revisions for. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.pubsub.v1.Schema|Schema}. + * 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 `listSchemaRevisionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaRevisions( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemaRevisionsRequest | null, + protos.google.pubsub.v1.IListSchemaRevisionsResponse, + ] + >; + listSchemaRevisions( + request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + ): void; + listSchemaRevisions( + request: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + ): void; + listSchemaRevisions( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + | protos.google.pubsub.v1.IListSchemaRevisionsResponse + | null + | undefined, + protos.google.pubsub.v1.ISchema + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + protos.google.pubsub.v1.IListSchemaRevisionsResponse | null | undefined, + protos.google.pubsub.v1.ISchema + >, + ): Promise< + [ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemaRevisionsRequest | null, + protos.google.pubsub.v1.IListSchemaRevisionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListSchemaRevisionsRequest, + | protos.google.pubsub.v1.IListSchemaRevisionsResponse + | null + | undefined, + protos.google.pubsub.v1.ISchema + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSchemaRevisions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSchemaRevisions request %j', request); + return this.innerApiCalls + .listSchemaRevisions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.pubsub.v1.ISchema[], + protos.google.pubsub.v1.IListSchemaRevisionsRequest | null, + protos.google.pubsub.v1.IListSchemaRevisionsResponse, + ]) => { + this._log.info('listSchemaRevisions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSchemaRevisions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the schema to list revisions for. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.pubsub.v1.Schema|Schema} 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 `listSchemaRevisionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSchemaRevisionsStream( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listSchemaRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSchemaRevisions stream %j', request); + return this.descriptors.page.listSchemaRevisions.createStream( + this.innerApiCalls.listSchemaRevisions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSchemaRevisions`, 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.name + * Required. The name of the schema to list revisions for. + * @param {google.pubsub.v1.SchemaView} request.view + * The set of Schema fields to return in the response. If not set, returns + * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + * retrieve all fields. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListSchemaRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.pubsub.v1.Schema|Schema}. 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. + */ + listSchemaRevisionsAsync( + request?: protos.google.pubsub.v1.IListSchemaRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listSchemaRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSchemaRevisions iterate %j', request); + return this.descriptors.page.listSchemaRevisions.asyncIterate( + this.innerApiCalls['listSchemaRevisions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project: string, topic: string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .topic; + } + + /** + * Return a fully-qualified schema resource name string. + * + * @param {string} project + * @param {string} schema + * @returns {string} Resource name string. + */ + schemaPath(project: string, schema: string) { + return this.pathTemplates.schemaPathTemplate.render({ + project: project, + schema: schema, + }); + } + + /** + * Parse the project from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).project; + } + + /** + * Parse the schema from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project: string, snapshot: string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * 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.schemaServiceStub && !this._terminated) { + return this.schemaServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/handwritten/pubsub/src/v1/schema_service_client_config.json b/handwritten/pubsub/src/v1/schema_service_client_config.json new file mode 100644 index 00000000000..5a2280962fc --- /dev/null +++ b/handwritten/pubsub/src/v1/schema_service_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.pubsub.v1.SchemaService": { + "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 + } + }, + "methods": { + "CreateSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSchemaRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CommitSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "RollbackSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSchemaRevision": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateSchema": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ValidateMessage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/handwritten/pubsub/src/v1/schema_service_proto_list.json b/handwritten/pubsub/src/v1/schema_service_proto_list.json new file mode 100644 index 00000000000..91011aec150 --- /dev/null +++ b/handwritten/pubsub/src/v1/schema_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/pubsub/v1/pubsub.proto", + "../../protos/google/pubsub/v1/schema.proto" +] diff --git a/handwritten/pubsub/src/v1/subscriber_client.ts b/handwritten/pubsub/src/v1/subscriber_client.ts new file mode 100644 index 00000000000..47a3969b8ba --- /dev/null +++ b/handwritten/pubsub/src/v1/subscriber_client.ts @@ -0,0 +1,2905 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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, + IamClient, + IamProtos, +} from 'google-gax'; +import {Transform, PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/subscriber_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './subscriber_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that an application uses to manipulate subscriptions and to + * consume messages from a subscription via the `Pull` method or by + * establishing a bi-directional stream using the `StreamingPull` method. + * @class + * @memberof v1 + */ +export class SubscriberClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('pubsub'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + subscriberStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SubscriberClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SubscriberClient({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 SubscriberClient; + 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 = 'pubsub.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + // 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 = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}', + ), + schemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/schemas/{schema}', + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}', + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}', + ), + }; + + // 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 = { + listSubscriptions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subscriptions', + ), + listSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingPull: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.Subscriber', + 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.subscriberStub) { + return this.subscriberStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.Subscriber. + this.subscriberStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.pubsub.v1.Subscriber', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.pubsub.v1.Subscriber, + 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 subscriberStubMethods = [ + 'createSubscription', + 'getSubscription', + 'updateSubscription', + 'listSubscriptions', + 'deleteSubscription', + 'modifyAckDeadline', + 'acknowledge', + 'pull', + 'streamingPull', + 'modifyPushConfig', + 'getSnapshot', + 'listSnapshots', + 'createSnapshot', + 'updateSnapshot', + 'deleteSnapshot', + 'seek', + ]; + for (const methodName of subscriberStubMethods) { + const callPromise = this.subscriberStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.subscriberStub; + } + + /** + * 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 'pubsub.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 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + } + + 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 subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * If the subscription already exists, returns `ALREADY_EXISTS`. + * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * + * If the name is not provided in the request, the server will assign a random + * name for this subscription on the same project as the topic, conforming + * to the [resource name format] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + * generated name is populated in the returned Subscription object. Note that + * for REST API requests, you must specify a name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * @param {string} request.topic + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * @param {google.pubsub.v1.PushConfig} [request.pushConfig] + * Optional. If push delivery is used with this subscription, this field is + * used to configure it. + * @param {google.pubsub.v1.BigQueryConfig} [request.bigqueryConfig] + * Optional. If delivery to BigQuery is used with this subscription, this + * field is used to configure it. + * @param {google.pubsub.v1.CloudStorageConfig} [request.cloudStorageConfig] + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * @param {number} [request.ackDeadlineSeconds] + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). + * + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * @param {boolean} [request.retainAckedMessages] + * Optional. Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to [`Seek` to a timestamp] + * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + * the past to replay previously-acknowledged messages. + * @param {google.protobuf.Duration} [request.messageRetentionDuration] + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 31 days or less than 10 minutes. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * @param {boolean} [request.enableMessageOrdering] + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * @param {google.pubsub.v1.ExpirationPolicy} [request.expirationPolicy] + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + * but `expiration_policy.ttl` is not set, the subscription never expires. + * @param {string} [request.filter] + * Optional. An expression written in the Pub/Sub [filter + * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * @param {google.pubsub.v1.DeadLetterPolicy} [request.deadLetterPolicy] + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. + * + * The Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * @param {google.pubsub.v1.RetryPolicy} [request.retryPolicy] + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. + * + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded + * events for a given message. + * @param {boolean} [request.detached] + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return + * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + * the endpoint will not be made. + * @param {boolean} [request.enableExactlyOnceDelivery] + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: + * + * * The message sent to a subscriber is guaranteed not to be resent + * before the message's acknowledgment deadline expires. + * * An acknowledged message will not be resent to a subscriber. + * + * Note that subscribers may still receive multiple copies of a message + * when `enable_exactly_once_delivery` is true if the message was published + * multiple times by a publisher client. These copies are considered distinct + * by Pub/Sub and have distinct `message_id` values. + * @param {google.protobuf.Duration} request.topicMessageRetentionDuration + * Output only. Indicates the minimum duration for which a message is retained + * after it is published to the subscription's topic. If this field is set, + * messages published to the subscription's topic in the last + * `topic_message_retention_duration` are always available to subscribers. See + * the `message_retention_duration` field in `Topic`. This field is set only + * in responses from the server; it is ignored if it is set in any requests. + * @param {google.pubsub.v1.Subscription.State} request.state + * Output only. An output-only field indicating whether or not the + * subscription can receive messages. + * @param {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} request.analyticsHubSubscriptionInfo + * Output only. Information about the associated Analytics Hub subscription. + * Only set if the subscritpion is created by Analytics Hub. + * @param {number[]} [request.messageTransforms] + * Optional. Transforms to be applied to messages before they are delivered to + * subscribers. Transforms are applied in the order specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSubscription( + request?: protos.google.pubsub.v1.ISubscription, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | undefined, + {} | undefined, + ] + >; + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + >, + ): void; + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + >, + ): void; + createSubscription( + request?: protos.google.pubsub.v1.ISubscription, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('createSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | undefined, + {} | undefined, + ]) => { + this._log.info('createSubscription response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Gets the configuration details of a subscription. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSubscription( + request?: protos.google.pubsub.v1.IGetSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, + {} | undefined, + ] + >; + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSubscription( + request?: protos.google.pubsub.v1.IGetSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSubscription response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Updates an existing subscription by updating the fields specified in the + * update mask. Note that certain properties of a subscription, such as its + * topic, are not modifiable. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Subscription} request.subscription + * Required. The updated subscription object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateSubscription( + request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, + {} | undefined, + ] + >; + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateSubscription( + request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'subscription.name': request.subscription!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('updateSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSubscription response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Deletes an existing subscription. All messages retained in the subscription + * are immediately dropped. Calls to `Pull` after deletion will return + * `NOT_FOUND`. After a subscription is deleted, a new one may be created with + * the same name, but the new one has no association with the old + * subscription or its topic unless the same topic is specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for 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. + */ + deleteSubscription( + request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, + {} | undefined, + ] + >; + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSubscription( + request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSubscription response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Modifies the ack deadline for a specific message. This method is useful + * to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {string[]} request.ackIds + * Required. List of acknowledgment IDs. + * @param {number} request.ackDeadlineSeconds + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for 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. + */ + modifyAckDeadline( + request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, + {} | undefined, + ] + >; + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + >, + ): void; + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + >, + ): void; + modifyAckDeadline( + request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('modifyAckDeadline request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('modifyAckDeadline response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .modifyAckDeadline(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, + {} | undefined, + ]) => { + this._log.info('modifyAckDeadline response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Acknowledges the messages associated with the `ack_ids` in the + * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + * from the subscription. + * + * Acknowledging a message whose ack deadline has expired may succeed, + * but such a message may be redelivered later. Acknowledging a message more + * than once will not result in an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {string[]} request.ackIds + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.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. + */ + acknowledge( + request?: protos.google.pubsub.v1.IAcknowledgeRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | undefined, + {} | undefined, + ] + >; + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + >, + ): void; + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + >, + ): void; + acknowledge( + request?: protos.google.pubsub.v1.IAcknowledgeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('acknowledge request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('acknowledge response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .acknowledge(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | undefined, + {} | undefined, + ]) => { + this._log.info('acknowledge response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Pulls messages from the server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {boolean} [request.returnImmediately] + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * @param {number} request.maxMessages + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.PullResponse|PullResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + pull( + request?: protos.google.pubsub.v1.IPullRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | undefined, + {} | undefined, + ] + >; + pull( + request: protos.google.pubsub.v1.IPullRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + >, + ): void; + pull( + request: protos.google.pubsub.v1.IPullRequest, + callback: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + >, + ): void; + pull( + request?: protos.google.pubsub.v1.IPullRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('pull request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('pull response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .pull(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | undefined, + {} | undefined, + ]) => { + this._log.info('pull response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Modifies the `PushConfig` for a specified subscription. + * + * This may be used to change a push subscription to a pull one (signified by + * an empty `PushConfig`) or vice versa, or change the endpoint URL and other + * attributes of a push subscription. Messages will accumulate for delivery + * continuously through the call regardless of changes to the `PushConfig`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {google.pubsub.v1.PushConfig} request.pushConfig + * Required. The push configuration for future deliveries. + * + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for 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. + */ + modifyPushConfig( + request?: protos.google.pubsub.v1.IModifyPushConfigRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, + {} | undefined, + ] + >; + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + >, + ): void; + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + >, + ): void; + modifyPushConfig( + request?: protos.google.pubsub.v1.IModifyPushConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('modifyPushConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('modifyPushConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .modifyPushConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, + {} | undefined, + ]) => { + this._log.info('modifyPushConfig response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Gets the configuration details of a snapshot. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.snapshot + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + getSnapshot( + request?: protos.google.pubsub.v1.IGetSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | undefined, + {} | undefined, + ] + >; + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSnapshot( + request?: protos.google.pubsub.v1.IGetSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + snapshot: request.snapshot ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('getSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSnapshot response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * If the snapshot already exists, returns `ALREADY_EXISTS`. + * If the requested subscription doesn't exist, returns `NOT_FOUND`. + * If the backlog in the subscription is too old -- and the resulting snapshot + * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + * See also the `Snapshot.expire_time` field. If the name is not provided in + * the request, the server will assign a random + * name for this snapshot on the same project as the subscription, conforming + * to the [resource name format] + * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for + * REST API requests, you must specify a name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the [resource name + * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + * Format is `projects/{project}/snapshots/{snap}`. + * @param {string} request.subscription + * Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing + * labels](https://cloud.google.com/pubsub/docs/labels). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + createSnapshot( + request?: protos.google.pubsub.v1.ICreateSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, + {} | undefined, + ] + >; + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + createSnapshot( + request?: protos.google.pubsub.v1.ICreateSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('createSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSnapshot response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Updates an existing snapshot by updating the fields specified in the update + * mask. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + * which allow you to manage message acknowledgments in bulk. That is, you can + * set the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Snapshot} request.snapshot + * Required. The updated snapshot object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + updateSnapshot( + request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, + {} | undefined, + ] + >; + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateSnapshot( + request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'snapshot.name': request.snapshot!.name ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('updateSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSnapshot response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Removes an existing snapshot. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * When the snapshot is deleted, all messages retained in the snapshot + * are immediately dropped. After a snapshot is deleted, a new one may be + * created with the same name, but the new one has no association with the old + * snapshot or its subscription, unless the same subscription is specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.snapshot + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for 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. + */ + deleteSnapshot( + request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, + {} | undefined, + ] + >; + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSnapshot( + request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + snapshot: request.snapshot ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('deleteSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSnapshot response %j', response); + return [response, options, rawResponse]; + }, + ); + } + /** + * Seeks an existing subscription to a point in time or to a given snapshot, + * whichever is provided in the request. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. Note that both the subscription and the + * snapshot must be on the same topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to affect. + * @param {google.protobuf.Timestamp} [request.time] + * Optional. The time to seek to. + * Messages retained in the subscription that were published before this + * time are marked as acknowledged, and messages retained in the + * subscription that were published after this time are marked as + * unacknowledged. Note that this operation affects only those messages + * retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention + * window (or to a point before the system's notion of the subscription + * creation time), only retained messages will be marked as unacknowledged, + * and already-expunged messages will not be restored. + * @param {string} [request.snapshot] + * Optional. The snapshot to seek to. The snapshot's topic must be the same + * as that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.pubsub.v1.SeekResponse|SeekResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + */ + seek( + request?: protos.google.pubsub.v1.ISeekRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | undefined, + {} | undefined, + ] + >; + seek( + request: protos.google.pubsub.v1.ISeekRequest, + options: CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + >, + ): void; + seek( + request: protos.google.pubsub.v1.ISeekRequest, + callback: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + >, + ): void; + seek( + request?: protos.google.pubsub.v1.ISeekRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + subscription: request.subscription ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + this._log.info('seek request %j', request); + const wrappedCallback: + | Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('seek response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .seek(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | undefined, + {} | undefined, + ]) => { + this._log.info('seek response %j', response); + return [response, options, rawResponse]; + }, + ); + } + + /** + * Establishes a stream with the server, which sends messages down to the + * client. The client streams acknowledgments and ack deadline modifications + * back to the server. The server will close the stream and return the status + * on any error. The server may close the stream with status `UNAVAILABLE` to + * reassign server-side resources, in which case, the client should + * re-establish the stream. Flow control can be achieved by configuring the + * underlying RPC channel. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.pubsub.v1.StreamingPullRequest|StreamingPullRequest} for write() method, and + * will emit objects representing {@link protos.google.pubsub.v1.StreamingPullResponse|StreamingPullResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + */ + streamingPull(options?: CallOptions): gax.CancellableStream { + this.initialize().catch(err => { + throw err; + }); + this._log.info('streamingPull stream %j', options); + return this.innerApiCalls.streamingPull(null, options); + } + + /** + * Lists matching subscriptions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.pubsub.v1.Subscription|Subscription}. + * 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 `listSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptions( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest | null, + protos.google.pubsub.v1.IListSubscriptionsResponse, + ] + >; + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + >, + ): void; + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + >, + ): void; + listSubscriptions( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + >, + ): Promise< + [ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest | null, + protos.google.pubsub.v1.IListSubscriptionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project: request.project ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSubscriptions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSubscriptions request %j', request); + return this.innerApiCalls + .listSubscriptions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest | null, + protos.google.pubsub.v1.IListSubscriptionsResponse, + ]) => { + this._log.info('listSubscriptions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSubscriptions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * @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.pubsub.v1.Subscription|Subscription} 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 `listSubscriptionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubscriptionsStream( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + 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({ + project: request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSubscriptions stream %j', request); + return this.descriptors.page.listSubscriptions.createStream( + this.innerApiCalls.listSubscriptions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSubscriptions`, 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.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. + * @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.pubsub.v1.Subscription|Subscription}. 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. + */ + listSubscriptionsAsync( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + 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({ + project: request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSubscriptions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSubscriptions iterate %j', request); + return this.descriptors.page.listSubscriptions.asyncIterate( + this.innerApiCalls['listSubscriptions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists the existing snapshots. Snapshots are used in [Seek]( + * https://cloud.google.com/pubsub/docs/replay-overview) operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set + * the acknowledgment state of messages in an existing subscription to the + * state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.pubsub.v1.Snapshot|Snapshot}. + * 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 `listSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshots( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest | null, + protos.google.pubsub.v1.IListSnapshotsResponse, + ] + >; + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + >, + ): void; + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + >, + ): void; + listSnapshots( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + >, + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest | null, + protos.google.pubsub.v1.IListSnapshotsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project: request.project ?? '', + }); + this.initialize().catch(err => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSnapshots values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSnapshots request %j', request); + return this.innerApiCalls + .listSnapshots(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest | null, + protos.google.pubsub.v1.IListSnapshotsResponse, + ]) => { + this._log.info('listSnapshots values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSnapshots`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * @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.pubsub.v1.Snapshot|Snapshot} 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 `listSnapshotsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSnapshotsStream( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + 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({ + project: request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSnapshots stream %j', request); + return this.descriptors.page.listSnapshots.createStream( + this.innerApiCalls.listSnapshots as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSnapshots`, 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.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. + * @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.pubsub.v1.Snapshot|Snapshot}. 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. + */ + listSnapshotsAsync( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + 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({ + project: request.project ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => { + throw err; + }); + this._log.info('listSnapshots iterate %j', request); + return this.descriptors.page.listSnapshots.asyncIterate( + this.innerApiCalls['listSnapshots'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project: string, topic: string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .topic; + } + + /** + * Return a fully-qualified schema resource name string. + * + * @param {string} project + * @param {string} schema + * @returns {string} Resource name string. + */ + schemaPath(project: string, schema: string) { + return this.pathTemplates.schemaPathTemplate.render({ + project: project, + schema: schema, + }); + } + + /** + * Parse the project from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).project; + } + + /** + * Parse the schema from Schema resource. + * + * @param {string} schemaName + * A fully-qualified path representing Schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromSchemaName(schemaName: string) { + return this.pathTemplates.schemaPathTemplate.match(schemaName).schema; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project: string, snapshot: string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * 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.subscriberStub && !this._terminated) { + return this.subscriberStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/handwritten/pubsub/src/v1/subscriber_client_config.json b/handwritten/pubsub/src/v1/subscriber_client_config.json new file mode 100644 index 00000000000..a549d3010b7 --- /dev/null +++ b/handwritten/pubsub/src/v1/subscriber_client_config.json @@ -0,0 +1,136 @@ +{ + "interfaces": { + "google.pubsub.v1.Subscriber": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_aborted_unavailable": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "unknown_aborted_internal_unavailable": [ + "UNKNOWN", + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "ABORTED", + "INTERNAL", + "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 + }, + "693222d32e887d96c8faeadca469f7763ccda85a": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 4, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "GetSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "UpdateSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSubscriptions": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "DeleteSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ModifyAckDeadline": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Acknowledge": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Pull": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_internal_unavailable", + "retry_params_name": "default" + }, + "StreamingPull": { + "timeout_millis": 900000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_aborted_internal_unavailable", + "retry_params_name": "693222d32e887d96c8faeadca469f7763ccda85a" + }, + "ModifyPushConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + }, + "CreateSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "Seek": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/handwritten/pubsub/src/v1/subscriber_proto_list.json b/handwritten/pubsub/src/v1/subscriber_proto_list.json new file mode 100644 index 00000000000..91011aec150 --- /dev/null +++ b/handwritten/pubsub/src/v1/subscriber_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/pubsub/v1/pubsub.proto", + "../../protos/google/pubsub/v1/schema.proto" +] diff --git a/handwritten/pubsub/system-test/fixtures/ordered-messages.json b/handwritten/pubsub/system-test/fixtures/ordered-messages.json new file mode 100644 index 00000000000..295ecf88cb8 --- /dev/null +++ b/handwritten/pubsub/system-test/fixtures/ordered-messages.json @@ -0,0 +1,60031 @@ +{ + "input": [ + { + "key": "", + "message": "message1" + }, + { + "key": "AAA", + "message": "message2" + }, + { + "key": "BBB", + "message": "message3" + }, + { + "key": "CCC", + "message": "message4" + }, + { + "key": "DDD", + "message": "message5" + }, + { + "key": "", + "message": "message6" + }, + { + "key": "AAA", + "message": "message7" + }, + { + "key": "BBB", + "message": "message8" + }, + { + "key": "CCC", + "message": "message9" + }, + { + "key": "DDD", + "message": "message10" + }, + { + "key": "", + "message": "message11" + }, + { + "key": "AAA", + "message": "message12" + }, + { + "key": "BBB", + "message": "message13" + }, + { + "key": "CCC", + "message": "message14" + }, + { + "key": "DDD", + "message": "message15" + }, + { + "key": "", + "message": "message16" + }, + { + "key": "AAA", + "message": "message17" + }, + { + "key": "BBB", + "message": "message18" + }, + { + "key": "CCC", + "message": "message19" + }, + { + "key": "DDD", + "message": "message20" + }, + { + "key": "", + "message": "message21" + }, + { + "key": "AAA", + "message": "message22" + }, + { + "key": "BBB", + "message": "message23" + }, + { + "key": "CCC", + "message": "message24" + }, + { + "key": "DDD", + "message": "message25" + }, + { + "key": "", + "message": "message26" + }, + { + "key": "AAA", + "message": "message27" + }, + { + "key": "BBB", + "message": "message28" + }, + { + "key": "CCC", + "message": "message29" + }, + { + "key": "DDD", + "message": "message30" + }, + { + "key": "", + "message": "message31" + }, + { + "key": "AAA", + "message": "message32" + }, + { + "key": "BBB", + "message": "message33" + }, + { + "key": "CCC", + "message": "message34" + }, + { + "key": "DDD", + "message": "message35" + }, + { + "key": "", + "message": "message36" + }, + { + "key": "AAA", + "message": "message37" + }, + { + "key": "BBB", + "message": "message38" + }, + { + "key": "CCC", + "message": "message39" + }, + { + "key": "DDD", + "message": "message40" + }, + { + "key": "", + "message": "message41" + }, + { + "key": "AAA", + "message": "message42" + }, + { + "key": "BBB", + "message": "message43" + }, + { + "key": "CCC", + "message": "message44" + }, + { + "key": "DDD", + "message": "message45" + }, + { + "key": "", + "message": "message46" + }, + { + "key": "AAA", + "message": "message47" + }, + { + "key": "BBB", + "message": "message48" + }, + { + "key": "CCC", + "message": "message49" + }, + { + "key": "DDD", + "message": "message50" + }, + { + "key": "", + "message": "message51" + }, + { + "key": "AAA", + "message": "message52" + }, + { + "key": "BBB", + "message": "message53" + }, + { + "key": "CCC", + "message": "message54" + }, + { + "key": "DDD", + "message": "message55" + }, + { + "key": "", + "message": "message56" + }, + { + "key": "AAA", + "message": "message57" + }, + { + "key": "BBB", + "message": "message58" + }, + { + "key": "CCC", + "message": "message59" + }, + { + "key": "DDD", + "message": "message60" + }, + { + "key": "", + "message": "message61" + }, + { + "key": "AAA", + "message": "message62" + }, + { + "key": "BBB", + "message": "message63" + }, + { + "key": "CCC", + "message": "message64" + }, + { + "key": "DDD", + "message": "message65" + }, + { + "key": "", + "message": "message66" + }, + { + "key": "AAA", + "message": "message67" + }, + { + "key": "BBB", + "message": "message68" + }, + { + "key": "CCC", + "message": "message69" + }, + { + "key": "DDD", + "message": "message70" + }, + { + "key": "", + "message": "message71" + }, + { + "key": "AAA", + "message": "message72" + }, + { + "key": "BBB", + "message": "message73" + }, + { + "key": "CCC", + "message": "message74" + }, + { + "key": "DDD", + "message": "message75" + }, + { + "key": "", + "message": "message76" + }, + { + "key": "AAA", + "message": "message77" + }, + { + "key": "BBB", + "message": "message78" + }, + { + "key": "CCC", + "message": "message79" + }, + { + "key": "DDD", + "message": "message80" + }, + { + "key": "", + "message": "message81" + }, + { + "key": "AAA", + "message": "message82" + }, + { + "key": "BBB", + "message": "message83" + }, + { + "key": "CCC", + "message": "message84" + }, + { + "key": "DDD", + "message": "message85" + }, + { + "key": "", + "message": "message86" + }, + { + "key": "AAA", + "message": "message87" + }, + { + "key": "BBB", + "message": "message88" + }, + { + "key": "CCC", + "message": "message89" + }, + { + "key": "DDD", + "message": "message90" + }, + { + "key": "", + "message": "message91" + }, + { + "key": "AAA", + "message": "message92" + }, + { + "key": "BBB", + "message": "message93" + }, + { + "key": "CCC", + "message": "message94" + }, + { + "key": "DDD", + "message": "message95" + }, + { + "key": "", + "message": "message96" + }, + { + "key": "AAA", + "message": "message97" + }, + { + "key": "BBB", + "message": "message98" + }, + { + "key": "CCC", + "message": "message99" + }, + { + "key": "DDD", + "message": "message100" + }, + { + "key": "", + "message": "message101" + }, + { + "key": "AAA", + "message": "message102" + }, + { + "key": "BBB", + "message": "message103" + }, + { + "key": "CCC", + "message": "message104" + }, + { + "key": "DDD", + "message": "message105" + }, + { + "key": "", + "message": "message106" + }, + { + "key": "AAA", + "message": "message107" + }, + { + "key": "BBB", + "message": "message108" + }, + { + "key": "CCC", + "message": "message109" + }, + { + "key": "DDD", + "message": "message110" + }, + { + "key": "", + "message": "message111" + }, + { + "key": "AAA", + "message": "message112" + }, + { + "key": "BBB", + "message": "message113" + }, + { + "key": "CCC", + "message": "message114" + }, + { + "key": "DDD", + "message": "message115" + }, + { + "key": "", + "message": "message116" + }, + { + "key": "AAA", + "message": "message117" + }, + { + "key": "BBB", + "message": "message118" + }, + { + "key": "CCC", + "message": "message119" + }, + { + "key": "DDD", + "message": "message120" + }, + { + "key": "", + "message": "message121" + }, + { + "key": "AAA", + "message": "message122" + }, + { + "key": "BBB", + "message": "message123" + }, + { + "key": "CCC", + "message": "message124" + }, + { + "key": "DDD", + "message": "message125" + }, + { + "key": "", + "message": "message126" + }, + { + "key": "AAA", + "message": "message127" + }, + { + "key": "BBB", + "message": "message128" + }, + { + "key": "CCC", + "message": "message129" + }, + { + "key": "DDD", + "message": "message130" + }, + { + "key": "", + "message": "message131" + }, + { + "key": "AAA", + "message": "message132" + }, + { + "key": "BBB", + "message": "message133" + }, + { + "key": "CCC", + "message": "message134" + }, + { + "key": "DDD", + "message": "message135" + }, + { + "key": "", + "message": "message136" + }, + { + "key": "AAA", + "message": "message137" + }, + { + "key": "BBB", + "message": "message138" + }, + { + "key": "CCC", + "message": "message139" + }, + { + "key": "DDD", + "message": "message140" + }, + { + "key": "", + "message": "message141" + }, + { + "key": "AAA", + "message": "message142" + }, + { + "key": "BBB", + "message": "message143" + }, + { + "key": "CCC", + "message": "message144" + }, + { + "key": "DDD", + "message": "message145" + }, + { + "key": "", + "message": "message146" + }, + { + "key": "AAA", + "message": "message147" + }, + { + "key": "BBB", + "message": "message148" + }, + { + "key": "CCC", + "message": "message149" + }, + { + "key": "DDD", + "message": "message150" + }, + { + "key": "", + "message": "message151" + }, + { + "key": "AAA", + "message": "message152" + }, + { + "key": "BBB", + "message": "message153" + }, + { + "key": "CCC", + "message": "message154" + }, + { + "key": "DDD", + "message": "message155" + }, + { + "key": "", + "message": "message156" + }, + { + "key": "AAA", + "message": "message157" + }, + { + "key": "BBB", + "message": "message158" + }, + { + "key": "CCC", + "message": "message159" + }, + { + "key": "DDD", + "message": "message160" + }, + { + "key": "", + "message": "message161" + }, + { + "key": "AAA", + "message": "message162" + }, + { + "key": "BBB", + "message": "message163" + }, + { + "key": "CCC", + "message": "message164" + }, + { + "key": "DDD", + "message": "message165" + }, + { + "key": "", + "message": "message166" + }, + { + "key": "AAA", + "message": "message167" + }, + { + "key": "BBB", + "message": "message168" + }, + { + "key": "CCC", + "message": "message169" + }, + { + "key": "DDD", + "message": "message170" + }, + { + "key": "", + "message": "message171" + }, + { + "key": "AAA", + "message": "message172" + }, + { + "key": "BBB", + "message": "message173" + }, + { + "key": "CCC", + "message": "message174" + }, + { + "key": "DDD", + "message": "message175" + }, + { + "key": "", + "message": "message176" + }, + { + "key": "AAA", + "message": "message177" + }, + { + "key": "BBB", + "message": "message178" + }, + { + "key": "CCC", + "message": "message179" + }, + { + "key": "DDD", + "message": "message180" + }, + { + "key": "", + "message": "message181" + }, + { + "key": "AAA", + "message": "message182" + }, + { + "key": "BBB", + "message": "message183" + }, + { + "key": "CCC", + "message": "message184" + }, + { + "key": "DDD", + "message": "message185" + }, + { + "key": "", + "message": "message186" + }, + { + "key": "AAA", + "message": "message187" + }, + { + "key": "BBB", + "message": "message188" + }, + { + "key": "CCC", + "message": "message189" + }, + { + "key": "DDD", + "message": "message190" + }, + { + "key": "", + "message": "message191" + }, + { + "key": "AAA", + "message": "message192" + }, + { + "key": "BBB", + "message": "message193" + }, + { + "key": "CCC", + "message": "message194" + }, + { + "key": "DDD", + "message": "message195" + }, + { + "key": "", + "message": "message196" + }, + { + "key": "AAA", + "message": "message197" + }, + { + "key": "BBB", + "message": "message198" + }, + { + "key": "CCC", + "message": "message199" + }, + { + "key": "DDD", + "message": "message200" + }, + { + "key": "", + "message": "message201" + }, + { + "key": "AAA", + "message": "message202" + }, + { + "key": "BBB", + "message": "message203" + }, + { + "key": "CCC", + "message": "message204" + }, + { + "key": "DDD", + "message": "message205" + }, + { + "key": "", + "message": "message206" + }, + { + "key": "AAA", + "message": "message207" + }, + { + "key": "BBB", + "message": "message208" + }, + { + "key": "CCC", + "message": "message209" + }, + { + "key": "DDD", + "message": "message210" + }, + { + "key": "", + "message": "message211" + }, + { + "key": "AAA", + "message": "message212" + }, + { + "key": "BBB", + "message": "message213" + }, + { + "key": "CCC", + "message": "message214" + }, + { + "key": "DDD", + "message": "message215" + }, + { + "key": "", + "message": "message216" + }, + { + "key": "AAA", + "message": "message217" + }, + { + "key": "BBB", + "message": "message218" + }, + { + "key": "CCC", + "message": "message219" + }, + { + "key": "DDD", + "message": "message220" + }, + { + "key": "", + "message": "message221" + }, + { + "key": "AAA", + "message": "message222" + }, + { + "key": "BBB", + "message": "message223" + }, + { + "key": "CCC", + "message": "message224" + }, + { + "key": "DDD", + "message": "message225" + }, + { + "key": "", + "message": "message226" + }, + { + "key": "AAA", + "message": "message227" + }, + { + "key": "BBB", + "message": "message228" + }, + { + "key": "CCC", + "message": "message229" + }, + { + "key": "DDD", + "message": "message230" + }, + { + "key": "", + "message": "message231" + }, + { + "key": "AAA", + "message": "message232" + }, + { + "key": "BBB", + "message": "message233" + }, + { + "key": "CCC", + "message": "message234" + }, + { + "key": "DDD", + "message": "message235" + }, + { + "key": "", + "message": "message236" + }, + { + "key": "AAA", + "message": "message237" + }, + { + "key": "BBB", + "message": "message238" + }, + { + "key": "CCC", + "message": "message239" + }, + { + "key": "DDD", + "message": "message240" + }, + { + "key": "", + "message": "message241" + }, + { + "key": "AAA", + "message": "message242" + }, + { + "key": "BBB", + "message": "message243" + }, + { + "key": "CCC", + "message": "message244" + }, + { + "key": "DDD", + "message": "message245" + }, + { + "key": "", + "message": "message246" + }, + { + "key": "AAA", + "message": "message247" + }, + { + "key": "BBB", + "message": "message248" + }, + { + "key": "CCC", + "message": "message249" + }, + { + "key": "DDD", + "message": "message250" + }, + { + "key": "", + "message": "message251" + }, + { + "key": "AAA", + "message": "message252" + }, + { + "key": "BBB", + "message": "message253" + }, + { + "key": "CCC", + "message": "message254" + }, + { + "key": "DDD", + "message": "message255" + }, + { + "key": "", + "message": "message256" + }, + { + "key": "AAA", + "message": "message257" + }, + { + "key": "BBB", + "message": "message258" + }, + { + "key": "CCC", + "message": "message259" + }, + { + "key": "DDD", + "message": "message260" + }, + { + "key": "", + "message": "message261" + }, + { + "key": "AAA", + "message": "message262" + }, + { + "key": "BBB", + "message": "message263" + }, + { + "key": "CCC", + "message": "message264" + }, + { + "key": "DDD", + "message": "message265" + }, + { + "key": "", + "message": "message266" + }, + { + "key": "AAA", + "message": "message267" + }, + { + "key": "BBB", + "message": "message268" + }, + { + "key": "CCC", + "message": "message269" + }, + { + "key": "DDD", + "message": "message270" + }, + { + "key": "", + "message": "message271" + }, + { + "key": "AAA", + "message": "message272" + }, + { + "key": "BBB", + "message": "message273" + }, + { + "key": "CCC", + "message": "message274" + }, + { + "key": "DDD", + "message": "message275" + }, + { + "key": "", + "message": "message276" + }, + { + "key": "AAA", + "message": "message277" + }, + { + "key": "BBB", + "message": "message278" + }, + { + "key": "CCC", + "message": "message279" + }, + { + "key": "DDD", + "message": "message280" + }, + { + "key": "", + "message": "message281" + }, + { + "key": "AAA", + "message": "message282" + }, + { + "key": "BBB", + "message": "message283" + }, + { + "key": "CCC", + "message": "message284" + }, + { + "key": "DDD", + "message": "message285" + }, + { + "key": "", + "message": "message286" + }, + { + "key": "AAA", + "message": "message287" + }, + { + "key": "BBB", + "message": "message288" + }, + { + "key": "CCC", + "message": "message289" + }, + { + "key": "DDD", + "message": "message290" + }, + { + "key": "", + "message": "message291" + }, + { + "key": "AAA", + "message": "message292" + }, + { + "key": "BBB", + "message": "message293" + }, + { + "key": "CCC", + "message": "message294" + }, + { + "key": "DDD", + "message": "message295" + }, + { + "key": "", + "message": "message296" + }, + { + "key": "AAA", + "message": "message297" + }, + { + "key": "BBB", + "message": "message298" + }, + { + "key": "CCC", + "message": "message299" + }, + { + "key": "DDD", + "message": "message300" + }, + { + "key": "", + "message": "message301" + }, + { + "key": "AAA", + "message": "message302" + }, + { + "key": "BBB", + "message": "message303" + }, + { + "key": "CCC", + "message": "message304" + }, + { + "key": "DDD", + "message": "message305" + }, + { + "key": "", + "message": "message306" + }, + { + "key": "AAA", + "message": "message307" + }, + { + "key": "BBB", + "message": "message308" + }, + { + "key": "CCC", + "message": "message309" + }, + { + "key": "DDD", + "message": "message310" + }, + { + "key": "", + "message": "message311" + }, + { + "key": "AAA", + "message": "message312" + }, + { + "key": "BBB", + "message": "message313" + }, + { + "key": "CCC", + "message": "message314" + }, + { + "key": "DDD", + "message": "message315" + }, + { + "key": "", + "message": "message316" + }, + { + "key": "AAA", + "message": "message317" + }, + { + "key": "BBB", + "message": "message318" + }, + { + "key": "CCC", + "message": "message319" + }, + { + "key": "DDD", + "message": "message320" + }, + { + "key": "", + "message": "message321" + }, + { + "key": "AAA", + "message": "message322" + }, + { + "key": "BBB", + "message": "message323" + }, + { + "key": "CCC", + "message": "message324" + }, + { + "key": "DDD", + "message": "message325" + }, + { + "key": "", + "message": "message326" + }, + { + "key": "AAA", + "message": "message327" + }, + { + "key": "BBB", + "message": "message328" + }, + { + "key": "CCC", + "message": "message329" + }, + { + "key": "DDD", + "message": "message330" + }, + { + "key": "", + "message": "message331" + }, + { + "key": "AAA", + "message": "message332" + }, + { + "key": "BBB", + "message": "message333" + }, + { + "key": "CCC", + "message": "message334" + }, + { + "key": "DDD", + "message": "message335" + }, + { + "key": "", + "message": "message336" + }, + { + "key": "AAA", + "message": "message337" + }, + { + "key": "BBB", + "message": "message338" + }, + { + "key": "CCC", + "message": "message339" + }, + { + "key": "DDD", + "message": "message340" + }, + { + "key": "", + "message": "message341" + }, + { + "key": "AAA", + "message": "message342" + }, + { + "key": "BBB", + "message": "message343" + }, + { + "key": "CCC", + "message": "message344" + }, + { + "key": "DDD", + "message": "message345" + }, + { + "key": "", + "message": "message346" + }, + { + "key": "AAA", + "message": "message347" + }, + { + "key": "BBB", + "message": "message348" + }, + { + "key": "CCC", + "message": "message349" + }, + { + "key": "DDD", + "message": "message350" + }, + { + "key": "", + "message": "message351" + }, + { + "key": "AAA", + "message": "message352" + }, + { + "key": "BBB", + "message": "message353" + }, + { + "key": "CCC", + "message": "message354" + }, + { + "key": "DDD", + "message": "message355" + }, + { + "key": "", + "message": "message356" + }, + { + "key": "AAA", + "message": "message357" + }, + { + "key": "BBB", + "message": "message358" + }, + { + "key": "CCC", + "message": "message359" + }, + { + "key": "DDD", + "message": "message360" + }, + { + "key": "", + "message": "message361" + }, + { + "key": "AAA", + "message": "message362" + }, + { + "key": "BBB", + "message": "message363" + }, + { + "key": "CCC", + "message": "message364" + }, + { + "key": "DDD", + "message": "message365" + }, + { + "key": "", + "message": "message366" + }, + { + "key": "AAA", + "message": "message367" + }, + { + "key": "BBB", + "message": "message368" + }, + { + "key": "CCC", + "message": "message369" + }, + { + "key": "DDD", + "message": "message370" + }, + { + "key": "", + "message": "message371" + }, + { + "key": "AAA", + "message": "message372" + }, + { + "key": "BBB", + "message": "message373" + }, + { + "key": "CCC", + "message": "message374" + }, + { + "key": "DDD", + "message": "message375" + }, + { + "key": "", + "message": "message376" + }, + { + "key": "AAA", + "message": "message377" + }, + { + "key": "BBB", + "message": "message378" + }, + { + "key": "CCC", + "message": "message379" + }, + { + "key": "DDD", + "message": "message380" + }, + { + "key": "", + "message": "message381" + }, + { + "key": "AAA", + "message": "message382" + }, + { + "key": "BBB", + "message": "message383" + }, + { + "key": "CCC", + "message": "message384" + }, + { + "key": "DDD", + "message": "message385" + }, + { + "key": "", + "message": "message386" + }, + { + "key": "AAA", + "message": "message387" + }, + { + "key": "BBB", + "message": "message388" + }, + { + "key": "CCC", + "message": "message389" + }, + { + "key": "DDD", + "message": "message390" + }, + { + "key": "", + "message": "message391" + }, + { + "key": "AAA", + "message": "message392" + }, + { + "key": "BBB", + "message": "message393" + }, + { + "key": "CCC", + "message": "message394" + }, + { + "key": "DDD", + "message": "message395" + }, + { + "key": "", + "message": "message396" + }, + { + "key": "AAA", + "message": "message397" + }, + { + "key": "BBB", + "message": "message398" + }, + { + "key": "CCC", + "message": "message399" + }, + { + "key": "DDD", + "message": "message400" + }, + { + "key": "", + "message": "message401" + }, + { + "key": "AAA", + "message": "message402" + }, + { + "key": "BBB", + "message": "message403" + }, + { + "key": "CCC", + "message": "message404" + }, + { + "key": "DDD", + "message": "message405" + }, + { + "key": "", + "message": "message406" + }, + { + "key": "AAA", + "message": "message407" + }, + { + "key": "BBB", + "message": "message408" + }, + { + "key": "CCC", + "message": "message409" + }, + { + "key": "DDD", + "message": "message410" + }, + { + "key": "", + "message": "message411" + }, + { + "key": "AAA", + "message": "message412" + }, + { + "key": "BBB", + "message": "message413" + }, + { + "key": "CCC", + "message": "message414" + }, + { + "key": "DDD", + "message": "message415" + }, + { + "key": "", + "message": "message416" + }, + { + "key": "AAA", + "message": "message417" + }, + { + "key": "BBB", + "message": "message418" + }, + { + "key": "CCC", + "message": "message419" + }, + { + "key": "DDD", + "message": "message420" + }, + { + "key": "", + "message": "message421" + }, + { + "key": "AAA", + "message": "message422" + }, + { + "key": "BBB", + "message": "message423" + }, + { + "key": "CCC", + "message": "message424" + }, + { + "key": "DDD", + "message": "message425" + }, + { + "key": "", + "message": "message426" + }, + { + "key": "AAA", + "message": "message427" + }, + { + "key": "BBB", + "message": "message428" + }, + { + "key": "CCC", + "message": "message429" + }, + { + "key": "DDD", + "message": "message430" + }, + { + "key": "", + "message": "message431" + }, + { + "key": "AAA", + "message": "message432" + }, + { + "key": "BBB", + "message": "message433" + }, + { + "key": "CCC", + "message": "message434" + }, + { + "key": "DDD", + "message": "message435" + }, + { + "key": "", + "message": "message436" + }, + { + "key": "AAA", + "message": "message437" + }, + { + "key": "BBB", + "message": "message438" + }, + { + "key": "CCC", + "message": "message439" + }, + { + "key": "DDD", + "message": "message440" + }, + { + "key": "", + "message": "message441" + }, + { + "key": "AAA", + "message": "message442" + }, + { + "key": "BBB", + "message": "message443" + }, + { + "key": "CCC", + "message": "message444" + }, + { + "key": "DDD", + "message": "message445" + }, + { + "key": "", + "message": "message446" + }, + { + "key": "AAA", + "message": "message447" + }, + { + "key": "BBB", + "message": "message448" + }, + { + "key": "CCC", + "message": "message449" + }, + { + "key": "DDD", + "message": "message450" + }, + { + "key": "", + "message": "message451" + }, + { + "key": "AAA", + "message": "message452" + }, + { + "key": "BBB", + "message": "message453" + }, + { + "key": "CCC", + "message": "message454" + }, + { + "key": "DDD", + "message": "message455" + }, + { + "key": "", + "message": "message456" + }, + { + "key": "AAA", + "message": "message457" + }, + { + "key": "BBB", + "message": "message458" + }, + { + "key": "CCC", + "message": "message459" + }, + { + "key": "DDD", + "message": "message460" + }, + { + "key": "", + "message": "message461" + }, + { + "key": "AAA", + "message": "message462" + }, + { + "key": "BBB", + "message": "message463" + }, + { + "key": "CCC", + "message": "message464" + }, + { + "key": "DDD", + "message": "message465" + }, + { + "key": "", + "message": "message466" + }, + { + "key": "AAA", + "message": "message467" + }, + { + "key": "BBB", + "message": "message468" + }, + { + "key": "CCC", + "message": "message469" + }, + { + "key": "DDD", + "message": "message470" + }, + { + "key": "", + "message": "message471" + }, + { + "key": "AAA", + "message": "message472" + }, + { + "key": "BBB", + "message": "message473" + }, + { + "key": "CCC", + "message": "message474" + }, + { + "key": "DDD", + "message": "message475" + }, + { + "key": "", + "message": "message476" + }, + { + "key": "AAA", + "message": "message477" + }, + { + "key": "BBB", + "message": "message478" + }, + { + "key": "CCC", + "message": "message479" + }, + { + "key": "DDD", + "message": "message480" + }, + { + "key": "", + "message": "message481" + }, + { + "key": "AAA", + "message": "message482" + }, + { + "key": "BBB", + "message": "message483" + }, + { + "key": "CCC", + "message": "message484" + }, + { + "key": "DDD", + "message": "message485" + }, + { + "key": "", + "message": "message486" + }, + { + "key": "AAA", + "message": "message487" + }, + { + "key": "BBB", + "message": "message488" + }, + { + "key": "CCC", + "message": "message489" + }, + { + "key": "DDD", + "message": "message490" + }, + { + "key": "", + "message": "message491" + }, + { + "key": "AAA", + "message": "message492" + }, + { + "key": "BBB", + "message": "message493" + }, + { + "key": "CCC", + "message": "message494" + }, + { + "key": "DDD", + "message": "message495" + }, + { + "key": "", + "message": "message496" + }, + { + "key": "AAA", + "message": "message497" + }, + { + "key": "BBB", + "message": "message498" + }, + { + "key": "CCC", + "message": "message499" + }, + { + "key": "DDD", + "message": "message500" + }, + { + "key": "", + "message": "message501" + }, + { + "key": "AAA", + "message": "message502" + }, + { + "key": "BBB", + "message": "message503" + }, + { + "key": "CCC", + "message": "message504" + }, + { + "key": "DDD", + "message": "message505" + }, + { + "key": "", + "message": "message506" + }, + { + "key": "AAA", + "message": "message507" + }, + { + "key": "BBB", + "message": "message508" + }, + { + "key": "CCC", + "message": "message509" + }, + { + "key": "DDD", + "message": "message510" + }, + { + "key": "", + "message": "message511" + }, + { + "key": "AAA", + "message": "message512" + }, + { + "key": "BBB", + "message": "message513" + }, + { + "key": "CCC", + "message": "message514" + }, + { + "key": "DDD", + "message": "message515" + }, + { + "key": "", + "message": "message516" + }, + { + "key": "AAA", + "message": "message517" + }, + { + "key": "BBB", + "message": "message518" + }, + { + "key": "CCC", + "message": "message519" + }, + { + "key": "DDD", + "message": "message520" + }, + { + "key": "", + "message": "message521" + }, + { + "key": "AAA", + "message": "message522" + }, + { + "key": "BBB", + "message": "message523" + }, + { + "key": "CCC", + "message": "message524" + }, + { + "key": "DDD", + "message": "message525" + }, + { + "key": "", + "message": "message526" + }, + { + "key": "AAA", + "message": "message527" + }, + { + "key": "BBB", + "message": "message528" + }, + { + "key": "CCC", + "message": "message529" + }, + { + "key": "DDD", + "message": "message530" + }, + { + "key": "", + "message": "message531" + }, + { + "key": "AAA", + "message": "message532" + }, + { + "key": "BBB", + "message": "message533" + }, + { + "key": "CCC", + "message": "message534" + }, + { + "key": "DDD", + "message": "message535" + }, + { + "key": "", + "message": "message536" + }, + { + "key": "AAA", + "message": "message537" + }, + { + "key": "BBB", + "message": "message538" + }, + { + "key": "CCC", + "message": "message539" + }, + { + "key": "DDD", + "message": "message540" + }, + { + "key": "", + "message": "message541" + }, + { + "key": "AAA", + "message": "message542" + }, + { + "key": "BBB", + "message": "message543" + }, + { + "key": "CCC", + "message": "message544" + }, + { + "key": "DDD", + "message": "message545" + }, + { + "key": "", + "message": "message546" + }, + { + "key": "AAA", + "message": "message547" + }, + { + "key": "BBB", + "message": "message548" + }, + { + "key": "CCC", + "message": "message549" + }, + { + "key": "DDD", + "message": "message550" + }, + { + "key": "", + "message": "message551" + }, + { + "key": "AAA", + "message": "message552" + }, + { + "key": "BBB", + "message": "message553" + }, + { + "key": "CCC", + "message": "message554" + }, + { + "key": "DDD", + "message": "message555" + }, + { + "key": "", + "message": "message556" + }, + { + "key": "AAA", + "message": "message557" + }, + { + "key": "BBB", + "message": "message558" + }, + { + "key": "CCC", + "message": "message559" + }, + { + "key": "DDD", + "message": "message560" + }, + { + "key": "", + "message": "message561" + }, + { + "key": "AAA", + "message": "message562" + }, + { + "key": "BBB", + "message": "message563" + }, + { + "key": "CCC", + "message": "message564" + }, + { + "key": "DDD", + "message": "message565" + }, + { + "key": "", + "message": "message566" + }, + { + "key": "AAA", + "message": "message567" + }, + { + "key": "BBB", + "message": "message568" + }, + { + "key": "CCC", + "message": "message569" + }, + { + "key": "DDD", + "message": "message570" + }, + { + "key": "", + "message": "message571" + }, + { + "key": "AAA", + "message": "message572" + }, + { + "key": "BBB", + "message": "message573" + }, + { + "key": "CCC", + "message": "message574" + }, + { + "key": "DDD", + "message": "message575" + }, + { + "key": "", + "message": "message576" + }, + { + "key": "AAA", + "message": "message577" + }, + { + "key": "BBB", + "message": "message578" + }, + { + "key": "CCC", + "message": "message579" + }, + { + "key": "DDD", + "message": "message580" + }, + { + "key": "", + "message": "message581" + }, + { + "key": "AAA", + "message": "message582" + }, + { + "key": "BBB", + "message": "message583" + }, + { + "key": "CCC", + "message": "message584" + }, + { + "key": "DDD", + "message": "message585" + }, + { + "key": "", + "message": "message586" + }, + { + "key": "AAA", + "message": "message587" + }, + { + "key": "BBB", + "message": "message588" + }, + { + "key": "CCC", + "message": "message589" + }, + { + "key": "DDD", + "message": "message590" + }, + { + "key": "", + "message": "message591" + }, + { + "key": "AAA", + "message": "message592" + }, + { + "key": "BBB", + "message": "message593" + }, + { + "key": "CCC", + "message": "message594" + }, + { + "key": "DDD", + "message": "message595" + }, + { + "key": "", + "message": "message596" + }, + { + "key": "AAA", + "message": "message597" + }, + { + "key": "BBB", + "message": "message598" + }, + { + "key": "CCC", + "message": "message599" + }, + { + "key": "DDD", + "message": "message600" + }, + { + "key": "", + "message": "message601" + }, + { + "key": "AAA", + "message": "message602" + }, + { + "key": "BBB", + "message": "message603" + }, + { + "key": "CCC", + "message": "message604" + }, + { + "key": "DDD", + "message": "message605" + }, + { + "key": "", + "message": "message606" + }, + { + "key": "AAA", + "message": "message607" + }, + { + "key": "BBB", + "message": "message608" + }, + { + "key": "CCC", + "message": "message609" + }, + { + "key": "DDD", + "message": "message610" + }, + { + "key": "", + "message": "message611" + }, + { + "key": "AAA", + "message": "message612" + }, + { + "key": "BBB", + "message": "message613" + }, + { + "key": "CCC", + "message": "message614" + }, + { + "key": "DDD", + "message": "message615" + }, + { + "key": "", + "message": "message616" + }, + { + "key": "AAA", + "message": "message617" + }, + { + "key": "BBB", + "message": "message618" + }, + { + "key": "CCC", + "message": "message619" + }, + { + "key": "DDD", + "message": "message620" + }, + { + "key": "", + "message": "message621" + }, + { + "key": "AAA", + "message": "message622" + }, + { + "key": "BBB", + "message": "message623" + }, + { + "key": "CCC", + "message": "message624" + }, + { + "key": "DDD", + "message": "message625" + }, + { + "key": "", + "message": "message626" + }, + { + "key": "AAA", + "message": "message627" + }, + { + "key": "BBB", + "message": "message628" + }, + { + "key": "CCC", + "message": "message629" + }, + { + "key": "DDD", + "message": "message630" + }, + { + "key": "", + "message": "message631" + }, + { + "key": "AAA", + "message": "message632" + }, + { + "key": "BBB", + "message": "message633" + }, + { + "key": "CCC", + "message": "message634" + }, + { + "key": "DDD", + "message": "message635" + }, + { + "key": "", + "message": "message636" + }, + { + "key": "AAA", + "message": "message637" + }, + { + "key": "BBB", + "message": "message638" + }, + { + "key": "CCC", + "message": "message639" + }, + { + "key": "DDD", + "message": "message640" + }, + { + "key": "", + "message": "message641" + }, + { + "key": "AAA", + "message": "message642" + }, + { + "key": "BBB", + "message": "message643" + }, + { + "key": "CCC", + "message": "message644" + }, + { + "key": "DDD", + "message": "message645" + }, + { + "key": "", + "message": "message646" + }, + { + "key": "AAA", + "message": "message647" + }, + { + "key": "BBB", + "message": "message648" + }, + { + "key": "CCC", + "message": "message649" + }, + { + "key": "DDD", + "message": "message650" + }, + { + "key": "", + "message": "message651" + }, + { + "key": "AAA", + "message": "message652" + }, + { + "key": "BBB", + "message": "message653" + }, + { + "key": "CCC", + "message": "message654" + }, + { + "key": "DDD", + "message": "message655" + }, + { + "key": "", + "message": "message656" + }, + { + "key": "AAA", + "message": "message657" + }, + { + "key": "BBB", + "message": "message658" + }, + { + "key": "CCC", + "message": "message659" + }, + { + "key": "DDD", + "message": "message660" + }, + { + "key": "", + "message": "message661" + }, + { + "key": "AAA", + "message": "message662" + }, + { + "key": "BBB", + "message": "message663" + }, + { + "key": "CCC", + "message": "message664" + }, + { + "key": "DDD", + "message": "message665" + }, + { + "key": "", + "message": "message666" + }, + { + "key": "AAA", + "message": "message667" + }, + { + "key": "BBB", + "message": "message668" + }, + { + "key": "CCC", + "message": "message669" + }, + { + "key": "DDD", + "message": "message670" + }, + { + "key": "", + "message": "message671" + }, + { + "key": "AAA", + "message": "message672" + }, + { + "key": "BBB", + "message": "message673" + }, + { + "key": "CCC", + "message": "message674" + }, + { + "key": "DDD", + "message": "message675" + }, + { + "key": "", + "message": "message676" + }, + { + "key": "AAA", + "message": "message677" + }, + { + "key": "BBB", + "message": "message678" + }, + { + "key": "CCC", + "message": "message679" + }, + { + "key": "DDD", + "message": "message680" + }, + { + "key": "", + "message": "message681" + }, + { + "key": "AAA", + "message": "message682" + }, + { + "key": "BBB", + "message": "message683" + }, + { + "key": "CCC", + "message": "message684" + }, + { + "key": "DDD", + "message": "message685" + }, + { + "key": "", + "message": "message686" + }, + { + "key": "AAA", + "message": "message687" + }, + { + "key": "BBB", + "message": "message688" + }, + { + "key": "CCC", + "message": "message689" + }, + { + "key": "DDD", + "message": "message690" + }, + { + "key": "", + "message": "message691" + }, + { + "key": "AAA", + "message": "message692" + }, + { + "key": "BBB", + "message": "message693" + }, + { + "key": "CCC", + "message": "message694" + }, + { + "key": "DDD", + "message": "message695" + }, + { + "key": "", + "message": "message696" + }, + { + "key": "AAA", + "message": "message697" + }, + { + "key": "BBB", + "message": "message698" + }, + { + "key": "CCC", + "message": "message699" + }, + { + "key": "DDD", + "message": "message700" + }, + { + "key": "", + "message": "message701" + }, + { + "key": "AAA", + "message": "message702" + }, + { + "key": "BBB", + "message": "message703" + }, + { + "key": "CCC", + "message": "message704" + }, + { + "key": "DDD", + "message": "message705" + }, + { + "key": "", + "message": "message706" + }, + { + "key": "AAA", + "message": "message707" + }, + { + "key": "BBB", + "message": "message708" + }, + { + "key": "CCC", + "message": "message709" + }, + { + "key": "DDD", + "message": "message710" + }, + { + "key": "", + "message": "message711" + }, + { + "key": "AAA", + "message": "message712" + }, + { + "key": "BBB", + "message": "message713" + }, + { + "key": "CCC", + "message": "message714" + }, + { + "key": "DDD", + "message": "message715" + }, + { + "key": "", + "message": "message716" + }, + { + "key": "AAA", + "message": "message717" + }, + { + "key": "BBB", + "message": "message718" + }, + { + "key": "CCC", + "message": "message719" + }, + { + "key": "DDD", + "message": "message720" + }, + { + "key": "", + "message": "message721" + }, + { + "key": "AAA", + "message": "message722" + }, + { + "key": "BBB", + "message": "message723" + }, + { + "key": "CCC", + "message": "message724" + }, + { + "key": "DDD", + "message": "message725" + }, + { + "key": "", + "message": "message726" + }, + { + "key": "AAA", + "message": "message727" + }, + { + "key": "BBB", + "message": "message728" + }, + { + "key": "CCC", + "message": "message729" + }, + { + "key": "DDD", + "message": "message730" + }, + { + "key": "", + "message": "message731" + }, + { + "key": "AAA", + "message": "message732" + }, + { + "key": "BBB", + "message": "message733" + }, + { + "key": "CCC", + "message": "message734" + }, + { + "key": "DDD", + "message": "message735" + }, + { + "key": "", + "message": "message736" + }, + { + "key": "AAA", + "message": "message737" + }, + { + "key": "BBB", + "message": "message738" + }, + { + "key": "CCC", + "message": "message739" + }, + { + "key": "DDD", + "message": "message740" + }, + { + "key": "", + "message": "message741" + }, + { + "key": "AAA", + "message": "message742" + }, + { + "key": "BBB", + "message": "message743" + }, + { + "key": "CCC", + "message": "message744" + }, + { + "key": "DDD", + "message": "message745" + }, + { + "key": "", + "message": "message746" + }, + { + "key": "AAA", + "message": "message747" + }, + { + "key": "BBB", + "message": "message748" + }, + { + "key": "CCC", + "message": "message749" + }, + { + "key": "DDD", + "message": "message750" + }, + { + "key": "", + "message": "message751" + }, + { + "key": "AAA", + "message": "message752" + }, + { + "key": "BBB", + "message": "message753" + }, + { + "key": "CCC", + "message": "message754" + }, + { + "key": "DDD", + "message": "message755" + }, + { + "key": "", + "message": "message756" + }, + { + "key": "AAA", + "message": "message757" + }, + { + "key": "BBB", + "message": "message758" + }, + { + "key": "CCC", + "message": "message759" + }, + { + "key": "DDD", + "message": "message760" + }, + { + "key": "", + "message": "message761" + }, + { + "key": "AAA", + "message": "message762" + }, + { + "key": "BBB", + "message": "message763" + }, + { + "key": "CCC", + "message": "message764" + }, + { + "key": "DDD", + "message": "message765" + }, + { + "key": "", + "message": "message766" + }, + { + "key": "AAA", + "message": "message767" + }, + { + "key": "BBB", + "message": "message768" + }, + { + "key": "CCC", + "message": "message769" + }, + { + "key": "DDD", + "message": "message770" + }, + { + "key": "", + "message": "message771" + }, + { + "key": "AAA", + "message": "message772" + }, + { + "key": "BBB", + "message": "message773" + }, + { + "key": "CCC", + "message": "message774" + }, + { + "key": "DDD", + "message": "message775" + }, + { + "key": "", + "message": "message776" + }, + { + "key": "AAA", + "message": "message777" + }, + { + "key": "BBB", + "message": "message778" + }, + { + "key": "CCC", + "message": "message779" + }, + { + "key": "DDD", + "message": "message780" + }, + { + "key": "", + "message": "message781" + }, + { + "key": "AAA", + "message": "message782" + }, + { + "key": "BBB", + "message": "message783" + }, + { + "key": "CCC", + "message": "message784" + }, + { + "key": "DDD", + "message": "message785" + }, + { + "key": "", + "message": "message786" + }, + { + "key": "AAA", + "message": "message787" + }, + { + "key": "BBB", + "message": "message788" + }, + { + "key": "CCC", + "message": "message789" + }, + { + "key": "DDD", + "message": "message790" + }, + { + "key": "", + "message": "message791" + }, + { + "key": "AAA", + "message": "message792" + }, + { + "key": "BBB", + "message": "message793" + }, + { + "key": "CCC", + "message": "message794" + }, + { + "key": "DDD", + "message": "message795" + }, + { + "key": "", + "message": "message796" + }, + { + "key": "AAA", + "message": "message797" + }, + { + "key": "BBB", + "message": "message798" + }, + { + "key": "CCC", + "message": "message799" + }, + { + "key": "DDD", + "message": "message800" + }, + { + "key": "", + "message": "message801" + }, + { + "key": "AAA", + "message": "message802" + }, + { + "key": "BBB", + "message": "message803" + }, + { + "key": "CCC", + "message": "message804" + }, + { + "key": "DDD", + "message": "message805" + }, + { + "key": "", + "message": "message806" + }, + { + "key": "AAA", + "message": "message807" + }, + { + "key": "BBB", + "message": "message808" + }, + { + "key": "CCC", + "message": "message809" + }, + { + "key": "DDD", + "message": "message810" + }, + { + "key": "", + "message": "message811" + }, + { + "key": "AAA", + "message": "message812" + }, + { + "key": "BBB", + "message": "message813" + }, + { + "key": "CCC", + "message": "message814" + }, + { + "key": "DDD", + "message": "message815" + }, + { + "key": "", + "message": "message816" + }, + { + "key": "AAA", + "message": "message817" + }, + { + "key": "BBB", + "message": "message818" + }, + { + "key": "CCC", + "message": "message819" + }, + { + "key": "DDD", + "message": "message820" + }, + { + "key": "", + "message": "message821" + }, + { + "key": "AAA", + "message": "message822" + }, + { + "key": "BBB", + "message": "message823" + }, + { + "key": "CCC", + "message": "message824" + }, + { + "key": "DDD", + "message": "message825" + }, + { + "key": "", + "message": "message826" + }, + { + "key": "AAA", + "message": "message827" + }, + { + "key": "BBB", + "message": "message828" + }, + { + "key": "CCC", + "message": "message829" + }, + { + "key": "DDD", + "message": "message830" + }, + { + "key": "", + "message": "message831" + }, + { + "key": "AAA", + "message": "message832" + }, + { + "key": "BBB", + "message": "message833" + }, + { + "key": "CCC", + "message": "message834" + }, + { + "key": "DDD", + "message": "message835" + }, + { + "key": "", + "message": "message836" + }, + { + "key": "AAA", + "message": "message837" + }, + { + "key": "BBB", + "message": "message838" + }, + { + "key": "CCC", + "message": "message839" + }, + { + "key": "DDD", + "message": "message840" + }, + { + "key": "", + "message": "message841" + }, + { + "key": "AAA", + "message": "message842" + }, + { + "key": "BBB", + "message": "message843" + }, + { + "key": "CCC", + "message": "message844" + }, + { + "key": "DDD", + "message": "message845" + }, + { + "key": "", + "message": "message846" + }, + { + "key": "AAA", + "message": "message847" + }, + { + "key": "BBB", + "message": "message848" + }, + { + "key": "CCC", + "message": "message849" + }, + { + "key": "DDD", + "message": "message850" + }, + { + "key": "", + "message": "message851" + }, + { + "key": "AAA", + "message": "message852" + }, + { + "key": "BBB", + "message": "message853" + }, + { + "key": "CCC", + "message": "message854" + }, + { + "key": "DDD", + "message": "message855" + }, + { + "key": "", + "message": "message856" + }, + { + "key": "AAA", + "message": "message857" + }, + { + "key": "BBB", + "message": "message858" + }, + { + "key": "CCC", + "message": "message859" + }, + { + "key": "DDD", + "message": "message860" + }, + { + "key": "", + "message": "message861" + }, + { + "key": "AAA", + "message": "message862" + }, + { + "key": "BBB", + "message": "message863" + }, + { + "key": "CCC", + "message": "message864" + }, + { + "key": "DDD", + "message": "message865" + }, + { + "key": "", + "message": "message866" + }, + { + "key": "AAA", + "message": "message867" + }, + { + "key": "BBB", + "message": "message868" + }, + { + "key": "CCC", + "message": "message869" + }, + { + "key": "DDD", + "message": "message870" + }, + { + "key": "", + "message": "message871" + }, + { + "key": "AAA", + "message": "message872" + }, + { + "key": "BBB", + "message": "message873" + }, + { + "key": "CCC", + "message": "message874" + }, + { + "key": "DDD", + "message": "message875" + }, + { + "key": "", + "message": "message876" + }, + { + "key": "AAA", + "message": "message877" + }, + { + "key": "BBB", + "message": "message878" + }, + { + "key": "CCC", + "message": "message879" + }, + { + "key": "DDD", + "message": "message880" + }, + { + "key": "", + "message": "message881" + }, + { + "key": "AAA", + "message": "message882" + }, + { + "key": "BBB", + "message": "message883" + }, + { + "key": "CCC", + "message": "message884" + }, + { + "key": "DDD", + "message": "message885" + }, + { + "key": "", + "message": "message886" + }, + { + "key": "AAA", + "message": "message887" + }, + { + "key": "BBB", + "message": "message888" + }, + { + "key": "CCC", + "message": "message889" + }, + { + "key": "DDD", + "message": "message890" + }, + { + "key": "", + "message": "message891" + }, + { + "key": "AAA", + "message": "message892" + }, + { + "key": "BBB", + "message": "message893" + }, + { + "key": "CCC", + "message": "message894" + }, + { + "key": "DDD", + "message": "message895" + }, + { + "key": "", + "message": "message896" + }, + { + "key": "AAA", + "message": "message897" + }, + { + "key": "BBB", + "message": "message898" + }, + { + "key": "CCC", + "message": "message899" + }, + { + "key": "DDD", + "message": "message900" + }, + { + "key": "", + "message": "message901" + }, + { + "key": "AAA", + "message": "message902" + }, + { + "key": "BBB", + "message": "message903" + }, + { + "key": "CCC", + "message": "message904" + }, + { + "key": "DDD", + "message": "message905" + }, + { + "key": "", + "message": "message906" + }, + { + "key": "AAA", + "message": "message907" + }, + { + "key": "BBB", + "message": "message908" + }, + { + "key": "CCC", + "message": "message909" + }, + { + "key": "DDD", + "message": "message910" + }, + { + "key": "", + "message": "message911" + }, + { + "key": "AAA", + "message": "message912" + }, + { + "key": "BBB", + "message": "message913" + }, + { + "key": "CCC", + "message": "message914" + }, + { + "key": "DDD", + "message": "message915" + }, + { + "key": "", + "message": "message916" + }, + { + "key": "AAA", + "message": "message917" + }, + { + "key": "BBB", + "message": "message918" + }, + { + "key": "CCC", + "message": "message919" + }, + { + "key": "DDD", + "message": "message920" + }, + { + "key": "", + "message": "message921" + }, + { + "key": "AAA", + "message": "message922" + }, + { + "key": "BBB", + "message": "message923" + }, + { + "key": "CCC", + "message": "message924" + }, + { + "key": "DDD", + "message": "message925" + }, + { + "key": "", + "message": "message926" + }, + { + "key": "AAA", + "message": "message927" + }, + { + "key": "BBB", + "message": "message928" + }, + { + "key": "CCC", + "message": "message929" + }, + { + "key": "DDD", + "message": "message930" + }, + { + "key": "", + "message": "message931" + }, + { + "key": "AAA", + "message": "message932" + }, + { + "key": "BBB", + "message": "message933" + }, + { + "key": "CCC", + "message": "message934" + }, + { + "key": "DDD", + "message": "message935" + }, + { + "key": "", + "message": "message936" + }, + { + "key": "AAA", + "message": "message937" + }, + { + "key": "BBB", + "message": "message938" + }, + { + "key": "CCC", + "message": "message939" + }, + { + "key": "DDD", + "message": "message940" + }, + { + "key": "", + "message": "message941" + }, + { + "key": "AAA", + "message": "message942" + }, + { + "key": "BBB", + "message": "message943" + }, + { + "key": "CCC", + "message": "message944" + }, + { + "key": "DDD", + "message": "message945" + }, + { + "key": "", + "message": "message946" + }, + { + "key": "AAA", + "message": "message947" + }, + { + "key": "BBB", + "message": "message948" + }, + { + "key": "CCC", + "message": "message949" + }, + { + "key": "DDD", + "message": "message950" + }, + { + "key": "", + "message": "message951" + }, + { + "key": "AAA", + "message": "message952" + }, + { + "key": "BBB", + "message": "message953" + }, + { + "key": "CCC", + "message": "message954" + }, + { + "key": "DDD", + "message": "message955" + }, + { + "key": "", + "message": "message956" + }, + { + "key": "AAA", + "message": "message957" + }, + { + "key": "BBB", + "message": "message958" + }, + { + "key": "CCC", + "message": "message959" + }, + { + "key": "DDD", + "message": "message960" + }, + { + "key": "", + "message": "message961" + }, + { + "key": "AAA", + "message": "message962" + }, + { + "key": "BBB", + "message": "message963" + }, + { + "key": "CCC", + "message": "message964" + }, + { + "key": "DDD", + "message": "message965" + }, + { + "key": "", + "message": "message966" + }, + { + "key": "AAA", + "message": "message967" + }, + { + "key": "BBB", + "message": "message968" + }, + { + "key": "CCC", + "message": "message969" + }, + { + "key": "DDD", + "message": "message970" + }, + { + "key": "", + "message": "message971" + }, + { + "key": "AAA", + "message": "message972" + }, + { + "key": "BBB", + "message": "message973" + }, + { + "key": "CCC", + "message": "message974" + }, + { + "key": "DDD", + "message": "message975" + }, + { + "key": "", + "message": "message976" + }, + { + "key": "AAA", + "message": "message977" + }, + { + "key": "BBB", + "message": "message978" + }, + { + "key": "CCC", + "message": "message979" + }, + { + "key": "DDD", + "message": "message980" + }, + { + "key": "", + "message": "message981" + }, + { + "key": "AAA", + "message": "message982" + }, + { + "key": "BBB", + "message": "message983" + }, + { + "key": "CCC", + "message": "message984" + }, + { + "key": "DDD", + "message": "message985" + }, + { + "key": "", + "message": "message986" + }, + { + "key": "AAA", + "message": "message987" + }, + { + "key": "BBB", + "message": "message988" + }, + { + "key": "CCC", + "message": "message989" + }, + { + "key": "DDD", + "message": "message990" + }, + { + "key": "", + "message": "message991" + }, + { + "key": "AAA", + "message": "message992" + }, + { + "key": "BBB", + "message": "message993" + }, + { + "key": "CCC", + "message": "message994" + }, + { + "key": "DDD", + "message": "message995" + }, + { + "key": "", + "message": "message996" + }, + { + "key": "AAA", + "message": "message997" + }, + { + "key": "BBB", + "message": "message998" + }, + { + "key": "CCC", + "message": "message999" + }, + { + "key": "DDD", + "message": "message1000" + }, + { + "key": "", + "message": "message1001" + }, + { + "key": "AAA", + "message": "message1002" + }, + { + "key": "BBB", + "message": "message1003" + }, + { + "key": "CCC", + "message": "message1004" + }, + { + "key": "DDD", + "message": "message1005" + }, + { + "key": "", + "message": "message1006" + }, + { + "key": "AAA", + "message": "message1007" + }, + { + "key": "BBB", + "message": "message1008" + }, + { + "key": "CCC", + "message": "message1009" + }, + { + "key": "DDD", + "message": "message1010" + }, + { + "key": "", + "message": "message1011" + }, + { + "key": "AAA", + "message": "message1012" + }, + { + "key": "BBB", + "message": "message1013" + }, + { + "key": "CCC", + "message": "message1014" + }, + { + "key": "DDD", + "message": "message1015" + }, + { + "key": "", + "message": "message1016" + }, + { + "key": "AAA", + "message": "message1017" + }, + { + "key": "BBB", + "message": "message1018" + }, + { + "key": "CCC", + "message": "message1019" + }, + { + "key": "DDD", + "message": "message1020" + }, + { + "key": "", + "message": "message1021" + }, + { + "key": "AAA", + "message": "message1022" + }, + { + "key": "BBB", + "message": "message1023" + }, + { + "key": "CCC", + "message": "message1024" + }, + { + "key": "DDD", + "message": "message1025" + }, + { + "key": "", + "message": "message1026" + }, + { + "key": "AAA", + "message": "message1027" + }, + { + "key": "BBB", + "message": "message1028" + }, + { + "key": "CCC", + "message": "message1029" + }, + { + "key": "DDD", + "message": "message1030" + }, + { + "key": "", + "message": "message1031" + }, + { + "key": "AAA", + "message": "message1032" + }, + { + "key": "BBB", + "message": "message1033" + }, + { + "key": "CCC", + "message": "message1034" + }, + { + "key": "DDD", + "message": "message1035" + }, + { + "key": "", + "message": "message1036" + }, + { + "key": "AAA", + "message": "message1037" + }, + { + "key": "BBB", + "message": "message1038" + }, + { + "key": "CCC", + "message": "message1039" + }, + { + "key": "DDD", + "message": "message1040" + }, + { + "key": "", + "message": "message1041" + }, + { + "key": "AAA", + "message": "message1042" + }, + { + "key": "BBB", + "message": "message1043" + }, + { + "key": "CCC", + "message": "message1044" + }, + { + "key": "DDD", + "message": "message1045" + }, + { + "key": "", + "message": "message1046" + }, + { + "key": "AAA", + "message": "message1047" + }, + { + "key": "BBB", + "message": "message1048" + }, + { + "key": "CCC", + "message": "message1049" + }, + { + "key": "DDD", + "message": "message1050" + }, + { + "key": "", + "message": "message1051" + }, + { + "key": "AAA", + "message": "message1052" + }, + { + "key": "BBB", + "message": "message1053" + }, + { + "key": "CCC", + "message": "message1054" + }, + { + "key": "DDD", + "message": "message1055" + }, + { + "key": "", + "message": "message1056" + }, + { + "key": "AAA", + "message": "message1057" + }, + { + "key": "BBB", + "message": "message1058" + }, + { + "key": "CCC", + "message": "message1059" + }, + { + "key": "DDD", + "message": "message1060" + }, + { + "key": "", + "message": "message1061" + }, + { + "key": "AAA", + "message": "message1062" + }, + { + "key": "BBB", + "message": "message1063" + }, + { + "key": "CCC", + "message": "message1064" + }, + { + "key": "DDD", + "message": "message1065" + }, + { + "key": "", + "message": "message1066" + }, + { + "key": "AAA", + "message": "message1067" + }, + { + "key": "BBB", + "message": "message1068" + }, + { + "key": "CCC", + "message": "message1069" + }, + { + "key": "DDD", + "message": "message1070" + }, + { + "key": "", + "message": "message1071" + }, + { + "key": "AAA", + "message": "message1072" + }, + { + "key": "BBB", + "message": "message1073" + }, + { + "key": "CCC", + "message": "message1074" + }, + { + "key": "DDD", + "message": "message1075" + }, + { + "key": "", + "message": "message1076" + }, + { + "key": "AAA", + "message": "message1077" + }, + { + "key": "BBB", + "message": "message1078" + }, + { + "key": "CCC", + "message": "message1079" + }, + { + "key": "DDD", + "message": "message1080" + }, + { + "key": "", + "message": "message1081" + }, + { + "key": "AAA", + "message": "message1082" + }, + { + "key": "BBB", + "message": "message1083" + }, + { + "key": "CCC", + "message": "message1084" + }, + { + "key": "DDD", + "message": "message1085" + }, + { + "key": "", + "message": "message1086" + }, + { + "key": "AAA", + "message": "message1087" + }, + { + "key": "BBB", + "message": "message1088" + }, + { + "key": "CCC", + "message": "message1089" + }, + { + "key": "DDD", + "message": "message1090" + }, + { + "key": "", + "message": "message1091" + }, + { + "key": "AAA", + "message": "message1092" + }, + { + "key": "BBB", + "message": "message1093" + }, + { + "key": "CCC", + "message": "message1094" + }, + { + "key": "DDD", + "message": "message1095" + }, + { + "key": "", + "message": "message1096" + }, + { + "key": "AAA", + "message": "message1097" + }, + { + "key": "BBB", + "message": "message1098" + }, + { + "key": "CCC", + "message": "message1099" + }, + { + "key": "DDD", + "message": "message1100" + }, + { + "key": "", + "message": "message1101" + }, + { + "key": "AAA", + "message": "message1102" + }, + { + "key": "BBB", + "message": "message1103" + }, + { + "key": "CCC", + "message": "message1104" + }, + { + "key": "DDD", + "message": "message1105" + }, + { + "key": "", + "message": "message1106" + }, + { + "key": "AAA", + "message": "message1107" + }, + { + "key": "BBB", + "message": "message1108" + }, + { + "key": "CCC", + "message": "message1109" + }, + { + "key": "DDD", + "message": "message1110" + }, + { + "key": "", + "message": "message1111" + }, + { + "key": "AAA", + "message": "message1112" + }, + { + "key": "BBB", + "message": "message1113" + }, + { + "key": "CCC", + "message": "message1114" + }, + { + "key": "DDD", + "message": "message1115" + }, + { + "key": "", + "message": "message1116" + }, + { + "key": "AAA", + "message": "message1117" + }, + { + "key": "BBB", + "message": "message1118" + }, + { + "key": "CCC", + "message": "message1119" + }, + { + "key": "DDD", + "message": "message1120" + }, + { + "key": "", + "message": "message1121" + }, + { + "key": "AAA", + "message": "message1122" + }, + { + "key": "BBB", + "message": "message1123" + }, + { + "key": "CCC", + "message": "message1124" + }, + { + "key": "DDD", + "message": "message1125" + }, + { + "key": "", + "message": "message1126" + }, + { + "key": "AAA", + "message": "message1127" + }, + { + "key": "BBB", + "message": "message1128" + }, + { + "key": "CCC", + "message": "message1129" + }, + { + "key": "DDD", + "message": "message1130" + }, + { + "key": "", + "message": "message1131" + }, + { + "key": "AAA", + "message": "message1132" + }, + { + "key": "BBB", + "message": "message1133" + }, + { + "key": "CCC", + "message": "message1134" + }, + { + "key": "DDD", + "message": "message1135" + }, + { + "key": "", + "message": "message1136" + }, + { + "key": "AAA", + "message": "message1137" + }, + { + "key": "BBB", + "message": "message1138" + }, + { + "key": "CCC", + "message": "message1139" + }, + { + "key": "DDD", + "message": "message1140" + }, + { + "key": "", + "message": "message1141" + }, + { + "key": "AAA", + "message": "message1142" + }, + { + "key": "BBB", + "message": "message1143" + }, + { + "key": "CCC", + "message": "message1144" + }, + { + "key": "DDD", + "message": "message1145" + }, + { + "key": "", + "message": "message1146" + }, + { + "key": "AAA", + "message": "message1147" + }, + { + "key": "BBB", + "message": "message1148" + }, + { + "key": "CCC", + "message": "message1149" + }, + { + "key": "DDD", + "message": "message1150" + }, + { + "key": "", + "message": "message1151" + }, + { + "key": "AAA", + "message": "message1152" + }, + { + "key": "BBB", + "message": "message1153" + }, + { + "key": "CCC", + "message": "message1154" + }, + { + "key": "DDD", + "message": "message1155" + }, + { + "key": "", + "message": "message1156" + }, + { + "key": "AAA", + "message": "message1157" + }, + { + "key": "BBB", + "message": "message1158" + }, + { + "key": "CCC", + "message": "message1159" + }, + { + "key": "DDD", + "message": "message1160" + }, + { + "key": "", + "message": "message1161" + }, + { + "key": "AAA", + "message": "message1162" + }, + { + "key": "BBB", + "message": "message1163" + }, + { + "key": "CCC", + "message": "message1164" + }, + { + "key": "DDD", + "message": "message1165" + }, + { + "key": "", + "message": "message1166" + }, + { + "key": "AAA", + "message": "message1167" + }, + { + "key": "BBB", + "message": "message1168" + }, + { + "key": "CCC", + "message": "message1169" + }, + { + "key": "DDD", + "message": "message1170" + }, + { + "key": "", + "message": "message1171" + }, + { + "key": "AAA", + "message": "message1172" + }, + { + "key": "BBB", + "message": "message1173" + }, + { + "key": "CCC", + "message": "message1174" + }, + { + "key": "DDD", + "message": "message1175" + }, + { + "key": "", + "message": "message1176" + }, + { + "key": "AAA", + "message": "message1177" + }, + { + "key": "BBB", + "message": "message1178" + }, + { + "key": "CCC", + "message": "message1179" + }, + { + "key": "DDD", + "message": "message1180" + }, + { + "key": "", + "message": "message1181" + }, + { + "key": "AAA", + "message": "message1182" + }, + { + "key": "BBB", + "message": "message1183" + }, + { + "key": "CCC", + "message": "message1184" + }, + { + "key": "DDD", + "message": "message1185" + }, + { + "key": "", + "message": "message1186" + }, + { + "key": "AAA", + "message": "message1187" + }, + { + "key": "BBB", + "message": "message1188" + }, + { + "key": "CCC", + "message": "message1189" + }, + { + "key": "DDD", + "message": "message1190" + }, + { + "key": "", + "message": "message1191" + }, + { + "key": "AAA", + "message": "message1192" + }, + { + "key": "BBB", + "message": "message1193" + }, + { + "key": "CCC", + "message": "message1194" + }, + { + "key": "DDD", + "message": "message1195" + }, + { + "key": "", + "message": "message1196" + }, + { + "key": "AAA", + "message": "message1197" + }, + { + "key": "BBB", + "message": "message1198" + }, + { + "key": "CCC", + "message": "message1199" + }, + { + "key": "DDD", + "message": "message1200" + }, + { + "key": "", + "message": "message1201" + }, + { + "key": "AAA", + "message": "message1202" + }, + { + "key": "BBB", + "message": "message1203" + }, + { + "key": "CCC", + "message": "message1204" + }, + { + "key": "DDD", + "message": "message1205" + }, + { + "key": "", + "message": "message1206" + }, + { + "key": "AAA", + "message": "message1207" + }, + { + "key": "BBB", + "message": "message1208" + }, + { + "key": "CCC", + "message": "message1209" + }, + { + "key": "DDD", + "message": "message1210" + }, + { + "key": "", + "message": "message1211" + }, + { + "key": "AAA", + "message": "message1212" + }, + { + "key": "BBB", + "message": "message1213" + }, + { + "key": "CCC", + "message": "message1214" + }, + { + "key": "DDD", + "message": "message1215" + }, + { + "key": "", + "message": "message1216" + }, + { + "key": "AAA", + "message": "message1217" + }, + { + "key": "BBB", + "message": "message1218" + }, + { + "key": "CCC", + "message": "message1219" + }, + { + "key": "DDD", + "message": "message1220" + }, + { + "key": "", + "message": "message1221" + }, + { + "key": "AAA", + "message": "message1222" + }, + { + "key": "BBB", + "message": "message1223" + }, + { + "key": "CCC", + "message": "message1224" + }, + { + "key": "DDD", + "message": "message1225" + }, + { + "key": "", + "message": "message1226" + }, + { + "key": "AAA", + "message": "message1227" + }, + { + "key": "BBB", + "message": "message1228" + }, + { + "key": "CCC", + "message": "message1229" + }, + { + "key": "DDD", + "message": "message1230" + }, + { + "key": "", + "message": "message1231" + }, + { + "key": "AAA", + "message": "message1232" + }, + { + "key": "BBB", + "message": "message1233" + }, + { + "key": "CCC", + "message": "message1234" + }, + { + "key": "DDD", + "message": "message1235" + }, + { + "key": "", + "message": "message1236" + }, + { + "key": "AAA", + "message": "message1237" + }, + { + "key": "BBB", + "message": "message1238" + }, + { + "key": "CCC", + "message": "message1239" + }, + { + "key": "DDD", + "message": "message1240" + }, + { + "key": "", + "message": "message1241" + }, + { + "key": "AAA", + "message": "message1242" + }, + { + "key": "BBB", + "message": "message1243" + }, + { + "key": "CCC", + "message": "message1244" + }, + { + "key": "DDD", + "message": "message1245" + }, + { + "key": "", + "message": "message1246" + }, + { + "key": "AAA", + "message": "message1247" + }, + { + "key": "BBB", + "message": "message1248" + }, + { + "key": "CCC", + "message": "message1249" + }, + { + "key": "DDD", + "message": "message1250" + }, + { + "key": "", + "message": "message1251" + }, + { + "key": "AAA", + "message": "message1252" + }, + { + "key": "BBB", + "message": "message1253" + }, + { + "key": "CCC", + "message": "message1254" + }, + { + "key": "DDD", + "message": "message1255" + }, + { + "key": "", + "message": "message1256" + }, + { + "key": "AAA", + "message": "message1257" + }, + { + "key": "BBB", + "message": "message1258" + }, + { + "key": "CCC", + "message": "message1259" + }, + { + "key": "DDD", + "message": "message1260" + }, + { + "key": "", + "message": "message1261" + }, + { + "key": "AAA", + "message": "message1262" + }, + { + "key": "BBB", + "message": "message1263" + }, + { + "key": "CCC", + "message": "message1264" + }, + { + "key": "DDD", + "message": "message1265" + }, + { + "key": "", + "message": "message1266" + }, + { + "key": "AAA", + "message": "message1267" + }, + { + "key": "BBB", + "message": "message1268" + }, + { + "key": "CCC", + "message": "message1269" + }, + { + "key": "DDD", + "message": "message1270" + }, + { + "key": "", + "message": "message1271" + }, + { + "key": "AAA", + "message": "message1272" + }, + { + "key": "BBB", + "message": "message1273" + }, + { + "key": "CCC", + "message": "message1274" + }, + { + "key": "DDD", + "message": "message1275" + }, + { + "key": "", + "message": "message1276" + }, + { + "key": "AAA", + "message": "message1277" + }, + { + "key": "BBB", + "message": "message1278" + }, + { + "key": "CCC", + "message": "message1279" + }, + { + "key": "DDD", + "message": "message1280" + }, + { + "key": "", + "message": "message1281" + }, + { + "key": "AAA", + "message": "message1282" + }, + { + "key": "BBB", + "message": "message1283" + }, + { + "key": "CCC", + "message": "message1284" + }, + { + "key": "DDD", + "message": "message1285" + }, + { + "key": "", + "message": "message1286" + }, + { + "key": "AAA", + "message": "message1287" + }, + { + "key": "BBB", + "message": "message1288" + }, + { + "key": "CCC", + "message": "message1289" + }, + { + "key": "DDD", + "message": "message1290" + }, + { + "key": "", + "message": "message1291" + }, + { + "key": "AAA", + "message": "message1292" + }, + { + "key": "BBB", + "message": "message1293" + }, + { + "key": "CCC", + "message": "message1294" + }, + { + "key": "DDD", + "message": "message1295" + }, + { + "key": "", + "message": "message1296" + }, + { + "key": "AAA", + "message": "message1297" + }, + { + "key": "BBB", + "message": "message1298" + }, + { + "key": "CCC", + "message": "message1299" + }, + { + "key": "DDD", + "message": "message1300" + }, + { + "key": "", + "message": "message1301" + }, + { + "key": "AAA", + "message": "message1302" + }, + { + "key": "BBB", + "message": "message1303" + }, + { + "key": "CCC", + "message": "message1304" + }, + { + "key": "DDD", + "message": "message1305" + }, + { + "key": "", + "message": "message1306" + }, + { + "key": "AAA", + "message": "message1307" + }, + { + "key": "BBB", + "message": "message1308" + }, + { + "key": "CCC", + "message": "message1309" + }, + { + "key": "DDD", + "message": "message1310" + }, + { + "key": "", + "message": "message1311" + }, + { + "key": "AAA", + "message": "message1312" + }, + { + "key": "BBB", + "message": "message1313" + }, + { + "key": "CCC", + "message": "message1314" + }, + { + "key": "DDD", + "message": "message1315" + }, + { + "key": "", + "message": "message1316" + }, + { + "key": "AAA", + "message": "message1317" + }, + { + "key": "BBB", + "message": "message1318" + }, + { + "key": "CCC", + "message": "message1319" + }, + { + "key": "DDD", + "message": "message1320" + }, + { + "key": "", + "message": "message1321" + }, + { + "key": "AAA", + "message": "message1322" + }, + { + "key": "BBB", + "message": "message1323" + }, + { + "key": "CCC", + "message": "message1324" + }, + { + "key": "DDD", + "message": "message1325" + }, + { + "key": "", + "message": "message1326" + }, + { + "key": "AAA", + "message": "message1327" + }, + { + "key": "BBB", + "message": "message1328" + }, + { + "key": "CCC", + "message": "message1329" + }, + { + "key": "DDD", + "message": "message1330" + }, + { + "key": "", + "message": "message1331" + }, + { + "key": "AAA", + "message": "message1332" + }, + { + "key": "BBB", + "message": "message1333" + }, + { + "key": "CCC", + "message": "message1334" + }, + { + "key": "DDD", + "message": "message1335" + }, + { + "key": "", + "message": "message1336" + }, + { + "key": "AAA", + "message": "message1337" + }, + { + "key": "BBB", + "message": "message1338" + }, + { + "key": "CCC", + "message": "message1339" + }, + { + "key": "DDD", + "message": "message1340" + }, + { + "key": "", + "message": "message1341" + }, + { + "key": "AAA", + "message": "message1342" + }, + { + "key": "BBB", + "message": "message1343" + }, + { + "key": "CCC", + "message": "message1344" + }, + { + "key": "DDD", + "message": "message1345" + }, + { + "key": "", + "message": "message1346" + }, + { + "key": "AAA", + "message": "message1347" + }, + { + "key": "BBB", + "message": "message1348" + }, + { + "key": "CCC", + "message": "message1349" + }, + { + "key": "DDD", + "message": "message1350" + }, + { + "key": "", + "message": "message1351" + }, + { + "key": "AAA", + "message": "message1352" + }, + { + "key": "BBB", + "message": "message1353" + }, + { + "key": "CCC", + "message": "message1354" + }, + { + "key": "DDD", + "message": "message1355" + }, + { + "key": "", + "message": "message1356" + }, + { + "key": "AAA", + "message": "message1357" + }, + { + "key": "BBB", + "message": "message1358" + }, + { + "key": "CCC", + "message": "message1359" + }, + { + "key": "DDD", + "message": "message1360" + }, + { + "key": "", + "message": "message1361" + }, + { + "key": "AAA", + "message": "message1362" + }, + { + "key": "BBB", + "message": "message1363" + }, + { + "key": "CCC", + "message": "message1364" + }, + { + "key": "DDD", + "message": "message1365" + }, + { + "key": "", + "message": "message1366" + }, + { + "key": "AAA", + "message": "message1367" + }, + { + "key": "BBB", + "message": "message1368" + }, + { + "key": "CCC", + "message": "message1369" + }, + { + "key": "DDD", + "message": "message1370" + }, + { + "key": "", + "message": "message1371" + }, + { + "key": "AAA", + "message": "message1372" + }, + { + "key": "BBB", + "message": "message1373" + }, + { + "key": "CCC", + "message": "message1374" + }, + { + "key": "DDD", + "message": "message1375" + }, + { + "key": "", + "message": "message1376" + }, + { + "key": "AAA", + "message": "message1377" + }, + { + "key": "BBB", + "message": "message1378" + }, + { + "key": "CCC", + "message": "message1379" + }, + { + "key": "DDD", + "message": "message1380" + }, + { + "key": "", + "message": "message1381" + }, + { + "key": "AAA", + "message": "message1382" + }, + { + "key": "BBB", + "message": "message1383" + }, + { + "key": "CCC", + "message": "message1384" + }, + { + "key": "DDD", + "message": "message1385" + }, + { + "key": "", + "message": "message1386" + }, + { + "key": "AAA", + "message": "message1387" + }, + { + "key": "BBB", + "message": "message1388" + }, + { + "key": "CCC", + "message": "message1389" + }, + { + "key": "DDD", + "message": "message1390" + }, + { + "key": "", + "message": "message1391" + }, + { + "key": "AAA", + "message": "message1392" + }, + { + "key": "BBB", + "message": "message1393" + }, + { + "key": "CCC", + "message": "message1394" + }, + { + "key": "DDD", + "message": "message1395" + }, + { + "key": "", + "message": "message1396" + }, + { + "key": "AAA", + "message": "message1397" + }, + { + "key": "BBB", + "message": "message1398" + }, + { + "key": "CCC", + "message": "message1399" + }, + { + "key": "DDD", + "message": "message1400" + }, + { + "key": "", + "message": "message1401" + }, + { + "key": "AAA", + "message": "message1402" + }, + { + "key": "BBB", + "message": "message1403" + }, + { + "key": "CCC", + "message": "message1404" + }, + { + "key": "DDD", + "message": "message1405" + }, + { + "key": "", + "message": "message1406" + }, + { + "key": "AAA", + "message": "message1407" + }, + { + "key": "BBB", + "message": "message1408" + }, + { + "key": "CCC", + "message": "message1409" + }, + { + "key": "DDD", + "message": "message1410" + }, + { + "key": "", + "message": "message1411" + }, + { + "key": "AAA", + "message": "message1412" + }, + { + "key": "BBB", + "message": "message1413" + }, + { + "key": "CCC", + "message": "message1414" + }, + { + "key": "DDD", + "message": "message1415" + }, + { + "key": "", + "message": "message1416" + }, + { + "key": "AAA", + "message": "message1417" + }, + { + "key": "BBB", + "message": "message1418" + }, + { + "key": "CCC", + "message": "message1419" + }, + { + "key": "DDD", + "message": "message1420" + }, + { + "key": "", + "message": "message1421" + }, + { + "key": "AAA", + "message": "message1422" + }, + { + "key": "BBB", + "message": "message1423" + }, + { + "key": "CCC", + "message": "message1424" + }, + { + "key": "DDD", + "message": "message1425" + }, + { + "key": "", + "message": "message1426" + }, + { + "key": "AAA", + "message": "message1427" + }, + { + "key": "BBB", + "message": "message1428" + }, + { + "key": "CCC", + "message": "message1429" + }, + { + "key": "DDD", + "message": "message1430" + }, + { + "key": "", + "message": "message1431" + }, + { + "key": "AAA", + "message": "message1432" + }, + { + "key": "BBB", + "message": "message1433" + }, + { + "key": "CCC", + "message": "message1434" + }, + { + "key": "DDD", + "message": "message1435" + }, + { + "key": "", + "message": "message1436" + }, + { + "key": "AAA", + "message": "message1437" + }, + { + "key": "BBB", + "message": "message1438" + }, + { + "key": "CCC", + "message": "message1439" + }, + { + "key": "DDD", + "message": "message1440" + }, + { + "key": "", + "message": "message1441" + }, + { + "key": "AAA", + "message": "message1442" + }, + { + "key": "BBB", + "message": "message1443" + }, + { + "key": "CCC", + "message": "message1444" + }, + { + "key": "DDD", + "message": "message1445" + }, + { + "key": "", + "message": "message1446" + }, + { + "key": "AAA", + "message": "message1447" + }, + { + "key": "BBB", + "message": "message1448" + }, + { + "key": "CCC", + "message": "message1449" + }, + { + "key": "DDD", + "message": "message1450" + }, + { + "key": "", + "message": "message1451" + }, + { + "key": "AAA", + "message": "message1452" + }, + { + "key": "BBB", + "message": "message1453" + }, + { + "key": "CCC", + "message": "message1454" + }, + { + "key": "DDD", + "message": "message1455" + }, + { + "key": "", + "message": "message1456" + }, + { + "key": "AAA", + "message": "message1457" + }, + { + "key": "BBB", + "message": "message1458" + }, + { + "key": "CCC", + "message": "message1459" + }, + { + "key": "DDD", + "message": "message1460" + }, + { + "key": "", + "message": "message1461" + }, + { + "key": "AAA", + "message": "message1462" + }, + { + "key": "BBB", + "message": "message1463" + }, + { + "key": "CCC", + "message": "message1464" + }, + { + "key": "DDD", + "message": "message1465" + }, + { + "key": "", + "message": "message1466" + }, + { + "key": "AAA", + "message": "message1467" + }, + { + "key": "BBB", + "message": "message1468" + }, + { + "key": "CCC", + "message": "message1469" + }, + { + "key": "DDD", + "message": "message1470" + }, + { + "key": "", + "message": "message1471" + }, + { + "key": "AAA", + "message": "message1472" + }, + { + "key": "BBB", + "message": "message1473" + }, + { + "key": "CCC", + "message": "message1474" + }, + { + "key": "DDD", + "message": "message1475" + }, + { + "key": "", + "message": "message1476" + }, + { + "key": "AAA", + "message": "message1477" + }, + { + "key": "BBB", + "message": "message1478" + }, + { + "key": "CCC", + "message": "message1479" + }, + { + "key": "DDD", + "message": "message1480" + }, + { + "key": "", + "message": "message1481" + }, + { + "key": "AAA", + "message": "message1482" + }, + { + "key": "BBB", + "message": "message1483" + }, + { + "key": "CCC", + "message": "message1484" + }, + { + "key": "DDD", + "message": "message1485" + }, + { + "key": "", + "message": "message1486" + }, + { + "key": "AAA", + "message": "message1487" + }, + { + "key": "BBB", + "message": "message1488" + }, + { + "key": "CCC", + "message": "message1489" + }, + { + "key": "DDD", + "message": "message1490" + }, + { + "key": "", + "message": "message1491" + }, + { + "key": "AAA", + "message": "message1492" + }, + { + "key": "BBB", + "message": "message1493" + }, + { + "key": "CCC", + "message": "message1494" + }, + { + "key": "DDD", + "message": "message1495" + }, + { + "key": "", + "message": "message1496" + }, + { + "key": "AAA", + "message": "message1497" + }, + { + "key": "BBB", + "message": "message1498" + }, + { + "key": "CCC", + "message": "message1499" + }, + { + "key": "DDD", + "message": "message1500" + }, + { + "key": "", + "message": "message1501" + }, + { + "key": "AAA", + "message": "message1502" + }, + { + "key": "BBB", + "message": "message1503" + }, + { + "key": "CCC", + "message": "message1504" + }, + { + "key": "DDD", + "message": "message1505" + }, + { + "key": "", + "message": "message1506" + }, + { + "key": "AAA", + "message": "message1507" + }, + { + "key": "BBB", + "message": "message1508" + }, + { + "key": "CCC", + "message": "message1509" + }, + { + "key": "DDD", + "message": "message1510" + }, + { + "key": "", + "message": "message1511" + }, + { + "key": "AAA", + "message": "message1512" + }, + { + "key": "BBB", + "message": "message1513" + }, + { + "key": "CCC", + "message": "message1514" + }, + { + "key": "DDD", + "message": "message1515" + }, + { + "key": "", + "message": "message1516" + }, + { + "key": "AAA", + "message": "message1517" + }, + { + "key": "BBB", + "message": "message1518" + }, + { + "key": "CCC", + "message": "message1519" + }, + { + "key": "DDD", + "message": "message1520" + }, + { + "key": "", + "message": "message1521" + }, + { + "key": "AAA", + "message": "message1522" + }, + { + "key": "BBB", + "message": "message1523" + }, + { + "key": "CCC", + "message": "message1524" + }, + { + "key": "DDD", + "message": "message1525" + }, + { + "key": "", + "message": "message1526" + }, + { + "key": "AAA", + "message": "message1527" + }, + { + "key": "BBB", + "message": "message1528" + }, + { + "key": "CCC", + "message": "message1529" + }, + { + "key": "DDD", + "message": "message1530" + }, + { + "key": "", + "message": "message1531" + }, + { + "key": "AAA", + "message": "message1532" + }, + { + "key": "BBB", + "message": "message1533" + }, + { + "key": "CCC", + "message": "message1534" + }, + { + "key": "DDD", + "message": "message1535" + }, + { + "key": "", + "message": "message1536" + }, + { + "key": "AAA", + "message": "message1537" + }, + { + "key": "BBB", + "message": "message1538" + }, + { + "key": "CCC", + "message": "message1539" + }, + { + "key": "DDD", + "message": "message1540" + }, + { + "key": "", + "message": "message1541" + }, + { + "key": "AAA", + "message": "message1542" + }, + { + "key": "BBB", + "message": "message1543" + }, + { + "key": "CCC", + "message": "message1544" + }, + { + "key": "DDD", + "message": "message1545" + }, + { + "key": "", + "message": "message1546" + }, + { + "key": "AAA", + "message": "message1547" + }, + { + "key": "BBB", + "message": "message1548" + }, + { + "key": "CCC", + "message": "message1549" + }, + { + "key": "DDD", + "message": "message1550" + }, + { + "key": "", + "message": "message1551" + }, + { + "key": "AAA", + "message": "message1552" + }, + { + "key": "BBB", + "message": "message1553" + }, + { + "key": "CCC", + "message": "message1554" + }, + { + "key": "DDD", + "message": "message1555" + }, + { + "key": "", + "message": "message1556" + }, + { + "key": "AAA", + "message": "message1557" + }, + { + "key": "BBB", + "message": "message1558" + }, + { + "key": "CCC", + "message": "message1559" + }, + { + "key": "DDD", + "message": "message1560" + }, + { + "key": "", + "message": "message1561" + }, + { + "key": "AAA", + "message": "message1562" + }, + { + "key": "BBB", + "message": "message1563" + }, + { + "key": "CCC", + "message": "message1564" + }, + { + "key": "DDD", + "message": "message1565" + }, + { + "key": "", + "message": "message1566" + }, + { + "key": "AAA", + "message": "message1567" + }, + { + "key": "BBB", + "message": "message1568" + }, + { + "key": "CCC", + "message": "message1569" + }, + { + "key": "DDD", + "message": "message1570" + }, + { + "key": "", + "message": "message1571" + }, + { + "key": "AAA", + "message": "message1572" + }, + { + "key": "BBB", + "message": "message1573" + }, + { + "key": "CCC", + "message": "message1574" + }, + { + "key": "DDD", + "message": "message1575" + }, + { + "key": "", + "message": "message1576" + }, + { + "key": "AAA", + "message": "message1577" + }, + { + "key": "BBB", + "message": "message1578" + }, + { + "key": "CCC", + "message": "message1579" + }, + { + "key": "DDD", + "message": "message1580" + }, + { + "key": "", + "message": "message1581" + }, + { + "key": "AAA", + "message": "message1582" + }, + { + "key": "BBB", + "message": "message1583" + }, + { + "key": "CCC", + "message": "message1584" + }, + { + "key": "DDD", + "message": "message1585" + }, + { + "key": "", + "message": "message1586" + }, + { + "key": "AAA", + "message": "message1587" + }, + { + "key": "BBB", + "message": "message1588" + }, + { + "key": "CCC", + "message": "message1589" + }, + { + "key": "DDD", + "message": "message1590" + }, + { + "key": "", + "message": "message1591" + }, + { + "key": "AAA", + "message": "message1592" + }, + { + "key": "BBB", + "message": "message1593" + }, + { + "key": "CCC", + "message": "message1594" + }, + { + "key": "DDD", + "message": "message1595" + }, + { + "key": "", + "message": "message1596" + }, + { + "key": "AAA", + "message": "message1597" + }, + { + "key": "BBB", + "message": "message1598" + }, + { + "key": "CCC", + "message": "message1599" + }, + { + "key": "DDD", + "message": "message1600" + }, + { + "key": "", + "message": "message1601" + }, + { + "key": "AAA", + "message": "message1602" + }, + { + "key": "BBB", + "message": "message1603" + }, + { + "key": "CCC", + "message": "message1604" + }, + { + "key": "DDD", + "message": "message1605" + }, + { + "key": "", + "message": "message1606" + }, + { + "key": "AAA", + "message": "message1607" + }, + { + "key": "BBB", + "message": "message1608" + }, + { + "key": "CCC", + "message": "message1609" + }, + { + "key": "DDD", + "message": "message1610" + }, + { + "key": "", + "message": "message1611" + }, + { + "key": "AAA", + "message": "message1612" + }, + { + "key": "BBB", + "message": "message1613" + }, + { + "key": "CCC", + "message": "message1614" + }, + { + "key": "DDD", + "message": "message1615" + }, + { + "key": "", + "message": "message1616" + }, + { + "key": "AAA", + "message": "message1617" + }, + { + "key": "BBB", + "message": "message1618" + }, + { + "key": "CCC", + "message": "message1619" + }, + { + "key": "DDD", + "message": "message1620" + }, + { + "key": "", + "message": "message1621" + }, + { + "key": "AAA", + "message": "message1622" + }, + { + "key": "BBB", + "message": "message1623" + }, + { + "key": "CCC", + "message": "message1624" + }, + { + "key": "DDD", + "message": "message1625" + }, + { + "key": "", + "message": "message1626" + }, + { + "key": "AAA", + "message": "message1627" + }, + { + "key": "BBB", + "message": "message1628" + }, + { + "key": "CCC", + "message": "message1629" + }, + { + "key": "DDD", + "message": "message1630" + }, + { + "key": "", + "message": "message1631" + }, + { + "key": "AAA", + "message": "message1632" + }, + { + "key": "BBB", + "message": "message1633" + }, + { + "key": "CCC", + "message": "message1634" + }, + { + "key": "DDD", + "message": "message1635" + }, + { + "key": "", + "message": "message1636" + }, + { + "key": "AAA", + "message": "message1637" + }, + { + "key": "BBB", + "message": "message1638" + }, + { + "key": "CCC", + "message": "message1639" + }, + { + "key": "DDD", + "message": "message1640" + }, + { + "key": "", + "message": "message1641" + }, + { + "key": "AAA", + "message": "message1642" + }, + { + "key": "BBB", + "message": "message1643" + }, + { + "key": "CCC", + "message": "message1644" + }, + { + "key": "DDD", + "message": "message1645" + }, + { + "key": "", + "message": "message1646" + }, + { + "key": "AAA", + "message": "message1647" + }, + { + "key": "BBB", + "message": "message1648" + }, + { + "key": "CCC", + "message": "message1649" + }, + { + "key": "DDD", + "message": "message1650" + }, + { + "key": "", + "message": "message1651" + }, + { + "key": "AAA", + "message": "message1652" + }, + { + "key": "BBB", + "message": "message1653" + }, + { + "key": "CCC", + "message": "message1654" + }, + { + "key": "DDD", + "message": "message1655" + }, + { + "key": "", + "message": "message1656" + }, + { + "key": "AAA", + "message": "message1657" + }, + { + "key": "BBB", + "message": "message1658" + }, + { + "key": "CCC", + "message": "message1659" + }, + { + "key": "DDD", + "message": "message1660" + }, + { + "key": "", + "message": "message1661" + }, + { + "key": "AAA", + "message": "message1662" + }, + { + "key": "BBB", + "message": "message1663" + }, + { + "key": "CCC", + "message": "message1664" + }, + { + "key": "DDD", + "message": "message1665" + }, + { + "key": "", + "message": "message1666" + }, + { + "key": "AAA", + "message": "message1667" + }, + { + "key": "BBB", + "message": "message1668" + }, + { + "key": "CCC", + "message": "message1669" + }, + { + "key": "DDD", + "message": "message1670" + }, + { + "key": "", + "message": "message1671" + }, + { + "key": "AAA", + "message": "message1672" + }, + { + "key": "BBB", + "message": "message1673" + }, + { + "key": "CCC", + "message": "message1674" + }, + { + "key": "DDD", + "message": "message1675" + }, + { + "key": "", + "message": "message1676" + }, + { + "key": "AAA", + "message": "message1677" + }, + { + "key": "BBB", + "message": "message1678" + }, + { + "key": "CCC", + "message": "message1679" + }, + { + "key": "DDD", + "message": "message1680" + }, + { + "key": "", + "message": "message1681" + }, + { + "key": "AAA", + "message": "message1682" + }, + { + "key": "BBB", + "message": "message1683" + }, + { + "key": "CCC", + "message": "message1684" + }, + { + "key": "DDD", + "message": "message1685" + }, + { + "key": "", + "message": "message1686" + }, + { + "key": "AAA", + "message": "message1687" + }, + { + "key": "BBB", + "message": "message1688" + }, + { + "key": "CCC", + "message": "message1689" + }, + { + "key": "DDD", + "message": "message1690" + }, + { + "key": "", + "message": "message1691" + }, + { + "key": "AAA", + "message": "message1692" + }, + { + "key": "BBB", + "message": "message1693" + }, + { + "key": "CCC", + "message": "message1694" + }, + { + "key": "DDD", + "message": "message1695" + }, + { + "key": "", + "message": "message1696" + }, + { + "key": "AAA", + "message": "message1697" + }, + { + "key": "BBB", + "message": "message1698" + }, + { + "key": "CCC", + "message": "message1699" + }, + { + "key": "DDD", + "message": "message1700" + }, + { + "key": "", + "message": "message1701" + }, + { + "key": "AAA", + "message": "message1702" + }, + { + "key": "BBB", + "message": "message1703" + }, + { + "key": "CCC", + "message": "message1704" + }, + { + "key": "DDD", + "message": "message1705" + }, + { + "key": "", + "message": "message1706" + }, + { + "key": "AAA", + "message": "message1707" + }, + { + "key": "BBB", + "message": "message1708" + }, + { + "key": "CCC", + "message": "message1709" + }, + { + "key": "DDD", + "message": "message1710" + }, + { + "key": "", + "message": "message1711" + }, + { + "key": "AAA", + "message": "message1712" + }, + { + "key": "BBB", + "message": "message1713" + }, + { + "key": "CCC", + "message": "message1714" + }, + { + "key": "DDD", + "message": "message1715" + }, + { + "key": "", + "message": "message1716" + }, + { + "key": "AAA", + "message": "message1717" + }, + { + "key": "BBB", + "message": "message1718" + }, + { + "key": "CCC", + "message": "message1719" + }, + { + "key": "DDD", + "message": "message1720" + }, + { + "key": "", + "message": "message1721" + }, + { + "key": "AAA", + "message": "message1722" + }, + { + "key": "BBB", + "message": "message1723" + }, + { + "key": "CCC", + "message": "message1724" + }, + { + "key": "DDD", + "message": "message1725" + }, + { + "key": "", + "message": "message1726" + }, + { + "key": "AAA", + "message": "message1727" + }, + { + "key": "BBB", + "message": "message1728" + }, + { + "key": "CCC", + "message": "message1729" + }, + { + "key": "DDD", + "message": "message1730" + }, + { + "key": "", + "message": "message1731" + }, + { + "key": "AAA", + "message": "message1732" + }, + { + "key": "BBB", + "message": "message1733" + }, + { + "key": "CCC", + "message": "message1734" + }, + { + "key": "DDD", + "message": "message1735" + }, + { + "key": "", + "message": "message1736" + }, + { + "key": "AAA", + "message": "message1737" + }, + { + "key": "BBB", + "message": "message1738" + }, + { + "key": "CCC", + "message": "message1739" + }, + { + "key": "DDD", + "message": "message1740" + }, + { + "key": "", + "message": "message1741" + }, + { + "key": "AAA", + "message": "message1742" + }, + { + "key": "BBB", + "message": "message1743" + }, + { + "key": "CCC", + "message": "message1744" + }, + { + "key": "DDD", + "message": "message1745" + }, + { + "key": "", + "message": "message1746" + }, + { + "key": "AAA", + "message": "message1747" + }, + { + "key": "BBB", + "message": "message1748" + }, + { + "key": "CCC", + "message": "message1749" + }, + { + "key": "DDD", + "message": "message1750" + }, + { + "key": "", + "message": "message1751" + }, + { + "key": "AAA", + "message": "message1752" + }, + { + "key": "BBB", + "message": "message1753" + }, + { + "key": "CCC", + "message": "message1754" + }, + { + "key": "DDD", + "message": "message1755" + }, + { + "key": "", + "message": "message1756" + }, + { + "key": "AAA", + "message": "message1757" + }, + { + "key": "BBB", + "message": "message1758" + }, + { + "key": "CCC", + "message": "message1759" + }, + { + "key": "DDD", + "message": "message1760" + }, + { + "key": "", + "message": "message1761" + }, + { + "key": "AAA", + "message": "message1762" + }, + { + "key": "BBB", + "message": "message1763" + }, + { + "key": "CCC", + "message": "message1764" + }, + { + "key": "DDD", + "message": "message1765" + }, + { + "key": "", + "message": "message1766" + }, + { + "key": "AAA", + "message": "message1767" + }, + { + "key": "BBB", + "message": "message1768" + }, + { + "key": "CCC", + "message": "message1769" + }, + { + "key": "DDD", + "message": "message1770" + }, + { + "key": "", + "message": "message1771" + }, + { + "key": "AAA", + "message": "message1772" + }, + { + "key": "BBB", + "message": "message1773" + }, + { + "key": "CCC", + "message": "message1774" + }, + { + "key": "DDD", + "message": "message1775" + }, + { + "key": "", + "message": "message1776" + }, + { + "key": "AAA", + "message": "message1777" + }, + { + "key": "BBB", + "message": "message1778" + }, + { + "key": "CCC", + "message": "message1779" + }, + { + "key": "DDD", + "message": "message1780" + }, + { + "key": "", + "message": "message1781" + }, + { + "key": "AAA", + "message": "message1782" + }, + { + "key": "BBB", + "message": "message1783" + }, + { + "key": "CCC", + "message": "message1784" + }, + { + "key": "DDD", + "message": "message1785" + }, + { + "key": "", + "message": "message1786" + }, + { + "key": "AAA", + "message": "message1787" + }, + { + "key": "BBB", + "message": "message1788" + }, + { + "key": "CCC", + "message": "message1789" + }, + { + "key": "DDD", + "message": "message1790" + }, + { + "key": "", + "message": "message1791" + }, + { + "key": "AAA", + "message": "message1792" + }, + { + "key": "BBB", + "message": "message1793" + }, + { + "key": "CCC", + "message": "message1794" + }, + { + "key": "DDD", + "message": "message1795" + }, + { + "key": "", + "message": "message1796" + }, + { + "key": "AAA", + "message": "message1797" + }, + { + "key": "BBB", + "message": "message1798" + }, + { + "key": "CCC", + "message": "message1799" + }, + { + "key": "DDD", + "message": "message1800" + }, + { + "key": "", + "message": "message1801" + }, + { + "key": "AAA", + "message": "message1802" + }, + { + "key": "BBB", + "message": "message1803" + }, + { + "key": "CCC", + "message": "message1804" + }, + { + "key": "DDD", + "message": "message1805" + }, + { + "key": "", + "message": "message1806" + }, + { + "key": "AAA", + "message": "message1807" + }, + { + "key": "BBB", + "message": "message1808" + }, + { + "key": "CCC", + "message": "message1809" + }, + { + "key": "DDD", + "message": "message1810" + }, + { + "key": "", + "message": "message1811" + }, + { + "key": "AAA", + "message": "message1812" + }, + { + "key": "BBB", + "message": "message1813" + }, + { + "key": "CCC", + "message": "message1814" + }, + { + "key": "DDD", + "message": "message1815" + }, + { + "key": "", + "message": "message1816" + }, + { + "key": "AAA", + "message": "message1817" + }, + { + "key": "BBB", + "message": "message1818" + }, + { + "key": "CCC", + "message": "message1819" + }, + { + "key": "DDD", + "message": "message1820" + }, + { + "key": "", + "message": "message1821" + }, + { + "key": "AAA", + "message": "message1822" + }, + { + "key": "BBB", + "message": "message1823" + }, + { + "key": "CCC", + "message": "message1824" + }, + { + "key": "DDD", + "message": "message1825" + }, + { + "key": "", + "message": "message1826" + }, + { + "key": "AAA", + "message": "message1827" + }, + { + "key": "BBB", + "message": "message1828" + }, + { + "key": "CCC", + "message": "message1829" + }, + { + "key": "DDD", + "message": "message1830" + }, + { + "key": "", + "message": "message1831" + }, + { + "key": "AAA", + "message": "message1832" + }, + { + "key": "BBB", + "message": "message1833" + }, + { + "key": "CCC", + "message": "message1834" + }, + { + "key": "DDD", + "message": "message1835" + }, + { + "key": "", + "message": "message1836" + }, + { + "key": "AAA", + "message": "message1837" + }, + { + "key": "BBB", + "message": "message1838" + }, + { + "key": "CCC", + "message": "message1839" + }, + { + "key": "DDD", + "message": "message1840" + }, + { + "key": "", + "message": "message1841" + }, + { + "key": "AAA", + "message": "message1842" + }, + { + "key": "BBB", + "message": "message1843" + }, + { + "key": "CCC", + "message": "message1844" + }, + { + "key": "DDD", + "message": "message1845" + }, + { + "key": "", + "message": "message1846" + }, + { + "key": "AAA", + "message": "message1847" + }, + { + "key": "BBB", + "message": "message1848" + }, + { + "key": "CCC", + "message": "message1849" + }, + { + "key": "DDD", + "message": "message1850" + }, + { + "key": "", + "message": "message1851" + }, + { + "key": "AAA", + "message": "message1852" + }, + { + "key": "BBB", + "message": "message1853" + }, + { + "key": "CCC", + "message": "message1854" + }, + { + "key": "DDD", + "message": "message1855" + }, + { + "key": "", + "message": "message1856" + }, + { + "key": "AAA", + "message": "message1857" + }, + { + "key": "BBB", + "message": "message1858" + }, + { + "key": "CCC", + "message": "message1859" + }, + { + "key": "DDD", + "message": "message1860" + }, + { + "key": "", + "message": "message1861" + }, + { + "key": "AAA", + "message": "message1862" + }, + { + "key": "BBB", + "message": "message1863" + }, + { + "key": "CCC", + "message": "message1864" + }, + { + "key": "DDD", + "message": "message1865" + }, + { + "key": "", + "message": "message1866" + }, + { + "key": "AAA", + "message": "message1867" + }, + { + "key": "BBB", + "message": "message1868" + }, + { + "key": "CCC", + "message": "message1869" + }, + { + "key": "DDD", + "message": "message1870" + }, + { + "key": "", + "message": "message1871" + }, + { + "key": "AAA", + "message": "message1872" + }, + { + "key": "BBB", + "message": "message1873" + }, + { + "key": "CCC", + "message": "message1874" + }, + { + "key": "DDD", + "message": "message1875" + }, + { + "key": "", + "message": "message1876" + }, + { + "key": "AAA", + "message": "message1877" + }, + { + "key": "BBB", + "message": "message1878" + }, + { + "key": "CCC", + "message": "message1879" + }, + { + "key": "DDD", + "message": "message1880" + }, + { + "key": "", + "message": "message1881" + }, + { + "key": "AAA", + "message": "message1882" + }, + { + "key": "BBB", + "message": "message1883" + }, + { + "key": "CCC", + "message": "message1884" + }, + { + "key": "DDD", + "message": "message1885" + }, + { + "key": "", + "message": "message1886" + }, + { + "key": "AAA", + "message": "message1887" + }, + { + "key": "BBB", + "message": "message1888" + }, + { + "key": "CCC", + "message": "message1889" + }, + { + "key": "DDD", + "message": "message1890" + }, + { + "key": "", + "message": "message1891" + }, + { + "key": "AAA", + "message": "message1892" + }, + { + "key": "BBB", + "message": "message1893" + }, + { + "key": "CCC", + "message": "message1894" + }, + { + "key": "DDD", + "message": "message1895" + }, + { + "key": "", + "message": "message1896" + }, + { + "key": "AAA", + "message": "message1897" + }, + { + "key": "BBB", + "message": "message1898" + }, + { + "key": "CCC", + "message": "message1899" + }, + { + "key": "DDD", + "message": "message1900" + }, + { + "key": "", + "message": "message1901" + }, + { + "key": "AAA", + "message": "message1902" + }, + { + "key": "BBB", + "message": "message1903" + }, + { + "key": "CCC", + "message": "message1904" + }, + { + "key": "DDD", + "message": "message1905" + }, + { + "key": "", + "message": "message1906" + }, + { + "key": "AAA", + "message": "message1907" + }, + { + "key": "BBB", + "message": "message1908" + }, + { + "key": "CCC", + "message": "message1909" + }, + { + "key": "DDD", + "message": "message1910" + }, + { + "key": "", + "message": "message1911" + }, + { + "key": "AAA", + "message": "message1912" + }, + { + "key": "BBB", + "message": "message1913" + }, + { + "key": "CCC", + "message": "message1914" + }, + { + "key": "DDD", + "message": "message1915" + }, + { + "key": "", + "message": "message1916" + }, + { + "key": "AAA", + "message": "message1917" + }, + { + "key": "BBB", + "message": "message1918" + }, + { + "key": "CCC", + "message": "message1919" + }, + { + "key": "DDD", + "message": "message1920" + }, + { + "key": "", + "message": "message1921" + }, + { + "key": "AAA", + "message": "message1922" + }, + { + "key": "BBB", + "message": "message1923" + }, + { + "key": "CCC", + "message": "message1924" + }, + { + "key": "DDD", + "message": "message1925" + }, + { + "key": "", + "message": "message1926" + }, + { + "key": "AAA", + "message": "message1927" + }, + { + "key": "BBB", + "message": "message1928" + }, + { + "key": "CCC", + "message": "message1929" + }, + { + "key": "DDD", + "message": "message1930" + }, + { + "key": "", + "message": "message1931" + }, + { + "key": "AAA", + "message": "message1932" + }, + { + "key": "BBB", + "message": "message1933" + }, + { + "key": "CCC", + "message": "message1934" + }, + { + "key": "DDD", + "message": "message1935" + }, + { + "key": "", + "message": "message1936" + }, + { + "key": "AAA", + "message": "message1937" + }, + { + "key": "BBB", + "message": "message1938" + }, + { + "key": "CCC", + "message": "message1939" + }, + { + "key": "DDD", + "message": "message1940" + }, + { + "key": "", + "message": "message1941" + }, + { + "key": "AAA", + "message": "message1942" + }, + { + "key": "BBB", + "message": "message1943" + }, + { + "key": "CCC", + "message": "message1944" + }, + { + "key": "DDD", + "message": "message1945" + }, + { + "key": "", + "message": "message1946" + }, + { + "key": "AAA", + "message": "message1947" + }, + { + "key": "BBB", + "message": "message1948" + }, + { + "key": "CCC", + "message": "message1949" + }, + { + "key": "DDD", + "message": "message1950" + }, + { + "key": "", + "message": "message1951" + }, + { + "key": "AAA", + "message": "message1952" + }, + { + "key": "BBB", + "message": "message1953" + }, + { + "key": "CCC", + "message": "message1954" + }, + { + "key": "DDD", + "message": "message1955" + }, + { + "key": "", + "message": "message1956" + }, + { + "key": "AAA", + "message": "message1957" + }, + { + "key": "BBB", + "message": "message1958" + }, + { + "key": "CCC", + "message": "message1959" + }, + { + "key": "DDD", + "message": "message1960" + }, + { + "key": "", + "message": "message1961" + }, + { + "key": "AAA", + "message": "message1962" + }, + { + "key": "BBB", + "message": "message1963" + }, + { + "key": "CCC", + "message": "message1964" + }, + { + "key": "DDD", + "message": "message1965" + }, + { + "key": "", + "message": "message1966" + }, + { + "key": "AAA", + "message": "message1967" + }, + { + "key": "BBB", + "message": "message1968" + }, + { + "key": "CCC", + "message": "message1969" + }, + { + "key": "DDD", + "message": "message1970" + }, + { + "key": "", + "message": "message1971" + }, + { + "key": "AAA", + "message": "message1972" + }, + { + "key": "BBB", + "message": "message1973" + }, + { + "key": "CCC", + "message": "message1974" + }, + { + "key": "DDD", + "message": "message1975" + }, + { + "key": "", + "message": "message1976" + }, + { + "key": "AAA", + "message": "message1977" + }, + { + "key": "BBB", + "message": "message1978" + }, + { + "key": "CCC", + "message": "message1979" + }, + { + "key": "DDD", + "message": "message1980" + }, + { + "key": "", + "message": "message1981" + }, + { + "key": "AAA", + "message": "message1982" + }, + { + "key": "BBB", + "message": "message1983" + }, + { + "key": "CCC", + "message": "message1984" + }, + { + "key": "DDD", + "message": "message1985" + }, + { + "key": "", + "message": "message1986" + }, + { + "key": "AAA", + "message": "message1987" + }, + { + "key": "BBB", + "message": "message1988" + }, + { + "key": "CCC", + "message": "message1989" + }, + { + "key": "DDD", + "message": "message1990" + }, + { + "key": "", + "message": "message1991" + }, + { + "key": "AAA", + "message": "message1992" + }, + { + "key": "BBB", + "message": "message1993" + }, + { + "key": "CCC", + "message": "message1994" + }, + { + "key": "DDD", + "message": "message1995" + }, + { + "key": "", + "message": "message1996" + }, + { + "key": "AAA", + "message": "message1997" + }, + { + "key": "BBB", + "message": "message1998" + }, + { + "key": "CCC", + "message": "message1999" + }, + { + "key": "DDD", + "message": "message2000" + }, + { + "key": "", + "message": "message2001" + }, + { + "key": "", + "message": "message2002" + }, + { + "key": "", + "message": "message2003" + }, + { + "key": "", + "message": "message2004" + }, + { + "key": "", + "message": "message2005" + }, + { + "key": "", + "message": "message2006" + }, + { + "key": "", + "message": "message2007" + }, + { + "key": "", + "message": "message2008" + }, + { + "key": "", + "message": "message2009" + }, + { + "key": "", + "message": "message2010" + }, + { + "key": "", + "message": "message2011" + }, + { + "key": "", + "message": "message2012" + }, + { + "key": "", + "message": "message2013" + }, + { + "key": "", + "message": "message2014" + }, + { + "key": "", + "message": "message2015" + }, + { + "key": "", + "message": "message2016" + }, + { + "key": "", + "message": "message2017" + }, + { + "key": "", + "message": "message2018" + }, + { + "key": "", + "message": "message2019" + }, + { + "key": "", + "message": "message2020" + }, + { + "key": "", + "message": "message2021" + }, + { + "key": "", + "message": "message2022" + }, + { + "key": "", + "message": "message2023" + }, + { + "key": "", + "message": "message2024" + }, + { + "key": "", + "message": "message2025" + }, + { + "key": "", + "message": "message2026" + }, + { + "key": "", + "message": "message2027" + }, + { + "key": "", + "message": "message2028" + }, + { + "key": "", + "message": "message2029" + }, + { + "key": "", + "message": "message2030" + }, + { + "key": "", + "message": "message2031" + }, + { + "key": "", + "message": "message2032" + }, + { + "key": "", + "message": "message2033" + }, + { + "key": "", + "message": "message2034" + }, + { + "key": "", + "message": "message2035" + }, + { + "key": "", + "message": "message2036" + }, + { + "key": "", + "message": "message2037" + }, + { + "key": "", + "message": "message2038" + }, + { + "key": "", + "message": "message2039" + }, + { + "key": "", + "message": "message2040" + }, + { + "key": "", + "message": "message2041" + }, + { + "key": "", + "message": "message2042" + }, + { + "key": "", + "message": "message2043" + }, + { + "key": "", + "message": "message2044" + }, + { + "key": "", + "message": "message2045" + }, + { + "key": "", + "message": "message2046" + }, + { + "key": "", + "message": "message2047" + }, + { + "key": "", + "message": "message2048" + }, + { + "key": "", + "message": "message2049" + }, + { + "key": "", + "message": "message2050" + }, + { + "key": "", + "message": "message2051" + }, + { + "key": "", + "message": "message2052" + }, + { + "key": "", + "message": "message2053" + }, + { + "key": "", + "message": "message2054" + }, + { + "key": "", + "message": "message2055" + }, + { + "key": "", + "message": "message2056" + }, + { + "key": "", + "message": "message2057" + }, + { + "key": "", + "message": "message2058" + }, + { + "key": "", + "message": "message2059" + }, + { + "key": "", + "message": "message2060" + }, + { + "key": "", + "message": "message2061" + }, + { + "key": "", + "message": "message2062" + }, + { + "key": "", + "message": "message2063" + }, + { + "key": "", + "message": "message2064" + }, + { + "key": "", + "message": "message2065" + }, + { + "key": "", + "message": "message2066" + }, + { + "key": "", + "message": "message2067" + }, + { + "key": "", + "message": "message2068" + }, + { + "key": "", + "message": "message2069" + }, + { + "key": "", + "message": "message2070" + }, + { + "key": "", + "message": "message2071" + }, + { + "key": "", + "message": "message2072" + }, + { + "key": "", + "message": "message2073" + }, + { + "key": "", + "message": "message2074" + }, + { + "key": "", + "message": "message2075" + }, + { + "key": "", + "message": "message2076" + }, + { + "key": "", + "message": "message2077" + }, + { + "key": "", + "message": "message2078" + }, + { + "key": "", + "message": "message2079" + }, + { + "key": "", + "message": "message2080" + }, + { + "key": "", + "message": "message2081" + }, + { + "key": "", + "message": "message2082" + }, + { + "key": "", + "message": "message2083" + }, + { + "key": "", + "message": "message2084" + }, + { + "key": "", + "message": "message2085" + }, + { + "key": "", + "message": "message2086" + }, + { + "key": "", + "message": "message2087" + }, + { + "key": "", + "message": "message2088" + }, + { + "key": "", + "message": "message2089" + }, + { + "key": "", + "message": "message2090" + }, + { + "key": "", + "message": "message2091" + }, + { + "key": "", + "message": "message2092" + }, + { + "key": "", + "message": "message2093" + }, + { + "key": "", + "message": "message2094" + }, + { + "key": "", + "message": "message2095" + }, + { + "key": "", + "message": "message2096" + }, + { + "key": "", + "message": "message2097" + }, + { + "key": "", + "message": "message2098" + }, + { + "key": "", + "message": "message2099" + }, + { + "key": "", + "message": "message2100" + }, + { + "key": "", + "message": "message2101" + }, + { + "key": "", + "message": "message2102" + }, + { + "key": "", + "message": "message2103" + }, + { + "key": "", + "message": "message2104" + }, + { + "key": "", + "message": "message2105" + }, + { + "key": "", + "message": "message2106" + }, + { + "key": "", + "message": "message2107" + }, + { + "key": "", + "message": "message2108" + }, + { + "key": "", + "message": "message2109" + }, + { + "key": "", + "message": "message2110" + }, + { + "key": "", + "message": "message2111" + }, + { + "key": "", + "message": "message2112" + }, + { + "key": "", + "message": "message2113" + }, + { + "key": "", + "message": "message2114" + }, + { + "key": "", + "message": "message2115" + }, + { + "key": "", + "message": "message2116" + }, + { + "key": "", + "message": "message2117" + }, + { + "key": "", + "message": "message2118" + }, + { + "key": "", + "message": "message2119" + }, + { + "key": "", + "message": "message2120" + }, + { + "key": "", + "message": "message2121" + }, + { + "key": "", + "message": "message2122" + }, + { + "key": "", + "message": "message2123" + }, + { + "key": "", + "message": "message2124" + }, + { + "key": "", + "message": "message2125" + }, + { + "key": "", + "message": "message2126" + }, + { + "key": "", + "message": "message2127" + }, + { + "key": "", + "message": "message2128" + }, + { + "key": "", + "message": "message2129" + }, + { + "key": "", + "message": "message2130" + }, + { + "key": "", + "message": "message2131" + }, + { + "key": "", + "message": "message2132" + }, + { + "key": "", + "message": "message2133" + }, + { + "key": "", + "message": "message2134" + }, + { + "key": "", + "message": "message2135" + }, + { + "key": "", + "message": "message2136" + }, + { + "key": "", + "message": "message2137" + }, + { + "key": "", + "message": "message2138" + }, + { + "key": "", + "message": "message2139" + }, + { + "key": "", + "message": "message2140" + }, + { + "key": "", + "message": "message2141" + }, + { + "key": "", + "message": "message2142" + }, + { + "key": "", + "message": "message2143" + }, + { + "key": "", + "message": "message2144" + }, + { + "key": "", + "message": "message2145" + }, + { + "key": "", + "message": "message2146" + }, + { + "key": "", + "message": "message2147" + }, + { + "key": "", + "message": "message2148" + }, + { + "key": "", + "message": "message2149" + }, + { + "key": "", + "message": "message2150" + }, + { + "key": "", + "message": "message2151" + }, + { + "key": "", + "message": "message2152" + }, + { + "key": "", + "message": "message2153" + }, + { + "key": "", + "message": "message2154" + }, + { + "key": "", + "message": "message2155" + }, + { + "key": "", + "message": "message2156" + }, + { + "key": "", + "message": "message2157" + }, + { + "key": "", + "message": "message2158" + }, + { + "key": "", + "message": "message2159" + }, + { + "key": "", + "message": "message2160" + }, + { + "key": "", + "message": "message2161" + }, + { + "key": "", + "message": "message2162" + }, + { + "key": "", + "message": "message2163" + }, + { + "key": "", + "message": "message2164" + }, + { + "key": "", + "message": "message2165" + }, + { + "key": "", + "message": "message2166" + }, + { + "key": "", + "message": "message2167" + }, + { + "key": "", + "message": "message2168" + }, + { + "key": "", + "message": "message2169" + }, + { + "key": "", + "message": "message2170" + }, + { + "key": "", + "message": "message2171" + }, + { + "key": "", + "message": "message2172" + }, + { + "key": "", + "message": "message2173" + }, + { + "key": "", + "message": "message2174" + }, + { + "key": "", + "message": "message2175" + }, + { + "key": "", + "message": "message2176" + }, + { + "key": "", + "message": "message2177" + }, + { + "key": "", + "message": "message2178" + }, + { + "key": "", + "message": "message2179" + }, + { + "key": "", + "message": "message2180" + }, + { + "key": "", + "message": "message2181" + }, + { + "key": "", + "message": "message2182" + }, + { + "key": "", + "message": "message2183" + }, + { + "key": "", + "message": "message2184" + }, + { + "key": "", + "message": "message2185" + }, + { + "key": "", + "message": "message2186" + }, + { + "key": "", + "message": "message2187" + }, + { + "key": "", + "message": "message2188" + }, + { + "key": "", + "message": "message2189" + }, + { + "key": "", + "message": "message2190" + }, + { + "key": "", + "message": "message2191" + }, + { + "key": "", + "message": "message2192" + }, + { + "key": "", + "message": "message2193" + }, + { + "key": "", + "message": "message2194" + }, + { + "key": "", + "message": "message2195" + }, + { + "key": "", + "message": "message2196" + }, + { + "key": "", + "message": "message2197" + }, + { + "key": "", + "message": "message2198" + }, + { + "key": "", + "message": "message2199" + }, + { + "key": "", + "message": "message2200" + }, + { + "key": "", + "message": "message2201" + }, + { + "key": "", + "message": "message2202" + }, + { + "key": "", + "message": "message2203" + }, + { + "key": "", + "message": "message2204" + }, + { + "key": "", + "message": "message2205" + }, + { + "key": "", + "message": "message2206" + }, + { + "key": "", + "message": "message2207" + }, + { + "key": "", + "message": "message2208" + }, + { + "key": "", + "message": "message2209" + }, + { + "key": "", + "message": "message2210" + }, + { + "key": "", + "message": "message2211" + }, + { + "key": "", + "message": "message2212" + }, + { + "key": "", + "message": "message2213" + }, + { + "key": "", + "message": "message2214" + }, + { + "key": "", + "message": "message2215" + }, + { + "key": "", + "message": "message2216" + }, + { + "key": "", + "message": "message2217" + }, + { + "key": "", + "message": "message2218" + }, + { + "key": "", + "message": "message2219" + }, + { + "key": "", + "message": "message2220" + }, + { + "key": "", + "message": "message2221" + }, + { + "key": "", + "message": "message2222" + }, + { + "key": "", + "message": "message2223" + }, + { + "key": "", + "message": "message2224" + }, + { + "key": "", + "message": "message2225" + }, + { + "key": "", + "message": "message2226" + }, + { + "key": "", + "message": "message2227" + }, + { + "key": "", + "message": "message2228" + }, + { + "key": "", + "message": "message2229" + }, + { + "key": "", + "message": "message2230" + }, + { + "key": "", + "message": "message2231" + }, + { + "key": "", + "message": "message2232" + }, + { + "key": "", + "message": "message2233" + }, + { + "key": "", + "message": "message2234" + }, + { + "key": "", + "message": "message2235" + }, + { + "key": "", + "message": "message2236" + }, + { + "key": "", + "message": "message2237" + }, + { + "key": "", + "message": "message2238" + }, + { + "key": "", + "message": "message2239" + }, + { + "key": "", + "message": "message2240" + }, + { + "key": "", + "message": "message2241" + }, + { + "key": "", + "message": "message2242" + }, + { + "key": "", + "message": "message2243" + }, + { + "key": "", + "message": "message2244" + }, + { + "key": "", + "message": "message2245" + }, + { + "key": "", + "message": "message2246" + }, + { + "key": "", + "message": "message2247" + }, + { + "key": "", + "message": "message2248" + }, + { + "key": "", + "message": "message2249" + }, + { + "key": "", + "message": "message2250" + }, + { + "key": "", + "message": "message2251" + }, + { + "key": "", + "message": "message2252" + }, + { + "key": "", + "message": "message2253" + }, + { + "key": "", + "message": "message2254" + }, + { + "key": "", + "message": "message2255" + }, + { + "key": "", + "message": "message2256" + }, + { + "key": "", + "message": "message2257" + }, + { + "key": "", + "message": "message2258" + }, + { + "key": "", + "message": "message2259" + }, + { + "key": "", + "message": "message2260" + }, + { + "key": "", + "message": "message2261" + }, + { + "key": "", + "message": "message2262" + }, + { + "key": "", + "message": "message2263" + }, + { + "key": "", + "message": "message2264" + }, + { + "key": "", + "message": "message2265" + }, + { + "key": "", + "message": "message2266" + }, + { + "key": "", + "message": "message2267" + }, + { + "key": "", + "message": "message2268" + }, + { + "key": "", + "message": "message2269" + }, + { + "key": "", + "message": "message2270" + }, + { + "key": "", + "message": "message2271" + }, + { + "key": "", + "message": "message2272" + }, + { + "key": "", + "message": "message2273" + }, + { + "key": "", + "message": "message2274" + }, + { + "key": "", + "message": "message2275" + }, + { + "key": "", + "message": "message2276" + }, + { + "key": "", + "message": "message2277" + }, + { + "key": "", + "message": "message2278" + }, + { + "key": "", + "message": "message2279" + }, + { + "key": "", + "message": "message2280" + }, + { + "key": "", + "message": "message2281" + }, + { + "key": "", + "message": "message2282" + }, + { + "key": "", + "message": "message2283" + }, + { + "key": "", + "message": "message2284" + }, + { + "key": "", + "message": "message2285" + }, + { + "key": "", + "message": "message2286" + }, + { + "key": "", + "message": "message2287" + }, + { + "key": "", + "message": "message2288" + }, + { + "key": "", + "message": "message2289" + }, + { + "key": "", + "message": "message2290" + }, + { + "key": "", + "message": "message2291" + }, + { + "key": "", + "message": "message2292" + }, + { + "key": "", + "message": "message2293" + }, + { + "key": "", + "message": "message2294" + }, + { + "key": "", + "message": "message2295" + }, + { + "key": "", + "message": "message2296" + }, + { + "key": "", + "message": "message2297" + }, + { + "key": "", + "message": "message2298" + }, + { + "key": "", + "message": "message2299" + }, + { + "key": "", + "message": "message2300" + }, + { + "key": "", + "message": "message2301" + }, + { + "key": "", + "message": "message2302" + }, + { + "key": "", + "message": "message2303" + }, + { + "key": "", + "message": "message2304" + }, + { + "key": "", + "message": "message2305" + }, + { + "key": "", + "message": "message2306" + }, + { + "key": "", + "message": "message2307" + }, + { + "key": "", + "message": "message2308" + }, + { + "key": "", + "message": "message2309" + }, + { + "key": "", + "message": "message2310" + }, + { + "key": "", + "message": "message2311" + }, + { + "key": "", + "message": "message2312" + }, + { + "key": "", + "message": "message2313" + }, + { + "key": "", + "message": "message2314" + }, + { + "key": "", + "message": "message2315" + }, + { + "key": "", + "message": "message2316" + }, + { + "key": "", + "message": "message2317" + }, + { + "key": "", + "message": "message2318" + }, + { + "key": "", + "message": "message2319" + }, + { + "key": "", + "message": "message2320" + }, + { + "key": "", + "message": "message2321" + }, + { + "key": "", + "message": "message2322" + }, + { + "key": "", + "message": "message2323" + }, + { + "key": "", + "message": "message2324" + }, + { + "key": "", + "message": "message2325" + }, + { + "key": "", + "message": "message2326" + }, + { + "key": "", + "message": "message2327" + }, + { + "key": "", + "message": "message2328" + }, + { + "key": "", + "message": "message2329" + }, + { + "key": "", + "message": "message2330" + }, + { + "key": "", + "message": "message2331" + }, + { + "key": "", + "message": "message2332" + }, + { + "key": "", + "message": "message2333" + }, + { + "key": "", + "message": "message2334" + }, + { + "key": "", + "message": "message2335" + }, + { + "key": "", + "message": "message2336" + }, + { + "key": "", + "message": "message2337" + }, + { + "key": "", + "message": "message2338" + }, + { + "key": "", + "message": "message2339" + }, + { + "key": "", + "message": "message2340" + }, + { + "key": "", + "message": "message2341" + }, + { + "key": "", + "message": "message2342" + }, + { + "key": "", + "message": "message2343" + }, + { + "key": "", + "message": "message2344" + }, + { + "key": "", + "message": "message2345" + }, + { + "key": "", + "message": "message2346" + }, + { + "key": "", + "message": "message2347" + }, + { + "key": "", + "message": "message2348" + }, + { + "key": "", + "message": "message2349" + }, + { + "key": "", + "message": "message2350" + }, + { + "key": "", + "message": "message2351" + }, + { + "key": "", + "message": "message2352" + }, + { + "key": "", + "message": "message2353" + }, + { + "key": "", + "message": "message2354" + }, + { + "key": "", + "message": "message2355" + }, + { + "key": "", + "message": "message2356" + }, + { + "key": "", + "message": "message2357" + }, + { + "key": "", + "message": "message2358" + }, + { + "key": "", + "message": "message2359" + }, + { + "key": "", + "message": "message2360" + }, + { + "key": "", + "message": "message2361" + }, + { + "key": "", + "message": "message2362" + }, + { + "key": "", + "message": "message2363" + }, + { + "key": "", + "message": "message2364" + }, + { + "key": "", + "message": "message2365" + }, + { + "key": "", + "message": "message2366" + }, + { + "key": "", + "message": "message2367" + }, + { + "key": "", + "message": "message2368" + }, + { + "key": "", + "message": "message2369" + }, + { + "key": "", + "message": "message2370" + }, + { + "key": "", + "message": "message2371" + }, + { + "key": "", + "message": "message2372" + }, + { + "key": "", + "message": "message2373" + }, + { + "key": "", + "message": "message2374" + }, + { + "key": "", + "message": "message2375" + }, + { + "key": "", + "message": "message2376" + }, + { + "key": "", + "message": "message2377" + }, + { + "key": "", + "message": "message2378" + }, + { + "key": "", + "message": "message2379" + }, + { + "key": "", + "message": "message2380" + }, + { + "key": "", + "message": "message2381" + }, + { + "key": "", + "message": "message2382" + }, + { + "key": "", + "message": "message2383" + }, + { + "key": "", + "message": "message2384" + }, + { + "key": "", + "message": "message2385" + }, + { + "key": "", + "message": "message2386" + }, + { + "key": "", + "message": "message2387" + }, + { + "key": "", + "message": "message2388" + }, + { + "key": "", + "message": "message2389" + }, + { + "key": "", + "message": "message2390" + }, + { + "key": "", + "message": "message2391" + }, + { + "key": "", + "message": "message2392" + }, + { + "key": "", + "message": "message2393" + }, + { + "key": "", + "message": "message2394" + }, + { + "key": "", + "message": "message2395" + }, + { + "key": "", + "message": "message2396" + }, + { + "key": "", + "message": "message2397" + }, + { + "key": "", + "message": "message2398" + }, + { + "key": "", + "message": "message2399" + }, + { + "key": "", + "message": "message2400" + }, + { + "key": "AAA", + "message": "message2401" + }, + { + "key": "AAA", + "message": "message2402" + }, + { + "key": "AAA", + "message": "message2403" + }, + { + "key": "AAA", + "message": "message2404" + }, + { + "key": "AAA", + "message": "message2405" + }, + { + "key": "AAA", + "message": "message2406" + }, + { + "key": "AAA", + "message": "message2407" + }, + { + "key": "AAA", + "message": "message2408" + }, + { + "key": "AAA", + "message": "message2409" + }, + { + "key": "AAA", + "message": "message2410" + }, + { + "key": "AAA", + "message": "message2411" + }, + { + "key": "AAA", + "message": "message2412" + }, + { + "key": "AAA", + "message": "message2413" + }, + { + "key": "AAA", + "message": "message2414" + }, + { + "key": "AAA", + "message": "message2415" + }, + { + "key": "AAA", + "message": "message2416" + }, + { + "key": "AAA", + "message": "message2417" + }, + { + "key": "AAA", + "message": "message2418" + }, + { + "key": "AAA", + "message": "message2419" + }, + { + "key": "AAA", + "message": "message2420" + }, + { + "key": "AAA", + "message": "message2421" + }, + { + "key": "AAA", + "message": "message2422" + }, + { + "key": "AAA", + "message": "message2423" + }, + { + "key": "AAA", + "message": "message2424" + }, + { + "key": "AAA", + "message": "message2425" + }, + { + "key": "AAA", + "message": "message2426" + }, + { + "key": "AAA", + "message": "message2427" + }, + { + "key": "AAA", + "message": "message2428" + }, + { + "key": "AAA", + "message": "message2429" + }, + { + "key": "AAA", + "message": "message2430" + }, + { + "key": "AAA", + "message": "message2431" + }, + { + "key": "AAA", + "message": "message2432" + }, + { + "key": "AAA", + "message": "message2433" + }, + { + "key": "AAA", + "message": "message2434" + }, + { + "key": "AAA", + "message": "message2435" + }, + { + "key": "AAA", + "message": "message2436" + }, + { + "key": "AAA", + "message": "message2437" + }, + { + "key": "AAA", + "message": "message2438" + }, + { + "key": "AAA", + "message": "message2439" + }, + { + "key": "AAA", + "message": "message2440" + }, + { + "key": "AAA", + "message": "message2441" + }, + { + "key": "AAA", + "message": "message2442" + }, + { + "key": "AAA", + "message": "message2443" + }, + { + "key": "AAA", + "message": "message2444" + }, + { + "key": "AAA", + "message": "message2445" + }, + { + "key": "AAA", + "message": "message2446" + }, + { + "key": "AAA", + "message": "message2447" + }, + { + "key": "AAA", + "message": "message2448" + }, + { + "key": "AAA", + "message": "message2449" + }, + { + "key": "AAA", + "message": "message2450" + }, + { + "key": "AAA", + "message": "message2451" + }, + { + "key": "AAA", + "message": "message2452" + }, + { + "key": "AAA", + "message": "message2453" + }, + { + "key": "AAA", + "message": "message2454" + }, + { + "key": "AAA", + "message": "message2455" + }, + { + "key": "AAA", + "message": "message2456" + }, + { + "key": "AAA", + "message": "message2457" + }, + { + "key": "AAA", + "message": "message2458" + }, + { + "key": "AAA", + "message": "message2459" + }, + { + "key": "AAA", + "message": "message2460" + }, + { + "key": "AAA", + "message": "message2461" + }, + { + "key": "AAA", + "message": "message2462" + }, + { + "key": "AAA", + "message": "message2463" + }, + { + "key": "AAA", + "message": "message2464" + }, + { + "key": "AAA", + "message": "message2465" + }, + { + "key": "AAA", + "message": "message2466" + }, + { + "key": "AAA", + "message": "message2467" + }, + { + "key": "AAA", + "message": "message2468" + }, + { + "key": "AAA", + "message": "message2469" + }, + { + "key": "AAA", + "message": "message2470" + }, + { + "key": "AAA", + "message": "message2471" + }, + { + "key": "AAA", + "message": "message2472" + }, + { + "key": "AAA", + "message": "message2473" + }, + { + "key": "AAA", + "message": "message2474" + }, + { + "key": "AAA", + "message": "message2475" + }, + { + "key": "AAA", + "message": "message2476" + }, + { + "key": "AAA", + "message": "message2477" + }, + { + "key": "AAA", + "message": "message2478" + }, + { + "key": "AAA", + "message": "message2479" + }, + { + "key": "AAA", + "message": "message2480" + }, + { + "key": "AAA", + "message": "message2481" + }, + { + "key": "AAA", + "message": "message2482" + }, + { + "key": "AAA", + "message": "message2483" + }, + { + "key": "AAA", + "message": "message2484" + }, + { + "key": "AAA", + "message": "message2485" + }, + { + "key": "AAA", + "message": "message2486" + }, + { + "key": "AAA", + "message": "message2487" + }, + { + "key": "AAA", + "message": "message2488" + }, + { + "key": "AAA", + "message": "message2489" + }, + { + "key": "AAA", + "message": "message2490" + }, + { + "key": "AAA", + "message": "message2491" + }, + { + "key": "AAA", + "message": "message2492" + }, + { + "key": "AAA", + "message": "message2493" + }, + { + "key": "AAA", + "message": "message2494" + }, + { + "key": "AAA", + "message": "message2495" + }, + { + "key": "AAA", + "message": "message2496" + }, + { + "key": "AAA", + "message": "message2497" + }, + { + "key": "AAA", + "message": "message2498" + }, + { + "key": "AAA", + "message": "message2499" + }, + { + "key": "AAA", + "message": "message2500" + }, + { + "key": "AAA", + "message": "message2501" + }, + { + "key": "AAA", + "message": "message2502" + }, + { + "key": "AAA", + "message": "message2503" + }, + { + "key": "AAA", + "message": "message2504" + }, + { + "key": "AAA", + "message": "message2505" + }, + { + "key": "AAA", + "message": "message2506" + }, + { + "key": "AAA", + "message": "message2507" + }, + { + "key": "AAA", + "message": "message2508" + }, + { + "key": "AAA", + "message": "message2509" + }, + { + "key": "AAA", + "message": "message2510" + }, + { + "key": "AAA", + "message": "message2511" + }, + { + "key": "AAA", + "message": "message2512" + }, + { + "key": "AAA", + "message": "message2513" + }, + { + "key": "AAA", + "message": "message2514" + }, + { + "key": "AAA", + "message": "message2515" + }, + { + "key": "AAA", + "message": "message2516" + }, + { + "key": "AAA", + "message": "message2517" + }, + { + "key": "AAA", + "message": "message2518" + }, + { + "key": "AAA", + "message": "message2519" + }, + { + "key": "AAA", + "message": "message2520" + }, + { + "key": "AAA", + "message": "message2521" + }, + { + "key": "AAA", + "message": "message2522" + }, + { + "key": "AAA", + "message": "message2523" + }, + { + "key": "AAA", + "message": "message2524" + }, + { + "key": "AAA", + "message": "message2525" + }, + { + "key": "AAA", + "message": "message2526" + }, + { + "key": "AAA", + "message": "message2527" + }, + { + "key": "AAA", + "message": "message2528" + }, + { + "key": "AAA", + "message": "message2529" + }, + { + "key": "AAA", + "message": "message2530" + }, + { + "key": "AAA", + "message": "message2531" + }, + { + "key": "AAA", + "message": "message2532" + }, + { + "key": "AAA", + "message": "message2533" + }, + { + "key": "AAA", + "message": "message2534" + }, + { + "key": "AAA", + "message": "message2535" + }, + { + "key": "AAA", + "message": "message2536" + }, + { + "key": "AAA", + "message": "message2537" + }, + { + "key": "AAA", + "message": "message2538" + }, + { + "key": "AAA", + "message": "message2539" + }, + { + "key": "AAA", + "message": "message2540" + }, + { + "key": "AAA", + "message": "message2541" + }, + { + "key": "AAA", + "message": "message2542" + }, + { + "key": "AAA", + "message": "message2543" + }, + { + "key": "AAA", + "message": "message2544" + }, + { + "key": "AAA", + "message": "message2545" + }, + { + "key": "AAA", + "message": "message2546" + }, + { + "key": "AAA", + "message": "message2547" + }, + { + "key": "AAA", + "message": "message2548" + }, + { + "key": "AAA", + "message": "message2549" + }, + { + "key": "AAA", + "message": "message2550" + }, + { + "key": "AAA", + "message": "message2551" + }, + { + "key": "AAA", + "message": "message2552" + }, + { + "key": "AAA", + "message": "message2553" + }, + { + "key": "AAA", + "message": "message2554" + }, + { + "key": "AAA", + "message": "message2555" + }, + { + "key": "AAA", + "message": "message2556" + }, + { + "key": "AAA", + "message": "message2557" + }, + { + "key": "AAA", + "message": "message2558" + }, + { + "key": "AAA", + "message": "message2559" + }, + { + "key": "AAA", + "message": "message2560" + }, + { + "key": "AAA", + "message": "message2561" + }, + { + "key": "AAA", + "message": "message2562" + }, + { + "key": "AAA", + "message": "message2563" + }, + { + "key": "AAA", + "message": "message2564" + }, + { + "key": "AAA", + "message": "message2565" + }, + { + "key": "AAA", + "message": "message2566" + }, + { + "key": "AAA", + "message": "message2567" + }, + { + "key": "AAA", + "message": "message2568" + }, + { + "key": "AAA", + "message": "message2569" + }, + { + "key": "AAA", + "message": "message2570" + }, + { + "key": "AAA", + "message": "message2571" + }, + { + "key": "AAA", + "message": "message2572" + }, + { + "key": "AAA", + "message": "message2573" + }, + { + "key": "AAA", + "message": "message2574" + }, + { + "key": "AAA", + "message": "message2575" + }, + { + "key": "AAA", + "message": "message2576" + }, + { + "key": "AAA", + "message": "message2577" + }, + { + "key": "AAA", + "message": "message2578" + }, + { + "key": "AAA", + "message": "message2579" + }, + { + "key": "AAA", + "message": "message2580" + }, + { + "key": "AAA", + "message": "message2581" + }, + { + "key": "AAA", + "message": "message2582" + }, + { + "key": "AAA", + "message": "message2583" + }, + { + "key": "AAA", + "message": "message2584" + }, + { + "key": "AAA", + "message": "message2585" + }, + { + "key": "AAA", + "message": "message2586" + }, + { + "key": "AAA", + "message": "message2587" + }, + { + "key": "AAA", + "message": "message2588" + }, + { + "key": "AAA", + "message": "message2589" + }, + { + "key": "AAA", + "message": "message2590" + }, + { + "key": "AAA", + "message": "message2591" + }, + { + "key": "AAA", + "message": "message2592" + }, + { + "key": "AAA", + "message": "message2593" + }, + { + "key": "AAA", + "message": "message2594" + }, + { + "key": "AAA", + "message": "message2595" + }, + { + "key": "AAA", + "message": "message2596" + }, + { + "key": "AAA", + "message": "message2597" + }, + { + "key": "AAA", + "message": "message2598" + }, + { + "key": "AAA", + "message": "message2599" + }, + { + "key": "AAA", + "message": "message2600" + }, + { + "key": "AAA", + "message": "message2601" + }, + { + "key": "AAA", + "message": "message2602" + }, + { + "key": "AAA", + "message": "message2603" + }, + { + "key": "AAA", + "message": "message2604" + }, + { + "key": "AAA", + "message": "message2605" + }, + { + "key": "AAA", + "message": "message2606" + }, + { + "key": "AAA", + "message": "message2607" + }, + { + "key": "AAA", + "message": "message2608" + }, + { + "key": "AAA", + "message": "message2609" + }, + { + "key": "AAA", + "message": "message2610" + }, + { + "key": "AAA", + "message": "message2611" + }, + { + "key": "AAA", + "message": "message2612" + }, + { + "key": "AAA", + "message": "message2613" + }, + { + "key": "AAA", + "message": "message2614" + }, + { + "key": "AAA", + "message": "message2615" + }, + { + "key": "AAA", + "message": "message2616" + }, + { + "key": "AAA", + "message": "message2617" + }, + { + "key": "AAA", + "message": "message2618" + }, + { + "key": "AAA", + "message": "message2619" + }, + { + "key": "AAA", + "message": "message2620" + }, + { + "key": "AAA", + "message": "message2621" + }, + { + "key": "AAA", + "message": "message2622" + }, + { + "key": "AAA", + "message": "message2623" + }, + { + "key": "AAA", + "message": "message2624" + }, + { + "key": "AAA", + "message": "message2625" + }, + { + "key": "AAA", + "message": "message2626" + }, + { + "key": "AAA", + "message": "message2627" + }, + { + "key": "AAA", + "message": "message2628" + }, + { + "key": "AAA", + "message": "message2629" + }, + { + "key": "AAA", + "message": "message2630" + }, + { + "key": "AAA", + "message": "message2631" + }, + { + "key": "AAA", + "message": "message2632" + }, + { + "key": "AAA", + "message": "message2633" + }, + { + "key": "AAA", + "message": "message2634" + }, + { + "key": "AAA", + "message": "message2635" + }, + { + "key": "AAA", + "message": "message2636" + }, + { + "key": "AAA", + "message": "message2637" + }, + { + "key": "AAA", + "message": "message2638" + }, + { + "key": "AAA", + "message": "message2639" + }, + { + "key": "AAA", + "message": "message2640" + }, + { + "key": "AAA", + "message": "message2641" + }, + { + "key": "AAA", + "message": "message2642" + }, + { + "key": "AAA", + "message": "message2643" + }, + { + "key": "AAA", + "message": "message2644" + }, + { + "key": "AAA", + "message": "message2645" + }, + { + "key": "AAA", + "message": "message2646" + }, + { + "key": "AAA", + "message": "message2647" + }, + { + "key": "AAA", + "message": "message2648" + }, + { + "key": "AAA", + "message": "message2649" + }, + { + "key": "AAA", + "message": "message2650" + }, + { + "key": "AAA", + "message": "message2651" + }, + { + "key": "AAA", + "message": "message2652" + }, + { + "key": "AAA", + "message": "message2653" + }, + { + "key": "AAA", + "message": "message2654" + }, + { + "key": "AAA", + "message": "message2655" + }, + { + "key": "AAA", + "message": "message2656" + }, + { + "key": "AAA", + "message": "message2657" + }, + { + "key": "AAA", + "message": "message2658" + }, + { + "key": "AAA", + "message": "message2659" + }, + { + "key": "AAA", + "message": "message2660" + }, + { + "key": "AAA", + "message": "message2661" + }, + { + "key": "AAA", + "message": "message2662" + }, + { + "key": "AAA", + "message": "message2663" + }, + { + "key": "AAA", + "message": "message2664" + }, + { + "key": "AAA", + "message": "message2665" + }, + { + "key": "AAA", + "message": "message2666" + }, + { + "key": "AAA", + "message": "message2667" + }, + { + "key": "AAA", + "message": "message2668" + }, + { + "key": "AAA", + "message": "message2669" + }, + { + "key": "AAA", + "message": "message2670" + }, + { + "key": "AAA", + "message": "message2671" + }, + { + "key": "AAA", + "message": "message2672" + }, + { + "key": "AAA", + "message": "message2673" + }, + { + "key": "AAA", + "message": "message2674" + }, + { + "key": "AAA", + "message": "message2675" + }, + { + "key": "AAA", + "message": "message2676" + }, + { + "key": "AAA", + "message": "message2677" + }, + { + "key": "AAA", + "message": "message2678" + }, + { + "key": "AAA", + "message": "message2679" + }, + { + "key": "AAA", + "message": "message2680" + }, + { + "key": "AAA", + "message": "message2681" + }, + { + "key": "AAA", + "message": "message2682" + }, + { + "key": "AAA", + "message": "message2683" + }, + { + "key": "AAA", + "message": "message2684" + }, + { + "key": "AAA", + "message": "message2685" + }, + { + "key": "AAA", + "message": "message2686" + }, + { + "key": "AAA", + "message": "message2687" + }, + { + "key": "AAA", + "message": "message2688" + }, + { + "key": "AAA", + "message": "message2689" + }, + { + "key": "AAA", + "message": "message2690" + }, + { + "key": "AAA", + "message": "message2691" + }, + { + "key": "AAA", + "message": "message2692" + }, + { + "key": "AAA", + "message": "message2693" + }, + { + "key": "AAA", + "message": "message2694" + }, + { + "key": "AAA", + "message": "message2695" + }, + { + "key": "AAA", + "message": "message2696" + }, + { + "key": "AAA", + "message": "message2697" + }, + { + "key": "AAA", + "message": "message2698" + }, + { + "key": "AAA", + "message": "message2699" + }, + { + "key": "AAA", + "message": "message2700" + }, + { + "key": "AAA", + "message": "message2701" + }, + { + "key": "AAA", + "message": "message2702" + }, + { + "key": "AAA", + "message": "message2703" + }, + { + "key": "AAA", + "message": "message2704" + }, + { + "key": "AAA", + "message": "message2705" + }, + { + "key": "AAA", + "message": "message2706" + }, + { + "key": "AAA", + "message": "message2707" + }, + { + "key": "AAA", + "message": "message2708" + }, + { + "key": "AAA", + "message": "message2709" + }, + { + "key": "AAA", + "message": "message2710" + }, + { + "key": "AAA", + "message": "message2711" + }, + { + "key": "AAA", + "message": "message2712" + }, + { + "key": "AAA", + "message": "message2713" + }, + { + "key": "AAA", + "message": "message2714" + }, + { + "key": "AAA", + "message": "message2715" + }, + { + "key": "AAA", + "message": "message2716" + }, + { + "key": "AAA", + "message": "message2717" + }, + { + "key": "AAA", + "message": "message2718" + }, + { + "key": "AAA", + "message": "message2719" + }, + { + "key": "AAA", + "message": "message2720" + }, + { + "key": "AAA", + "message": "message2721" + }, + { + "key": "AAA", + "message": "message2722" + }, + { + "key": "AAA", + "message": "message2723" + }, + { + "key": "AAA", + "message": "message2724" + }, + { + "key": "AAA", + "message": "message2725" + }, + { + "key": "AAA", + "message": "message2726" + }, + { + "key": "AAA", + "message": "message2727" + }, + { + "key": "AAA", + "message": "message2728" + }, + { + "key": "AAA", + "message": "message2729" + }, + { + "key": "AAA", + "message": "message2730" + }, + { + "key": "AAA", + "message": "message2731" + }, + { + "key": "AAA", + "message": "message2732" + }, + { + "key": "AAA", + "message": "message2733" + }, + { + "key": "AAA", + "message": "message2734" + }, + { + "key": "AAA", + "message": "message2735" + }, + { + "key": "AAA", + "message": "message2736" + }, + { + "key": "AAA", + "message": "message2737" + }, + { + "key": "AAA", + "message": "message2738" + }, + { + "key": "AAA", + "message": "message2739" + }, + { + "key": "AAA", + "message": "message2740" + }, + { + "key": "AAA", + "message": "message2741" + }, + { + "key": "AAA", + "message": "message2742" + }, + { + "key": "AAA", + "message": "message2743" + }, + { + "key": "AAA", + "message": "message2744" + }, + { + "key": "AAA", + "message": "message2745" + }, + { + "key": "AAA", + "message": "message2746" + }, + { + "key": "AAA", + "message": "message2747" + }, + { + "key": "AAA", + "message": "message2748" + }, + { + "key": "AAA", + "message": "message2749" + }, + { + "key": "AAA", + "message": "message2750" + }, + { + "key": "AAA", + "message": "message2751" + }, + { + "key": "AAA", + "message": "message2752" + }, + { + "key": "AAA", + "message": "message2753" + }, + { + "key": "AAA", + "message": "message2754" + }, + { + "key": "AAA", + "message": "message2755" + }, + { + "key": "AAA", + "message": "message2756" + }, + { + "key": "AAA", + "message": "message2757" + }, + { + "key": "AAA", + "message": "message2758" + }, + { + "key": "AAA", + "message": "message2759" + }, + { + "key": "AAA", + "message": "message2760" + }, + { + "key": "AAA", + "message": "message2761" + }, + { + "key": "AAA", + "message": "message2762" + }, + { + "key": "AAA", + "message": "message2763" + }, + { + "key": "AAA", + "message": "message2764" + }, + { + "key": "AAA", + "message": "message2765" + }, + { + "key": "AAA", + "message": "message2766" + }, + { + "key": "AAA", + "message": "message2767" + }, + { + "key": "AAA", + "message": "message2768" + }, + { + "key": "AAA", + "message": "message2769" + }, + { + "key": "AAA", + "message": "message2770" + }, + { + "key": "AAA", + "message": "message2771" + }, + { + "key": "AAA", + "message": "message2772" + }, + { + "key": "AAA", + "message": "message2773" + }, + { + "key": "AAA", + "message": "message2774" + }, + { + "key": "AAA", + "message": "message2775" + }, + { + "key": "AAA", + "message": "message2776" + }, + { + "key": "AAA", + "message": "message2777" + }, + { + "key": "AAA", + "message": "message2778" + }, + { + "key": "AAA", + "message": "message2779" + }, + { + "key": "AAA", + "message": "message2780" + }, + { + "key": "AAA", + "message": "message2781" + }, + { + "key": "AAA", + "message": "message2782" + }, + { + "key": "AAA", + "message": "message2783" + }, + { + "key": "AAA", + "message": "message2784" + }, + { + "key": "AAA", + "message": "message2785" + }, + { + "key": "AAA", + "message": "message2786" + }, + { + "key": "AAA", + "message": "message2787" + }, + { + "key": "AAA", + "message": "message2788" + }, + { + "key": "AAA", + "message": "message2789" + }, + { + "key": "AAA", + "message": "message2790" + }, + { + "key": "AAA", + "message": "message2791" + }, + { + "key": "AAA", + "message": "message2792" + }, + { + "key": "AAA", + "message": "message2793" + }, + { + "key": "AAA", + "message": "message2794" + }, + { + "key": "AAA", + "message": "message2795" + }, + { + "key": "AAA", + "message": "message2796" + }, + { + "key": "AAA", + "message": "message2797" + }, + { + "key": "AAA", + "message": "message2798" + }, + { + "key": "AAA", + "message": "message2799" + }, + { + "key": "AAA", + "message": "message2800" + }, + { + "key": "BBB", + "message": "message2801" + }, + { + "key": "BBB", + "message": "message2802" + }, + { + "key": "BBB", + "message": "message2803" + }, + { + "key": "BBB", + "message": "message2804" + }, + { + "key": "BBB", + "message": "message2805" + }, + { + "key": "BBB", + "message": "message2806" + }, + { + "key": "BBB", + "message": "message2807" + }, + { + "key": "BBB", + "message": "message2808" + }, + { + "key": "BBB", + "message": "message2809" + }, + { + "key": "BBB", + "message": "message2810" + }, + { + "key": "BBB", + "message": "message2811" + }, + { + "key": "BBB", + "message": "message2812" + }, + { + "key": "BBB", + "message": "message2813" + }, + { + "key": "BBB", + "message": "message2814" + }, + { + "key": "BBB", + "message": "message2815" + }, + { + "key": "BBB", + "message": "message2816" + }, + { + "key": "BBB", + "message": "message2817" + }, + { + "key": "BBB", + "message": "message2818" + }, + { + "key": "BBB", + "message": "message2819" + }, + { + "key": "BBB", + "message": "message2820" + }, + { + "key": "BBB", + "message": "message2821" + }, + { + "key": "BBB", + "message": "message2822" + }, + { + "key": "BBB", + "message": "message2823" + }, + { + "key": "BBB", + "message": "message2824" + }, + { + "key": "BBB", + "message": "message2825" + }, + { + "key": "BBB", + "message": "message2826" + }, + { + "key": "BBB", + "message": "message2827" + }, + { + "key": "BBB", + "message": "message2828" + }, + { + "key": "BBB", + "message": "message2829" + }, + { + "key": "BBB", + "message": "message2830" + }, + { + "key": "BBB", + "message": "message2831" + }, + { + "key": "BBB", + "message": "message2832" + }, + { + "key": "BBB", + "message": "message2833" + }, + { + "key": "BBB", + "message": "message2834" + }, + { + "key": "BBB", + "message": "message2835" + }, + { + "key": "BBB", + "message": "message2836" + }, + { + "key": "BBB", + "message": "message2837" + }, + { + "key": "BBB", + "message": "message2838" + }, + { + "key": "BBB", + "message": "message2839" + }, + { + "key": "BBB", + "message": "message2840" + }, + { + "key": "BBB", + "message": "message2841" + }, + { + "key": "BBB", + "message": "message2842" + }, + { + "key": "BBB", + "message": "message2843" + }, + { + "key": "BBB", + "message": "message2844" + }, + { + "key": "BBB", + "message": "message2845" + }, + { + "key": "BBB", + "message": "message2846" + }, + { + "key": "BBB", + "message": "message2847" + }, + { + "key": "BBB", + "message": "message2848" + }, + { + "key": "BBB", + "message": "message2849" + }, + { + "key": "BBB", + "message": "message2850" + }, + { + "key": "BBB", + "message": "message2851" + }, + { + "key": "BBB", + "message": "message2852" + }, + { + "key": "BBB", + "message": "message2853" + }, + { + "key": "BBB", + "message": "message2854" + }, + { + "key": "BBB", + "message": "message2855" + }, + { + "key": "BBB", + "message": "message2856" + }, + { + "key": "BBB", + "message": "message2857" + }, + { + "key": "BBB", + "message": "message2858" + }, + { + "key": "BBB", + "message": "message2859" + }, + { + "key": "BBB", + "message": "message2860" + }, + { + "key": "BBB", + "message": "message2861" + }, + { + "key": "BBB", + "message": "message2862" + }, + { + "key": "BBB", + "message": "message2863" + }, + { + "key": "BBB", + "message": "message2864" + }, + { + "key": "BBB", + "message": "message2865" + }, + { + "key": "BBB", + "message": "message2866" + }, + { + "key": "BBB", + "message": "message2867" + }, + { + "key": "BBB", + "message": "message2868" + }, + { + "key": "BBB", + "message": "message2869" + }, + { + "key": "BBB", + "message": "message2870" + }, + { + "key": "BBB", + "message": "message2871" + }, + { + "key": "BBB", + "message": "message2872" + }, + { + "key": "BBB", + "message": "message2873" + }, + { + "key": "BBB", + "message": "message2874" + }, + { + "key": "BBB", + "message": "message2875" + }, + { + "key": "BBB", + "message": "message2876" + }, + { + "key": "BBB", + "message": "message2877" + }, + { + "key": "BBB", + "message": "message2878" + }, + { + "key": "BBB", + "message": "message2879" + }, + { + "key": "BBB", + "message": "message2880" + }, + { + "key": "BBB", + "message": "message2881" + }, + { + "key": "BBB", + "message": "message2882" + }, + { + "key": "BBB", + "message": "message2883" + }, + { + "key": "BBB", + "message": "message2884" + }, + { + "key": "BBB", + "message": "message2885" + }, + { + "key": "BBB", + "message": "message2886" + }, + { + "key": "BBB", + "message": "message2887" + }, + { + "key": "BBB", + "message": "message2888" + }, + { + "key": "BBB", + "message": "message2889" + }, + { + "key": "BBB", + "message": "message2890" + }, + { + "key": "BBB", + "message": "message2891" + }, + { + "key": "BBB", + "message": "message2892" + }, + { + "key": "BBB", + "message": "message2893" + }, + { + "key": "BBB", + "message": "message2894" + }, + { + "key": "BBB", + "message": "message2895" + }, + { + "key": "BBB", + "message": "message2896" + }, + { + "key": "BBB", + "message": "message2897" + }, + { + "key": "BBB", + "message": "message2898" + }, + { + "key": "BBB", + "message": "message2899" + }, + { + "key": "BBB", + "message": "message2900" + }, + { + "key": "BBB", + "message": "message2901" + }, + { + "key": "BBB", + "message": "message2902" + }, + { + "key": "BBB", + "message": "message2903" + }, + { + "key": "BBB", + "message": "message2904" + }, + { + "key": "BBB", + "message": "message2905" + }, + { + "key": "BBB", + "message": "message2906" + }, + { + "key": "BBB", + "message": "message2907" + }, + { + "key": "BBB", + "message": "message2908" + }, + { + "key": "BBB", + "message": "message2909" + }, + { + "key": "BBB", + "message": "message2910" + }, + { + "key": "BBB", + "message": "message2911" + }, + { + "key": "BBB", + "message": "message2912" + }, + { + "key": "BBB", + "message": "message2913" + }, + { + "key": "BBB", + "message": "message2914" + }, + { + "key": "BBB", + "message": "message2915" + }, + { + "key": "BBB", + "message": "message2916" + }, + { + "key": "BBB", + "message": "message2917" + }, + { + "key": "BBB", + "message": "message2918" + }, + { + "key": "BBB", + "message": "message2919" + }, + { + "key": "BBB", + "message": "message2920" + }, + { + "key": "BBB", + "message": "message2921" + }, + { + "key": "BBB", + "message": "message2922" + }, + { + "key": "BBB", + "message": "message2923" + }, + { + "key": "BBB", + "message": "message2924" + }, + { + "key": "BBB", + "message": "message2925" + }, + { + "key": "BBB", + "message": "message2926" + }, + { + "key": "BBB", + "message": "message2927" + }, + { + "key": "BBB", + "message": "message2928" + }, + { + "key": "BBB", + "message": "message2929" + }, + { + "key": "BBB", + "message": "message2930" + }, + { + "key": "BBB", + "message": "message2931" + }, + { + "key": "BBB", + "message": "message2932" + }, + { + "key": "BBB", + "message": "message2933" + }, + { + "key": "BBB", + "message": "message2934" + }, + { + "key": "BBB", + "message": "message2935" + }, + { + "key": "BBB", + "message": "message2936" + }, + { + "key": "BBB", + "message": "message2937" + }, + { + "key": "BBB", + "message": "message2938" + }, + { + "key": "BBB", + "message": "message2939" + }, + { + "key": "BBB", + "message": "message2940" + }, + { + "key": "BBB", + "message": "message2941" + }, + { + "key": "BBB", + "message": "message2942" + }, + { + "key": "BBB", + "message": "message2943" + }, + { + "key": "BBB", + "message": "message2944" + }, + { + "key": "BBB", + "message": "message2945" + }, + { + "key": "BBB", + "message": "message2946" + }, + { + "key": "BBB", + "message": "message2947" + }, + { + "key": "BBB", + "message": "message2948" + }, + { + "key": "BBB", + "message": "message2949" + }, + { + "key": "BBB", + "message": "message2950" + }, + { + "key": "BBB", + "message": "message2951" + }, + { + "key": "BBB", + "message": "message2952" + }, + { + "key": "BBB", + "message": "message2953" + }, + { + "key": "BBB", + "message": "message2954" + }, + { + "key": "BBB", + "message": "message2955" + }, + { + "key": "BBB", + "message": "message2956" + }, + { + "key": "BBB", + "message": "message2957" + }, + { + "key": "BBB", + "message": "message2958" + }, + { + "key": "BBB", + "message": "message2959" + }, + { + "key": "BBB", + "message": "message2960" + }, + { + "key": "BBB", + "message": "message2961" + }, + { + "key": "BBB", + "message": "message2962" + }, + { + "key": "BBB", + "message": "message2963" + }, + { + "key": "BBB", + "message": "message2964" + }, + { + "key": "BBB", + "message": "message2965" + }, + { + "key": "BBB", + "message": "message2966" + }, + { + "key": "BBB", + "message": "message2967" + }, + { + "key": "BBB", + "message": "message2968" + }, + { + "key": "BBB", + "message": "message2969" + }, + { + "key": "BBB", + "message": "message2970" + }, + { + "key": "BBB", + "message": "message2971" + }, + { + "key": "BBB", + "message": "message2972" + }, + { + "key": "BBB", + "message": "message2973" + }, + { + "key": "BBB", + "message": "message2974" + }, + { + "key": "BBB", + "message": "message2975" + }, + { + "key": "BBB", + "message": "message2976" + }, + { + "key": "BBB", + "message": "message2977" + }, + { + "key": "BBB", + "message": "message2978" + }, + { + "key": "BBB", + "message": "message2979" + }, + { + "key": "BBB", + "message": "message2980" + }, + { + "key": "BBB", + "message": "message2981" + }, + { + "key": "BBB", + "message": "message2982" + }, + { + "key": "BBB", + "message": "message2983" + }, + { + "key": "BBB", + "message": "message2984" + }, + { + "key": "BBB", + "message": "message2985" + }, + { + "key": "BBB", + "message": "message2986" + }, + { + "key": "BBB", + "message": "message2987" + }, + { + "key": "BBB", + "message": "message2988" + }, + { + "key": "BBB", + "message": "message2989" + }, + { + "key": "BBB", + "message": "message2990" + }, + { + "key": "BBB", + "message": "message2991" + }, + { + "key": "BBB", + "message": "message2992" + }, + { + "key": "BBB", + "message": "message2993" + }, + { + "key": "BBB", + "message": "message2994" + }, + { + "key": "BBB", + "message": "message2995" + }, + { + "key": "BBB", + "message": "message2996" + }, + { + "key": "BBB", + "message": "message2997" + }, + { + "key": "BBB", + "message": "message2998" + }, + { + "key": "BBB", + "message": "message2999" + }, + { + "key": "BBB", + "message": "message3000" + }, + { + "key": "BBB", + "message": "message3001" + }, + { + "key": "BBB", + "message": "message3002" + }, + { + "key": "BBB", + "message": "message3003" + }, + { + "key": "BBB", + "message": "message3004" + }, + { + "key": "BBB", + "message": "message3005" + }, + { + "key": "BBB", + "message": "message3006" + }, + { + "key": "BBB", + "message": "message3007" + }, + { + "key": "BBB", + "message": "message3008" + }, + { + "key": "BBB", + "message": "message3009" + }, + { + "key": "BBB", + "message": "message3010" + }, + { + "key": "BBB", + "message": "message3011" + }, + { + "key": "BBB", + "message": "message3012" + }, + { + "key": "BBB", + "message": "message3013" + }, + { + "key": "BBB", + "message": "message3014" + }, + { + "key": "BBB", + "message": "message3015" + }, + { + "key": "BBB", + "message": "message3016" + }, + { + "key": "BBB", + "message": "message3017" + }, + { + "key": "BBB", + "message": "message3018" + }, + { + "key": "BBB", + "message": "message3019" + }, + { + "key": "BBB", + "message": "message3020" + }, + { + "key": "BBB", + "message": "message3021" + }, + { + "key": "BBB", + "message": "message3022" + }, + { + "key": "BBB", + "message": "message3023" + }, + { + "key": "BBB", + "message": "message3024" + }, + { + "key": "BBB", + "message": "message3025" + }, + { + "key": "BBB", + "message": "message3026" + }, + { + "key": "BBB", + "message": "message3027" + }, + { + "key": "BBB", + "message": "message3028" + }, + { + "key": "BBB", + "message": "message3029" + }, + { + "key": "BBB", + "message": "message3030" + }, + { + "key": "BBB", + "message": "message3031" + }, + { + "key": "BBB", + "message": "message3032" + }, + { + "key": "BBB", + "message": "message3033" + }, + { + "key": "BBB", + "message": "message3034" + }, + { + "key": "BBB", + "message": "message3035" + }, + { + "key": "BBB", + "message": "message3036" + }, + { + "key": "BBB", + "message": "message3037" + }, + { + "key": "BBB", + "message": "message3038" + }, + { + "key": "BBB", + "message": "message3039" + }, + { + "key": "BBB", + "message": "message3040" + }, + { + "key": "BBB", + "message": "message3041" + }, + { + "key": "BBB", + "message": "message3042" + }, + { + "key": "BBB", + "message": "message3043" + }, + { + "key": "BBB", + "message": "message3044" + }, + { + "key": "BBB", + "message": "message3045" + }, + { + "key": "BBB", + "message": "message3046" + }, + { + "key": "BBB", + "message": "message3047" + }, + { + "key": "BBB", + "message": "message3048" + }, + { + "key": "BBB", + "message": "message3049" + }, + { + "key": "BBB", + "message": "message3050" + }, + { + "key": "BBB", + "message": "message3051" + }, + { + "key": "BBB", + "message": "message3052" + }, + { + "key": "BBB", + "message": "message3053" + }, + { + "key": "BBB", + "message": "message3054" + }, + { + "key": "BBB", + "message": "message3055" + }, + { + "key": "BBB", + "message": "message3056" + }, + { + "key": "BBB", + "message": "message3057" + }, + { + "key": "BBB", + "message": "message3058" + }, + { + "key": "BBB", + "message": "message3059" + }, + { + "key": "BBB", + "message": "message3060" + }, + { + "key": "BBB", + "message": "message3061" + }, + { + "key": "BBB", + "message": "message3062" + }, + { + "key": "BBB", + "message": "message3063" + }, + { + "key": "BBB", + "message": "message3064" + }, + { + "key": "BBB", + "message": "message3065" + }, + { + "key": "BBB", + "message": "message3066" + }, + { + "key": "BBB", + "message": "message3067" + }, + { + "key": "BBB", + "message": "message3068" + }, + { + "key": "BBB", + "message": "message3069" + }, + { + "key": "BBB", + "message": "message3070" + }, + { + "key": "BBB", + "message": "message3071" + }, + { + "key": "BBB", + "message": "message3072" + }, + { + "key": "BBB", + "message": "message3073" + }, + { + "key": "BBB", + "message": "message3074" + }, + { + "key": "BBB", + "message": "message3075" + }, + { + "key": "BBB", + "message": "message3076" + }, + { + "key": "BBB", + "message": "message3077" + }, + { + "key": "BBB", + "message": "message3078" + }, + { + "key": "BBB", + "message": "message3079" + }, + { + "key": "BBB", + "message": "message3080" + }, + { + "key": "BBB", + "message": "message3081" + }, + { + "key": "BBB", + "message": "message3082" + }, + { + "key": "BBB", + "message": "message3083" + }, + { + "key": "BBB", + "message": "message3084" + }, + { + "key": "BBB", + "message": "message3085" + }, + { + "key": "BBB", + "message": "message3086" + }, + { + "key": "BBB", + "message": "message3087" + }, + { + "key": "BBB", + "message": "message3088" + }, + { + "key": "BBB", + "message": "message3089" + }, + { + "key": "BBB", + "message": "message3090" + }, + { + "key": "BBB", + "message": "message3091" + }, + { + "key": "BBB", + "message": "message3092" + }, + { + "key": "BBB", + "message": "message3093" + }, + { + "key": "BBB", + "message": "message3094" + }, + { + "key": "BBB", + "message": "message3095" + }, + { + "key": "BBB", + "message": "message3096" + }, + { + "key": "BBB", + "message": "message3097" + }, + { + "key": "BBB", + "message": "message3098" + }, + { + "key": "BBB", + "message": "message3099" + }, + { + "key": "BBB", + "message": "message3100" + }, + { + "key": "BBB", + "message": "message3101" + }, + { + "key": "BBB", + "message": "message3102" + }, + { + "key": "BBB", + "message": "message3103" + }, + { + "key": "BBB", + "message": "message3104" + }, + { + "key": "BBB", + "message": "message3105" + }, + { + "key": "BBB", + "message": "message3106" + }, + { + "key": "BBB", + "message": "message3107" + }, + { + "key": "BBB", + "message": "message3108" + }, + { + "key": "BBB", + "message": "message3109" + }, + { + "key": "BBB", + "message": "message3110" + }, + { + "key": "BBB", + "message": "message3111" + }, + { + "key": "BBB", + "message": "message3112" + }, + { + "key": "BBB", + "message": "message3113" + }, + { + "key": "BBB", + "message": "message3114" + }, + { + "key": "BBB", + "message": "message3115" + }, + { + "key": "BBB", + "message": "message3116" + }, + { + "key": "BBB", + "message": "message3117" + }, + { + "key": "BBB", + "message": "message3118" + }, + { + "key": "BBB", + "message": "message3119" + }, + { + "key": "BBB", + "message": "message3120" + }, + { + "key": "BBB", + "message": "message3121" + }, + { + "key": "BBB", + "message": "message3122" + }, + { + "key": "BBB", + "message": "message3123" + }, + { + "key": "BBB", + "message": "message3124" + }, + { + "key": "BBB", + "message": "message3125" + }, + { + "key": "BBB", + "message": "message3126" + }, + { + "key": "BBB", + "message": "message3127" + }, + { + "key": "BBB", + "message": "message3128" + }, + { + "key": "BBB", + "message": "message3129" + }, + { + "key": "BBB", + "message": "message3130" + }, + { + "key": "BBB", + "message": "message3131" + }, + { + "key": "BBB", + "message": "message3132" + }, + { + "key": "BBB", + "message": "message3133" + }, + { + "key": "BBB", + "message": "message3134" + }, + { + "key": "BBB", + "message": "message3135" + }, + { + "key": "BBB", + "message": "message3136" + }, + { + "key": "BBB", + "message": "message3137" + }, + { + "key": "BBB", + "message": "message3138" + }, + { + "key": "BBB", + "message": "message3139" + }, + { + "key": "BBB", + "message": "message3140" + }, + { + "key": "BBB", + "message": "message3141" + }, + { + "key": "BBB", + "message": "message3142" + }, + { + "key": "BBB", + "message": "message3143" + }, + { + "key": "BBB", + "message": "message3144" + }, + { + "key": "BBB", + "message": "message3145" + }, + { + "key": "BBB", + "message": "message3146" + }, + { + "key": "BBB", + "message": "message3147" + }, + { + "key": "BBB", + "message": "message3148" + }, + { + "key": "BBB", + "message": "message3149" + }, + { + "key": "BBB", + "message": "message3150" + }, + { + "key": "BBB", + "message": "message3151" + }, + { + "key": "BBB", + "message": "message3152" + }, + { + "key": "BBB", + "message": "message3153" + }, + { + "key": "BBB", + "message": "message3154" + }, + { + "key": "BBB", + "message": "message3155" + }, + { + "key": "BBB", + "message": "message3156" + }, + { + "key": "BBB", + "message": "message3157" + }, + { + "key": "BBB", + "message": "message3158" + }, + { + "key": "BBB", + "message": "message3159" + }, + { + "key": "BBB", + "message": "message3160" + }, + { + "key": "BBB", + "message": "message3161" + }, + { + "key": "BBB", + "message": "message3162" + }, + { + "key": "BBB", + "message": "message3163" + }, + { + "key": "BBB", + "message": "message3164" + }, + { + "key": "BBB", + "message": "message3165" + }, + { + "key": "BBB", + "message": "message3166" + }, + { + "key": "BBB", + "message": "message3167" + }, + { + "key": "BBB", + "message": "message3168" + }, + { + "key": "BBB", + "message": "message3169" + }, + { + "key": "BBB", + "message": "message3170" + }, + { + "key": "BBB", + "message": "message3171" + }, + { + "key": "BBB", + "message": "message3172" + }, + { + "key": "BBB", + "message": "message3173" + }, + { + "key": "BBB", + "message": "message3174" + }, + { + "key": "BBB", + "message": "message3175" + }, + { + "key": "BBB", + "message": "message3176" + }, + { + "key": "BBB", + "message": "message3177" + }, + { + "key": "BBB", + "message": "message3178" + }, + { + "key": "BBB", + "message": "message3179" + }, + { + "key": "BBB", + "message": "message3180" + }, + { + "key": "BBB", + "message": "message3181" + }, + { + "key": "BBB", + "message": "message3182" + }, + { + "key": "BBB", + "message": "message3183" + }, + { + "key": "BBB", + "message": "message3184" + }, + { + "key": "BBB", + "message": "message3185" + }, + { + "key": "BBB", + "message": "message3186" + }, + { + "key": "BBB", + "message": "message3187" + }, + { + "key": "BBB", + "message": "message3188" + }, + { + "key": "BBB", + "message": "message3189" + }, + { + "key": "BBB", + "message": "message3190" + }, + { + "key": "BBB", + "message": "message3191" + }, + { + "key": "BBB", + "message": "message3192" + }, + { + "key": "BBB", + "message": "message3193" + }, + { + "key": "BBB", + "message": "message3194" + }, + { + "key": "BBB", + "message": "message3195" + }, + { + "key": "BBB", + "message": "message3196" + }, + { + "key": "BBB", + "message": "message3197" + }, + { + "key": "BBB", + "message": "message3198" + }, + { + "key": "BBB", + "message": "message3199" + }, + { + "key": "BBB", + "message": "message3200" + }, + { + "key": "CCC", + "message": "message3201" + }, + { + "key": "CCC", + "message": "message3202" + }, + { + "key": "CCC", + "message": "message3203" + }, + { + "key": "CCC", + "message": "message3204" + }, + { + "key": "CCC", + "message": "message3205" + }, + { + "key": "CCC", + "message": "message3206" + }, + { + "key": "CCC", + "message": "message3207" + }, + { + "key": "CCC", + "message": "message3208" + }, + { + "key": "CCC", + "message": "message3209" + }, + { + "key": "CCC", + "message": "message3210" + }, + { + "key": "CCC", + "message": "message3211" + }, + { + "key": "CCC", + "message": "message3212" + }, + { + "key": "CCC", + "message": "message3213" + }, + { + "key": "CCC", + "message": "message3214" + }, + { + "key": "CCC", + "message": "message3215" + }, + { + "key": "CCC", + "message": "message3216" + }, + { + "key": "CCC", + "message": "message3217" + }, + { + "key": "CCC", + "message": "message3218" + }, + { + "key": "CCC", + "message": "message3219" + }, + { + "key": "CCC", + "message": "message3220" + }, + { + "key": "CCC", + "message": "message3221" + }, + { + "key": "CCC", + "message": "message3222" + }, + { + "key": "CCC", + "message": "message3223" + }, + { + "key": "CCC", + "message": "message3224" + }, + { + "key": "CCC", + "message": "message3225" + }, + { + "key": "CCC", + "message": "message3226" + }, + { + "key": "CCC", + "message": "message3227" + }, + { + "key": "CCC", + "message": "message3228" + }, + { + "key": "CCC", + "message": "message3229" + }, + { + "key": "CCC", + "message": "message3230" + }, + { + "key": "CCC", + "message": "message3231" + }, + { + "key": "CCC", + "message": "message3232" + }, + { + "key": "CCC", + "message": "message3233" + }, + { + "key": "CCC", + "message": "message3234" + }, + { + "key": "CCC", + "message": "message3235" + }, + { + "key": "CCC", + "message": "message3236" + }, + { + "key": "CCC", + "message": "message3237" + }, + { + "key": "CCC", + "message": "message3238" + }, + { + "key": "CCC", + "message": "message3239" + }, + { + "key": "CCC", + "message": "message3240" + }, + { + "key": "CCC", + "message": "message3241" + }, + { + "key": "CCC", + "message": "message3242" + }, + { + "key": "CCC", + "message": "message3243" + }, + { + "key": "CCC", + "message": "message3244" + }, + { + "key": "CCC", + "message": "message3245" + }, + { + "key": "CCC", + "message": "message3246" + }, + { + "key": "CCC", + "message": "message3247" + }, + { + "key": "CCC", + "message": "message3248" + }, + { + "key": "CCC", + "message": "message3249" + }, + { + "key": "CCC", + "message": "message3250" + }, + { + "key": "CCC", + "message": "message3251" + }, + { + "key": "CCC", + "message": "message3252" + }, + { + "key": "CCC", + "message": "message3253" + }, + { + "key": "CCC", + "message": "message3254" + }, + { + "key": "CCC", + "message": "message3255" + }, + { + "key": "CCC", + "message": "message3256" + }, + { + "key": "CCC", + "message": "message3257" + }, + { + "key": "CCC", + "message": "message3258" + }, + { + "key": "CCC", + "message": "message3259" + }, + { + "key": "CCC", + "message": "message3260" + }, + { + "key": "CCC", + "message": "message3261" + }, + { + "key": "CCC", + "message": "message3262" + }, + { + "key": "CCC", + "message": "message3263" + }, + { + "key": "CCC", + "message": "message3264" + }, + { + "key": "CCC", + "message": "message3265" + }, + { + "key": "CCC", + "message": "message3266" + }, + { + "key": "CCC", + "message": "message3267" + }, + { + "key": "CCC", + "message": "message3268" + }, + { + "key": "CCC", + "message": "message3269" + }, + { + "key": "CCC", + "message": "message3270" + }, + { + "key": "CCC", + "message": "message3271" + }, + { + "key": "CCC", + "message": "message3272" + }, + { + "key": "CCC", + "message": "message3273" + }, + { + "key": "CCC", + "message": "message3274" + }, + { + "key": "CCC", + "message": "message3275" + }, + { + "key": "CCC", + "message": "message3276" + }, + { + "key": "CCC", + "message": "message3277" + }, + { + "key": "CCC", + "message": "message3278" + }, + { + "key": "CCC", + "message": "message3279" + }, + { + "key": "CCC", + "message": "message3280" + }, + { + "key": "CCC", + "message": "message3281" + }, + { + "key": "CCC", + "message": "message3282" + }, + { + "key": "CCC", + "message": "message3283" + }, + { + "key": "CCC", + "message": "message3284" + }, + { + "key": "CCC", + "message": "message3285" + }, + { + "key": "CCC", + "message": "message3286" + }, + { + "key": "CCC", + "message": "message3287" + }, + { + "key": "CCC", + "message": "message3288" + }, + { + "key": "CCC", + "message": "message3289" + }, + { + "key": "CCC", + "message": "message3290" + }, + { + "key": "CCC", + "message": "message3291" + }, + { + "key": "CCC", + "message": "message3292" + }, + { + "key": "CCC", + "message": "message3293" + }, + { + "key": "CCC", + "message": "message3294" + }, + { + "key": "CCC", + "message": "message3295" + }, + { + "key": "CCC", + "message": "message3296" + }, + { + "key": "CCC", + "message": "message3297" + }, + { + "key": "CCC", + "message": "message3298" + }, + { + "key": "CCC", + "message": "message3299" + }, + { + "key": "CCC", + "message": "message3300" + }, + { + "key": "CCC", + "message": "message3301" + }, + { + "key": "CCC", + "message": "message3302" + }, + { + "key": "CCC", + "message": "message3303" + }, + { + "key": "CCC", + "message": "message3304" + }, + { + "key": "CCC", + "message": "message3305" + }, + { + "key": "CCC", + "message": "message3306" + }, + { + "key": "CCC", + "message": "message3307" + }, + { + "key": "CCC", + "message": "message3308" + }, + { + "key": "CCC", + "message": "message3309" + }, + { + "key": "CCC", + "message": "message3310" + }, + { + "key": "CCC", + "message": "message3311" + }, + { + "key": "CCC", + "message": "message3312" + }, + { + "key": "CCC", + "message": "message3313" + }, + { + "key": "CCC", + "message": "message3314" + }, + { + "key": "CCC", + "message": "message3315" + }, + { + "key": "CCC", + "message": "message3316" + }, + { + "key": "CCC", + "message": "message3317" + }, + { + "key": "CCC", + "message": "message3318" + }, + { + "key": "CCC", + "message": "message3319" + }, + { + "key": "CCC", + "message": "message3320" + }, + { + "key": "CCC", + "message": "message3321" + }, + { + "key": "CCC", + "message": "message3322" + }, + { + "key": "CCC", + "message": "message3323" + }, + { + "key": "CCC", + "message": "message3324" + }, + { + "key": "CCC", + "message": "message3325" + }, + { + "key": "CCC", + "message": "message3326" + }, + { + "key": "CCC", + "message": "message3327" + }, + { + "key": "CCC", + "message": "message3328" + }, + { + "key": "CCC", + "message": "message3329" + }, + { + "key": "CCC", + "message": "message3330" + }, + { + "key": "CCC", + "message": "message3331" + }, + { + "key": "CCC", + "message": "message3332" + }, + { + "key": "CCC", + "message": "message3333" + }, + { + "key": "CCC", + "message": "message3334" + }, + { + "key": "CCC", + "message": "message3335" + }, + { + "key": "CCC", + "message": "message3336" + }, + { + "key": "CCC", + "message": "message3337" + }, + { + "key": "CCC", + "message": "message3338" + }, + { + "key": "CCC", + "message": "message3339" + }, + { + "key": "CCC", + "message": "message3340" + }, + { + "key": "CCC", + "message": "message3341" + }, + { + "key": "CCC", + "message": "message3342" + }, + { + "key": "CCC", + "message": "message3343" + }, + { + "key": "CCC", + "message": "message3344" + }, + { + "key": "CCC", + "message": "message3345" + }, + { + "key": "CCC", + "message": "message3346" + }, + { + "key": "CCC", + "message": "message3347" + }, + { + "key": "CCC", + "message": "message3348" + }, + { + "key": "CCC", + "message": "message3349" + }, + { + "key": "CCC", + "message": "message3350" + }, + { + "key": "CCC", + "message": "message3351" + }, + { + "key": "CCC", + "message": "message3352" + }, + { + "key": "CCC", + "message": "message3353" + }, + { + "key": "CCC", + "message": "message3354" + }, + { + "key": "CCC", + "message": "message3355" + }, + { + "key": "CCC", + "message": "message3356" + }, + { + "key": "CCC", + "message": "message3357" + }, + { + "key": "CCC", + "message": "message3358" + }, + { + "key": "CCC", + "message": "message3359" + }, + { + "key": "CCC", + "message": "message3360" + }, + { + "key": "CCC", + "message": "message3361" + }, + { + "key": "CCC", + "message": "message3362" + }, + { + "key": "CCC", + "message": "message3363" + }, + { + "key": "CCC", + "message": "message3364" + }, + { + "key": "CCC", + "message": "message3365" + }, + { + "key": "CCC", + "message": "message3366" + }, + { + "key": "CCC", + "message": "message3367" + }, + { + "key": "CCC", + "message": "message3368" + }, + { + "key": "CCC", + "message": "message3369" + }, + { + "key": "CCC", + "message": "message3370" + }, + { + "key": "CCC", + "message": "message3371" + }, + { + "key": "CCC", + "message": "message3372" + }, + { + "key": "CCC", + "message": "message3373" + }, + { + "key": "CCC", + "message": "message3374" + }, + { + "key": "CCC", + "message": "message3375" + }, + { + "key": "CCC", + "message": "message3376" + }, + { + "key": "CCC", + "message": "message3377" + }, + { + "key": "CCC", + "message": "message3378" + }, + { + "key": "CCC", + "message": "message3379" + }, + { + "key": "CCC", + "message": "message3380" + }, + { + "key": "CCC", + "message": "message3381" + }, + { + "key": "CCC", + "message": "message3382" + }, + { + "key": "CCC", + "message": "message3383" + }, + { + "key": "CCC", + "message": "message3384" + }, + { + "key": "CCC", + "message": "message3385" + }, + { + "key": "CCC", + "message": "message3386" + }, + { + "key": "CCC", + "message": "message3387" + }, + { + "key": "CCC", + "message": "message3388" + }, + { + "key": "CCC", + "message": "message3389" + }, + { + "key": "CCC", + "message": "message3390" + }, + { + "key": "CCC", + "message": "message3391" + }, + { + "key": "CCC", + "message": "message3392" + }, + { + "key": "CCC", + "message": "message3393" + }, + { + "key": "CCC", + "message": "message3394" + }, + { + "key": "CCC", + "message": "message3395" + }, + { + "key": "CCC", + "message": "message3396" + }, + { + "key": "CCC", + "message": "message3397" + }, + { + "key": "CCC", + "message": "message3398" + }, + { + "key": "CCC", + "message": "message3399" + }, + { + "key": "CCC", + "message": "message3400" + }, + { + "key": "CCC", + "message": "message3401" + }, + { + "key": "CCC", + "message": "message3402" + }, + { + "key": "CCC", + "message": "message3403" + }, + { + "key": "CCC", + "message": "message3404" + }, + { + "key": "CCC", + "message": "message3405" + }, + { + "key": "CCC", + "message": "message3406" + }, + { + "key": "CCC", + "message": "message3407" + }, + { + "key": "CCC", + "message": "message3408" + }, + { + "key": "CCC", + "message": "message3409" + }, + { + "key": "CCC", + "message": "message3410" + }, + { + "key": "CCC", + "message": "message3411" + }, + { + "key": "CCC", + "message": "message3412" + }, + { + "key": "CCC", + "message": "message3413" + }, + { + "key": "CCC", + "message": "message3414" + }, + { + "key": "CCC", + "message": "message3415" + }, + { + "key": "CCC", + "message": "message3416" + }, + { + "key": "CCC", + "message": "message3417" + }, + { + "key": "CCC", + "message": "message3418" + }, + { + "key": "CCC", + "message": "message3419" + }, + { + "key": "CCC", + "message": "message3420" + }, + { + "key": "CCC", + "message": "message3421" + }, + { + "key": "CCC", + "message": "message3422" + }, + { + "key": "CCC", + "message": "message3423" + }, + { + "key": "CCC", + "message": "message3424" + }, + { + "key": "CCC", + "message": "message3425" + }, + { + "key": "CCC", + "message": "message3426" + }, + { + "key": "CCC", + "message": "message3427" + }, + { + "key": "CCC", + "message": "message3428" + }, + { + "key": "CCC", + "message": "message3429" + }, + { + "key": "CCC", + "message": "message3430" + }, + { + "key": "CCC", + "message": "message3431" + }, + { + "key": "CCC", + "message": "message3432" + }, + { + "key": "CCC", + "message": "message3433" + }, + { + "key": "CCC", + "message": "message3434" + }, + { + "key": "CCC", + "message": "message3435" + }, + { + "key": "CCC", + "message": "message3436" + }, + { + "key": "CCC", + "message": "message3437" + }, + { + "key": "CCC", + "message": "message3438" + }, + { + "key": "CCC", + "message": "message3439" + }, + { + "key": "CCC", + "message": "message3440" + }, + { + "key": "CCC", + "message": "message3441" + }, + { + "key": "CCC", + "message": "message3442" + }, + { + "key": "CCC", + "message": "message3443" + }, + { + "key": "CCC", + "message": "message3444" + }, + { + "key": "CCC", + "message": "message3445" + }, + { + "key": "CCC", + "message": "message3446" + }, + { + "key": "CCC", + "message": "message3447" + }, + { + "key": "CCC", + "message": "message3448" + }, + { + "key": "CCC", + "message": "message3449" + }, + { + "key": "CCC", + "message": "message3450" + }, + { + "key": "CCC", + "message": "message3451" + }, + { + "key": "CCC", + "message": "message3452" + }, + { + "key": "CCC", + "message": "message3453" + }, + { + "key": "CCC", + "message": "message3454" + }, + { + "key": "CCC", + "message": "message3455" + }, + { + "key": "CCC", + "message": "message3456" + }, + { + "key": "CCC", + "message": "message3457" + }, + { + "key": "CCC", + "message": "message3458" + }, + { + "key": "CCC", + "message": "message3459" + }, + { + "key": "CCC", + "message": "message3460" + }, + { + "key": "CCC", + "message": "message3461" + }, + { + "key": "CCC", + "message": "message3462" + }, + { + "key": "CCC", + "message": "message3463" + }, + { + "key": "CCC", + "message": "message3464" + }, + { + "key": "CCC", + "message": "message3465" + }, + { + "key": "CCC", + "message": "message3466" + }, + { + "key": "CCC", + "message": "message3467" + }, + { + "key": "CCC", + "message": "message3468" + }, + { + "key": "CCC", + "message": "message3469" + }, + { + "key": "CCC", + "message": "message3470" + }, + { + "key": "CCC", + "message": "message3471" + }, + { + "key": "CCC", + "message": "message3472" + }, + { + "key": "CCC", + "message": "message3473" + }, + { + "key": "CCC", + "message": "message3474" + }, + { + "key": "CCC", + "message": "message3475" + }, + { + "key": "CCC", + "message": "message3476" + }, + { + "key": "CCC", + "message": "message3477" + }, + { + "key": "CCC", + "message": "message3478" + }, + { + "key": "CCC", + "message": "message3479" + }, + { + "key": "CCC", + "message": "message3480" + }, + { + "key": "CCC", + "message": "message3481" + }, + { + "key": "CCC", + "message": "message3482" + }, + { + "key": "CCC", + "message": "message3483" + }, + { + "key": "CCC", + "message": "message3484" + }, + { + "key": "CCC", + "message": "message3485" + }, + { + "key": "CCC", + "message": "message3486" + }, + { + "key": "CCC", + "message": "message3487" + }, + { + "key": "CCC", + "message": "message3488" + }, + { + "key": "CCC", + "message": "message3489" + }, + { + "key": "CCC", + "message": "message3490" + }, + { + "key": "CCC", + "message": "message3491" + }, + { + "key": "CCC", + "message": "message3492" + }, + { + "key": "CCC", + "message": "message3493" + }, + { + "key": "CCC", + "message": "message3494" + }, + { + "key": "CCC", + "message": "message3495" + }, + { + "key": "CCC", + "message": "message3496" + }, + { + "key": "CCC", + "message": "message3497" + }, + { + "key": "CCC", + "message": "message3498" + }, + { + "key": "CCC", + "message": "message3499" + }, + { + "key": "CCC", + "message": "message3500" + }, + { + "key": "CCC", + "message": "message3501" + }, + { + "key": "CCC", + "message": "message3502" + }, + { + "key": "CCC", + "message": "message3503" + }, + { + "key": "CCC", + "message": "message3504" + }, + { + "key": "CCC", + "message": "message3505" + }, + { + "key": "CCC", + "message": "message3506" + }, + { + "key": "CCC", + "message": "message3507" + }, + { + "key": "CCC", + "message": "message3508" + }, + { + "key": "CCC", + "message": "message3509" + }, + { + "key": "CCC", + "message": "message3510" + }, + { + "key": "CCC", + "message": "message3511" + }, + { + "key": "CCC", + "message": "message3512" + }, + { + "key": "CCC", + "message": "message3513" + }, + { + "key": "CCC", + "message": "message3514" + }, + { + "key": "CCC", + "message": "message3515" + }, + { + "key": "CCC", + "message": "message3516" + }, + { + "key": "CCC", + "message": "message3517" + }, + { + "key": "CCC", + "message": "message3518" + }, + { + "key": "CCC", + "message": "message3519" + }, + { + "key": "CCC", + "message": "message3520" + }, + { + "key": "CCC", + "message": "message3521" + }, + { + "key": "CCC", + "message": "message3522" + }, + { + "key": "CCC", + "message": "message3523" + }, + { + "key": "CCC", + "message": "message3524" + }, + { + "key": "CCC", + "message": "message3525" + }, + { + "key": "CCC", + "message": "message3526" + }, + { + "key": "CCC", + "message": "message3527" + }, + { + "key": "CCC", + "message": "message3528" + }, + { + "key": "CCC", + "message": "message3529" + }, + { + "key": "CCC", + "message": "message3530" + }, + { + "key": "CCC", + "message": "message3531" + }, + { + "key": "CCC", + "message": "message3532" + }, + { + "key": "CCC", + "message": "message3533" + }, + { + "key": "CCC", + "message": "message3534" + }, + { + "key": "CCC", + "message": "message3535" + }, + { + "key": "CCC", + "message": "message3536" + }, + { + "key": "CCC", + "message": "message3537" + }, + { + "key": "CCC", + "message": "message3538" + }, + { + "key": "CCC", + "message": "message3539" + }, + { + "key": "CCC", + "message": "message3540" + }, + { + "key": "CCC", + "message": "message3541" + }, + { + "key": "CCC", + "message": "message3542" + }, + { + "key": "CCC", + "message": "message3543" + }, + { + "key": "CCC", + "message": "message3544" + }, + { + "key": "CCC", + "message": "message3545" + }, + { + "key": "CCC", + "message": "message3546" + }, + { + "key": "CCC", + "message": "message3547" + }, + { + "key": "CCC", + "message": "message3548" + }, + { + "key": "CCC", + "message": "message3549" + }, + { + "key": "CCC", + "message": "message3550" + }, + { + "key": "CCC", + "message": "message3551" + }, + { + "key": "CCC", + "message": "message3552" + }, + { + "key": "CCC", + "message": "message3553" + }, + { + "key": "CCC", + "message": "message3554" + }, + { + "key": "CCC", + "message": "message3555" + }, + { + "key": "CCC", + "message": "message3556" + }, + { + "key": "CCC", + "message": "message3557" + }, + { + "key": "CCC", + "message": "message3558" + }, + { + "key": "CCC", + "message": "message3559" + }, + { + "key": "CCC", + "message": "message3560" + }, + { + "key": "CCC", + "message": "message3561" + }, + { + "key": "CCC", + "message": "message3562" + }, + { + "key": "CCC", + "message": "message3563" + }, + { + "key": "CCC", + "message": "message3564" + }, + { + "key": "CCC", + "message": "message3565" + }, + { + "key": "CCC", + "message": "message3566" + }, + { + "key": "CCC", + "message": "message3567" + }, + { + "key": "CCC", + "message": "message3568" + }, + { + "key": "CCC", + "message": "message3569" + }, + { + "key": "CCC", + "message": "message3570" + }, + { + "key": "CCC", + "message": "message3571" + }, + { + "key": "CCC", + "message": "message3572" + }, + { + "key": "CCC", + "message": "message3573" + }, + { + "key": "CCC", + "message": "message3574" + }, + { + "key": "CCC", + "message": "message3575" + }, + { + "key": "CCC", + "message": "message3576" + }, + { + "key": "CCC", + "message": "message3577" + }, + { + "key": "CCC", + "message": "message3578" + }, + { + "key": "CCC", + "message": "message3579" + }, + { + "key": "CCC", + "message": "message3580" + }, + { + "key": "CCC", + "message": "message3581" + }, + { + "key": "CCC", + "message": "message3582" + }, + { + "key": "CCC", + "message": "message3583" + }, + { + "key": "CCC", + "message": "message3584" + }, + { + "key": "CCC", + "message": "message3585" + }, + { + "key": "CCC", + "message": "message3586" + }, + { + "key": "CCC", + "message": "message3587" + }, + { + "key": "CCC", + "message": "message3588" + }, + { + "key": "CCC", + "message": "message3589" + }, + { + "key": "CCC", + "message": "message3590" + }, + { + "key": "CCC", + "message": "message3591" + }, + { + "key": "CCC", + "message": "message3592" + }, + { + "key": "CCC", + "message": "message3593" + }, + { + "key": "CCC", + "message": "message3594" + }, + { + "key": "CCC", + "message": "message3595" + }, + { + "key": "CCC", + "message": "message3596" + }, + { + "key": "CCC", + "message": "message3597" + }, + { + "key": "CCC", + "message": "message3598" + }, + { + "key": "CCC", + "message": "message3599" + }, + { + "key": "CCC", + "message": "message3600" + }, + { + "key": "DDD", + "message": "message3601" + }, + { + "key": "DDD", + "message": "message3602" + }, + { + "key": "DDD", + "message": "message3603" + }, + { + "key": "DDD", + "message": "message3604" + }, + { + "key": "DDD", + "message": "message3605" + }, + { + "key": "DDD", + "message": "message3606" + }, + { + "key": "DDD", + "message": "message3607" + }, + { + "key": "DDD", + "message": "message3608" + }, + { + "key": "DDD", + "message": "message3609" + }, + { + "key": "DDD", + "message": "message3610" + }, + { + "key": "DDD", + "message": "message3611" + }, + { + "key": "DDD", + "message": "message3612" + }, + { + "key": "DDD", + "message": "message3613" + }, + { + "key": "DDD", + "message": "message3614" + }, + { + "key": "DDD", + "message": "message3615" + }, + { + "key": "DDD", + "message": "message3616" + }, + { + "key": "DDD", + "message": "message3617" + }, + { + "key": "DDD", + "message": "message3618" + }, + { + "key": "DDD", + "message": "message3619" + }, + { + "key": "DDD", + "message": "message3620" + }, + { + "key": "DDD", + "message": "message3621" + }, + { + "key": "DDD", + "message": "message3622" + }, + { + "key": "DDD", + "message": "message3623" + }, + { + "key": "DDD", + "message": "message3624" + }, + { + "key": "DDD", + "message": "message3625" + }, + { + "key": "DDD", + "message": "message3626" + }, + { + "key": "DDD", + "message": "message3627" + }, + { + "key": "DDD", + "message": "message3628" + }, + { + "key": "DDD", + "message": "message3629" + }, + { + "key": "DDD", + "message": "message3630" + }, + { + "key": "DDD", + "message": "message3631" + }, + { + "key": "DDD", + "message": "message3632" + }, + { + "key": "DDD", + "message": "message3633" + }, + { + "key": "DDD", + "message": "message3634" + }, + { + "key": "DDD", + "message": "message3635" + }, + { + "key": "DDD", + "message": "message3636" + }, + { + "key": "DDD", + "message": "message3637" + }, + { + "key": "DDD", + "message": "message3638" + }, + { + "key": "DDD", + "message": "message3639" + }, + { + "key": "DDD", + "message": "message3640" + }, + { + "key": "DDD", + "message": "message3641" + }, + { + "key": "DDD", + "message": "message3642" + }, + { + "key": "DDD", + "message": "message3643" + }, + { + "key": "DDD", + "message": "message3644" + }, + { + "key": "DDD", + "message": "message3645" + }, + { + "key": "DDD", + "message": "message3646" + }, + { + "key": "DDD", + "message": "message3647" + }, + { + "key": "DDD", + "message": "message3648" + }, + { + "key": "DDD", + "message": "message3649" + }, + { + "key": "DDD", + "message": "message3650" + }, + { + "key": "DDD", + "message": "message3651" + }, + { + "key": "DDD", + "message": "message3652" + }, + { + "key": "DDD", + "message": "message3653" + }, + { + "key": "DDD", + "message": "message3654" + }, + { + "key": "DDD", + "message": "message3655" + }, + { + "key": "DDD", + "message": "message3656" + }, + { + "key": "DDD", + "message": "message3657" + }, + { + "key": "DDD", + "message": "message3658" + }, + { + "key": "DDD", + "message": "message3659" + }, + { + "key": "DDD", + "message": "message3660" + }, + { + "key": "DDD", + "message": "message3661" + }, + { + "key": "DDD", + "message": "message3662" + }, + { + "key": "DDD", + "message": "message3663" + }, + { + "key": "DDD", + "message": "message3664" + }, + { + "key": "DDD", + "message": "message3665" + }, + { + "key": "DDD", + "message": "message3666" + }, + { + "key": "DDD", + "message": "message3667" + }, + { + "key": "DDD", + "message": "message3668" + }, + { + "key": "DDD", + "message": "message3669" + }, + { + "key": "DDD", + "message": "message3670" + }, + { + "key": "DDD", + "message": "message3671" + }, + { + "key": "DDD", + "message": "message3672" + }, + { + "key": "DDD", + "message": "message3673" + }, + { + "key": "DDD", + "message": "message3674" + }, + { + "key": "DDD", + "message": "message3675" + }, + { + "key": "DDD", + "message": "message3676" + }, + { + "key": "DDD", + "message": "message3677" + }, + { + "key": "DDD", + "message": "message3678" + }, + { + "key": "DDD", + "message": "message3679" + }, + { + "key": "DDD", + "message": "message3680" + }, + { + "key": "DDD", + "message": "message3681" + }, + { + "key": "DDD", + "message": "message3682" + }, + { + "key": "DDD", + "message": "message3683" + }, + { + "key": "DDD", + "message": "message3684" + }, + { + "key": "DDD", + "message": "message3685" + }, + { + "key": "DDD", + "message": "message3686" + }, + { + "key": "DDD", + "message": "message3687" + }, + { + "key": "DDD", + "message": "message3688" + }, + { + "key": "DDD", + "message": "message3689" + }, + { + "key": "DDD", + "message": "message3690" + }, + { + "key": "DDD", + "message": "message3691" + }, + { + "key": "DDD", + "message": "message3692" + }, + { + "key": "DDD", + "message": "message3693" + }, + { + "key": "DDD", + "message": "message3694" + }, + { + "key": "DDD", + "message": "message3695" + }, + { + "key": "DDD", + "message": "message3696" + }, + { + "key": "DDD", + "message": "message3697" + }, + { + "key": "DDD", + "message": "message3698" + }, + { + "key": "DDD", + "message": "message3699" + }, + { + "key": "DDD", + "message": "message3700" + }, + { + "key": "DDD", + "message": "message3701" + }, + { + "key": "DDD", + "message": "message3702" + }, + { + "key": "DDD", + "message": "message3703" + }, + { + "key": "DDD", + "message": "message3704" + }, + { + "key": "DDD", + "message": "message3705" + }, + { + "key": "DDD", + "message": "message3706" + }, + { + "key": "DDD", + "message": "message3707" + }, + { + "key": "DDD", + "message": "message3708" + }, + { + "key": "DDD", + "message": "message3709" + }, + { + "key": "DDD", + "message": "message3710" + }, + { + "key": "DDD", + "message": "message3711" + }, + { + "key": "DDD", + "message": "message3712" + }, + { + "key": "DDD", + "message": "message3713" + }, + { + "key": "DDD", + "message": "message3714" + }, + { + "key": "DDD", + "message": "message3715" + }, + { + "key": "DDD", + "message": "message3716" + }, + { + "key": "DDD", + "message": "message3717" + }, + { + "key": "DDD", + "message": "message3718" + }, + { + "key": "DDD", + "message": "message3719" + }, + { + "key": "DDD", + "message": "message3720" + }, + { + "key": "DDD", + "message": "message3721" + }, + { + "key": "DDD", + "message": "message3722" + }, + { + "key": "DDD", + "message": "message3723" + }, + { + "key": "DDD", + "message": "message3724" + }, + { + "key": "DDD", + "message": "message3725" + }, + { + "key": "DDD", + "message": "message3726" + }, + { + "key": "DDD", + "message": "message3727" + }, + { + "key": "DDD", + "message": "message3728" + }, + { + "key": "DDD", + "message": "message3729" + }, + { + "key": "DDD", + "message": "message3730" + }, + { + "key": "DDD", + "message": "message3731" + }, + { + "key": "DDD", + "message": "message3732" + }, + { + "key": "DDD", + "message": "message3733" + }, + { + "key": "DDD", + "message": "message3734" + }, + { + "key": "DDD", + "message": "message3735" + }, + { + "key": "DDD", + "message": "message3736" + }, + { + "key": "DDD", + "message": "message3737" + }, + { + "key": "DDD", + "message": "message3738" + }, + { + "key": "DDD", + "message": "message3739" + }, + { + "key": "DDD", + "message": "message3740" + }, + { + "key": "DDD", + "message": "message3741" + }, + { + "key": "DDD", + "message": "message3742" + }, + { + "key": "DDD", + "message": "message3743" + }, + { + "key": "DDD", + "message": "message3744" + }, + { + "key": "DDD", + "message": "message3745" + }, + { + "key": "DDD", + "message": "message3746" + }, + { + "key": "DDD", + "message": "message3747" + }, + { + "key": "DDD", + "message": "message3748" + }, + { + "key": "DDD", + "message": "message3749" + }, + { + "key": "DDD", + "message": "message3750" + }, + { + "key": "DDD", + "message": "message3751" + }, + { + "key": "DDD", + "message": "message3752" + }, + { + "key": "DDD", + "message": "message3753" + }, + { + "key": "DDD", + "message": "message3754" + }, + { + "key": "DDD", + "message": "message3755" + }, + { + "key": "DDD", + "message": "message3756" + }, + { + "key": "DDD", + "message": "message3757" + }, + { + "key": "DDD", + "message": "message3758" + }, + { + "key": "DDD", + "message": "message3759" + }, + { + "key": "DDD", + "message": "message3760" + }, + { + "key": "DDD", + "message": "message3761" + }, + { + "key": "DDD", + "message": "message3762" + }, + { + "key": "DDD", + "message": "message3763" + }, + { + "key": "DDD", + "message": "message3764" + }, + { + "key": "DDD", + "message": "message3765" + }, + { + "key": "DDD", + "message": "message3766" + }, + { + "key": "DDD", + "message": "message3767" + }, + { + "key": "DDD", + "message": "message3768" + }, + { + "key": "DDD", + "message": "message3769" + }, + { + "key": "DDD", + "message": "message3770" + }, + { + "key": "DDD", + "message": "message3771" + }, + { + "key": "DDD", + "message": "message3772" + }, + { + "key": "DDD", + "message": "message3773" + }, + { + "key": "DDD", + "message": "message3774" + }, + { + "key": "DDD", + "message": "message3775" + }, + { + "key": "DDD", + "message": "message3776" + }, + { + "key": "DDD", + "message": "message3777" + }, + { + "key": "DDD", + "message": "message3778" + }, + { + "key": "DDD", + "message": "message3779" + }, + { + "key": "DDD", + "message": "message3780" + }, + { + "key": "DDD", + "message": "message3781" + }, + { + "key": "DDD", + "message": "message3782" + }, + { + "key": "DDD", + "message": "message3783" + }, + { + "key": "DDD", + "message": "message3784" + }, + { + "key": "DDD", + "message": "message3785" + }, + { + "key": "DDD", + "message": "message3786" + }, + { + "key": "DDD", + "message": "message3787" + }, + { + "key": "DDD", + "message": "message3788" + }, + { + "key": "DDD", + "message": "message3789" + }, + { + "key": "DDD", + "message": "message3790" + }, + { + "key": "DDD", + "message": "message3791" + }, + { + "key": "DDD", + "message": "message3792" + }, + { + "key": "DDD", + "message": "message3793" + }, + { + "key": "DDD", + "message": "message3794" + }, + { + "key": "DDD", + "message": "message3795" + }, + { + "key": "DDD", + "message": "message3796" + }, + { + "key": "DDD", + "message": "message3797" + }, + { + "key": "DDD", + "message": "message3798" + }, + { + "key": "DDD", + "message": "message3799" + }, + { + "key": "DDD", + "message": "message3800" + }, + { + "key": "DDD", + "message": "message3801" + }, + { + "key": "DDD", + "message": "message3802" + }, + { + "key": "DDD", + "message": "message3803" + }, + { + "key": "DDD", + "message": "message3804" + }, + { + "key": "DDD", + "message": "message3805" + }, + { + "key": "DDD", + "message": "message3806" + }, + { + "key": "DDD", + "message": "message3807" + }, + { + "key": "DDD", + "message": "message3808" + }, + { + "key": "DDD", + "message": "message3809" + }, + { + "key": "DDD", + "message": "message3810" + }, + { + "key": "DDD", + "message": "message3811" + }, + { + "key": "DDD", + "message": "message3812" + }, + { + "key": "DDD", + "message": "message3813" + }, + { + "key": "DDD", + "message": "message3814" + }, + { + "key": "DDD", + "message": "message3815" + }, + { + "key": "DDD", + "message": "message3816" + }, + { + "key": "DDD", + "message": "message3817" + }, + { + "key": "DDD", + "message": "message3818" + }, + { + "key": "DDD", + "message": "message3819" + }, + { + "key": "DDD", + "message": "message3820" + }, + { + "key": "DDD", + "message": "message3821" + }, + { + "key": "DDD", + "message": "message3822" + }, + { + "key": "DDD", + "message": "message3823" + }, + { + "key": "DDD", + "message": "message3824" + }, + { + "key": "DDD", + "message": "message3825" + }, + { + "key": "DDD", + "message": "message3826" + }, + { + "key": "DDD", + "message": "message3827" + }, + { + "key": "DDD", + "message": "message3828" + }, + { + "key": "DDD", + "message": "message3829" + }, + { + "key": "DDD", + "message": "message3830" + }, + { + "key": "DDD", + "message": "message3831" + }, + { + "key": "DDD", + "message": "message3832" + }, + { + "key": "DDD", + "message": "message3833" + }, + { + "key": "DDD", + "message": "message3834" + }, + { + "key": "DDD", + "message": "message3835" + }, + { + "key": "DDD", + "message": "message3836" + }, + { + "key": "DDD", + "message": "message3837" + }, + { + "key": "DDD", + "message": "message3838" + }, + { + "key": "DDD", + "message": "message3839" + }, + { + "key": "DDD", + "message": "message3840" + }, + { + "key": "DDD", + "message": "message3841" + }, + { + "key": "DDD", + "message": "message3842" + }, + { + "key": "DDD", + "message": "message3843" + }, + { + "key": "DDD", + "message": "message3844" + }, + { + "key": "DDD", + "message": "message3845" + }, + { + "key": "DDD", + "message": "message3846" + }, + { + "key": "DDD", + "message": "message3847" + }, + { + "key": "DDD", + "message": "message3848" + }, + { + "key": "DDD", + "message": "message3849" + }, + { + "key": "DDD", + "message": "message3850" + }, + { + "key": "DDD", + "message": "message3851" + }, + { + "key": "DDD", + "message": "message3852" + }, + { + "key": "DDD", + "message": "message3853" + }, + { + "key": "DDD", + "message": "message3854" + }, + { + "key": "DDD", + "message": "message3855" + }, + { + "key": "DDD", + "message": "message3856" + }, + { + "key": "DDD", + "message": "message3857" + }, + { + "key": "DDD", + "message": "message3858" + }, + { + "key": "DDD", + "message": "message3859" + }, + { + "key": "DDD", + "message": "message3860" + }, + { + "key": "DDD", + "message": "message3861" + }, + { + "key": "DDD", + "message": "message3862" + }, + { + "key": "DDD", + "message": "message3863" + }, + { + "key": "DDD", + "message": "message3864" + }, + { + "key": "DDD", + "message": "message3865" + }, + { + "key": "DDD", + "message": "message3866" + }, + { + "key": "DDD", + "message": "message3867" + }, + { + "key": "DDD", + "message": "message3868" + }, + { + "key": "DDD", + "message": "message3869" + }, + { + "key": "DDD", + "message": "message3870" + }, + { + "key": "DDD", + "message": "message3871" + }, + { + "key": "DDD", + "message": "message3872" + }, + { + "key": "DDD", + "message": "message3873" + }, + { + "key": "DDD", + "message": "message3874" + }, + { + "key": "DDD", + "message": "message3875" + }, + { + "key": "DDD", + "message": "message3876" + }, + { + "key": "DDD", + "message": "message3877" + }, + { + "key": "DDD", + "message": "message3878" + }, + { + "key": "DDD", + "message": "message3879" + }, + { + "key": "DDD", + "message": "message3880" + }, + { + "key": "DDD", + "message": "message3881" + }, + { + "key": "DDD", + "message": "message3882" + }, + { + "key": "DDD", + "message": "message3883" + }, + { + "key": "DDD", + "message": "message3884" + }, + { + "key": "DDD", + "message": "message3885" + }, + { + "key": "DDD", + "message": "message3886" + }, + { + "key": "DDD", + "message": "message3887" + }, + { + "key": "DDD", + "message": "message3888" + }, + { + "key": "DDD", + "message": "message3889" + }, + { + "key": "DDD", + "message": "message3890" + }, + { + "key": "DDD", + "message": "message3891" + }, + { + "key": "DDD", + "message": "message3892" + }, + { + "key": "DDD", + "message": "message3893" + }, + { + "key": "DDD", + "message": "message3894" + }, + { + "key": "DDD", + "message": "message3895" + }, + { + "key": "DDD", + "message": "message3896" + }, + { + "key": "DDD", + "message": "message3897" + }, + { + "key": "DDD", + "message": "message3898" + }, + { + "key": "DDD", + "message": "message3899" + }, + { + "key": "DDD", + "message": "message3900" + }, + { + "key": "DDD", + "message": "message3901" + }, + { + "key": "DDD", + "message": "message3902" + }, + { + "key": "DDD", + "message": "message3903" + }, + { + "key": "DDD", + "message": "message3904" + }, + { + "key": "DDD", + "message": "message3905" + }, + { + "key": "DDD", + "message": "message3906" + }, + { + "key": "DDD", + "message": "message3907" + }, + { + "key": "DDD", + "message": "message3908" + }, + { + "key": "DDD", + "message": "message3909" + }, + { + "key": "DDD", + "message": "message3910" + }, + { + "key": "DDD", + "message": "message3911" + }, + { + "key": "DDD", + "message": "message3912" + }, + { + "key": "DDD", + "message": "message3913" + }, + { + "key": "DDD", + "message": "message3914" + }, + { + "key": "DDD", + "message": "message3915" + }, + { + "key": "DDD", + "message": "message3916" + }, + { + "key": "DDD", + "message": "message3917" + }, + { + "key": "DDD", + "message": "message3918" + }, + { + "key": "DDD", + "message": "message3919" + }, + { + "key": "DDD", + "message": "message3920" + }, + { + "key": "DDD", + "message": "message3921" + }, + { + "key": "DDD", + "message": "message3922" + }, + { + "key": "DDD", + "message": "message3923" + }, + { + "key": "DDD", + "message": "message3924" + }, + { + "key": "DDD", + "message": "message3925" + }, + { + "key": "DDD", + "message": "message3926" + }, + { + "key": "DDD", + "message": "message3927" + }, + { + "key": "DDD", + "message": "message3928" + }, + { + "key": "DDD", + "message": "message3929" + }, + { + "key": "DDD", + "message": "message3930" + }, + { + "key": "DDD", + "message": "message3931" + }, + { + "key": "DDD", + "message": "message3932" + }, + { + "key": "DDD", + "message": "message3933" + }, + { + "key": "DDD", + "message": "message3934" + }, + { + "key": "DDD", + "message": "message3935" + }, + { + "key": "DDD", + "message": "message3936" + }, + { + "key": "DDD", + "message": "message3937" + }, + { + "key": "DDD", + "message": "message3938" + }, + { + "key": "DDD", + "message": "message3939" + }, + { + "key": "DDD", + "message": "message3940" + }, + { + "key": "DDD", + "message": "message3941" + }, + { + "key": "DDD", + "message": "message3942" + }, + { + "key": "DDD", + "message": "message3943" + }, + { + "key": "DDD", + "message": "message3944" + }, + { + "key": "DDD", + "message": "message3945" + }, + { + "key": "DDD", + "message": "message3946" + }, + { + "key": "DDD", + "message": "message3947" + }, + { + "key": "DDD", + "message": "message3948" + }, + { + "key": "DDD", + "message": "message3949" + }, + { + "key": "DDD", + "message": "message3950" + }, + { + "key": "DDD", + "message": "message3951" + }, + { + "key": "DDD", + "message": "message3952" + }, + { + "key": "DDD", + "message": "message3953" + }, + { + "key": "DDD", + "message": "message3954" + }, + { + "key": "DDD", + "message": "message3955" + }, + { + "key": "DDD", + "message": "message3956" + }, + { + "key": "DDD", + "message": "message3957" + }, + { + "key": "DDD", + "message": "message3958" + }, + { + "key": "DDD", + "message": "message3959" + }, + { + "key": "DDD", + "message": "message3960" + }, + { + "key": "DDD", + "message": "message3961" + }, + { + "key": "DDD", + "message": "message3962" + }, + { + "key": "DDD", + "message": "message3963" + }, + { + "key": "DDD", + "message": "message3964" + }, + { + "key": "DDD", + "message": "message3965" + }, + { + "key": "DDD", + "message": "message3966" + }, + { + "key": "DDD", + "message": "message3967" + }, + { + "key": "DDD", + "message": "message3968" + }, + { + "key": "DDD", + "message": "message3969" + }, + { + "key": "DDD", + "message": "message3970" + }, + { + "key": "DDD", + "message": "message3971" + }, + { + "key": "DDD", + "message": "message3972" + }, + { + "key": "DDD", + "message": "message3973" + }, + { + "key": "DDD", + "message": "message3974" + }, + { + "key": "DDD", + "message": "message3975" + }, + { + "key": "DDD", + "message": "message3976" + }, + { + "key": "DDD", + "message": "message3977" + }, + { + "key": "DDD", + "message": "message3978" + }, + { + "key": "DDD", + "message": "message3979" + }, + { + "key": "DDD", + "message": "message3980" + }, + { + "key": "DDD", + "message": "message3981" + }, + { + "key": "DDD", + "message": "message3982" + }, + { + "key": "DDD", + "message": "message3983" + }, + { + "key": "DDD", + "message": "message3984" + }, + { + "key": "DDD", + "message": "message3985" + }, + { + "key": "DDD", + "message": "message3986" + }, + { + "key": "DDD", + "message": "message3987" + }, + { + "key": "DDD", + "message": "message3988" + }, + { + "key": "DDD", + "message": "message3989" + }, + { + "key": "DDD", + "message": "message3990" + }, + { + "key": "DDD", + "message": "message3991" + }, + { + "key": "DDD", + "message": "message3992" + }, + { + "key": "DDD", + "message": "message3993" + }, + { + "key": "DDD", + "message": "message3994" + }, + { + "key": "DDD", + "message": "message3995" + }, + { + "key": "DDD", + "message": "message3996" + }, + { + "key": "DDD", + "message": "message3997" + }, + { + "key": "DDD", + "message": "message3998" + }, + { + "key": "DDD", + "message": "message3999" + }, + { + "key": "DDD", + "message": "message4000" + }, + { + "key": "CCC", + "message": "message4001" + }, + { + "key": "", + "message": "message4002" + }, + { + "key": "AAA", + "message": "message4003" + }, + { + "key": "CCC", + "message": "message4004" + }, + { + "key": "AAA", + "message": "message4005" + }, + { + "key": "CCC", + "message": "message4006" + }, + { + "key": "BBB", + "message": "message4007" + }, + { + "key": "AAA", + "message": "message4008" + }, + { + "key": "BBB", + "message": "message4009" + }, + { + "key": "BBB", + "message": "message4010" + }, + { + "key": "BBB", + "message": "message4011" + }, + { + "key": "BBB", + "message": "message4012" + }, + { + "key": "BBB", + "message": "message4013" + }, + { + "key": "DDD", + "message": "message4014" + }, + { + "key": "DDD", + "message": "message4015" + }, + { + "key": "DDD", + "message": "message4016" + }, + { + "key": "CCC", + "message": "message4017" + }, + { + "key": "CCC", + "message": "message4018" + }, + { + "key": "CCC", + "message": "message4019" + }, + { + "key": "", + "message": "message4020" + }, + { + "key": "CCC", + "message": "message4021" + }, + { + "key": "DDD", + "message": "message4022" + }, + { + "key": "AAA", + "message": "message4023" + }, + { + "key": "DDD", + "message": "message4024" + }, + { + "key": "", + "message": "message4025" + }, + { + "key": "", + "message": "message4026" + }, + { + "key": "DDD", + "message": "message4027" + }, + { + "key": "DDD", + "message": "message4028" + }, + { + "key": "CCC", + "message": "message4029" + }, + { + "key": "CCC", + "message": "message4030" + }, + { + "key": "DDD", + "message": "message4031" + }, + { + "key": "CCC", + "message": "message4032" + }, + { + "key": "", + "message": "message4033" + }, + { + "key": "CCC", + "message": "message4034" + }, + { + "key": "DDD", + "message": "message4035" + }, + { + "key": "", + "message": "message4036" + }, + { + "key": "", + "message": "message4037" + }, + { + "key": "CCC", + "message": "message4038" + }, + { + "key": "AAA", + "message": "message4039" + }, + { + "key": "", + "message": "message4040" + }, + { + "key": "DDD", + "message": "message4041" + }, + { + "key": "BBB", + "message": "message4042" + }, + { + "key": "DDD", + "message": "message4043" + }, + { + "key": "AAA", + "message": "message4044" + }, + { + "key": "DDD", + "message": "message4045" + }, + { + "key": "CCC", + "message": "message4046" + }, + { + "key": "", + "message": "message4047" + }, + { + "key": "CCC", + "message": "message4048" + }, + { + "key": "CCC", + "message": "message4049" + }, + { + "key": "DDD", + "message": "message4050" + }, + { + "key": "AAA", + "message": "message4051" + }, + { + "key": "DDD", + "message": "message4052" + }, + { + "key": "", + "message": "message4053" + }, + { + "key": "DDD", + "message": "message4054" + }, + { + "key": "AAA", + "message": "message4055" + }, + { + "key": "CCC", + "message": "message4056" + }, + { + "key": "BBB", + "message": "message4057" + }, + { + "key": "DDD", + "message": "message4058" + }, + { + "key": "", + "message": "message4059" + }, + { + "key": "CCC", + "message": "message4060" + }, + { + "key": "AAA", + "message": "message4061" + }, + { + "key": "", + "message": "message4062" + }, + { + "key": "", + "message": "message4063" + }, + { + "key": "DDD", + "message": "message4064" + }, + { + "key": "CCC", + "message": "message4065" + }, + { + "key": "DDD", + "message": "message4066" + }, + { + "key": "AAA", + "message": "message4067" + }, + { + "key": "", + "message": "message4068" + }, + { + "key": "AAA", + "message": "message4069" + }, + { + "key": "AAA", + "message": "message4070" + }, + { + "key": "CCC", + "message": "message4071" + }, + { + "key": "CCC", + "message": "message4072" + }, + { + "key": "CCC", + "message": "message4073" + }, + { + "key": "DDD", + "message": "message4074" + }, + { + "key": "CCC", + "message": "message4075" + }, + { + "key": "CCC", + "message": "message4076" + }, + { + "key": "AAA", + "message": "message4077" + }, + { + "key": "", + "message": "message4078" + }, + { + "key": "", + "message": "message4079" + }, + { + "key": "CCC", + "message": "message4080" + }, + { + "key": "BBB", + "message": "message4081" + }, + { + "key": "CCC", + "message": "message4082" + }, + { + "key": "", + "message": "message4083" + }, + { + "key": "CCC", + "message": "message4084" + }, + { + "key": "", + "message": "message4085" + }, + { + "key": "", + "message": "message4086" + }, + { + "key": "DDD", + "message": "message4087" + }, + { + "key": "DDD", + "message": "message4088" + }, + { + "key": "", + "message": "message4089" + }, + { + "key": "DDD", + "message": "message4090" + }, + { + "key": "AAA", + "message": "message4091" + }, + { + "key": "CCC", + "message": "message4092" + }, + { + "key": "DDD", + "message": "message4093" + }, + { + "key": "", + "message": "message4094" + }, + { + "key": "", + "message": "message4095" + }, + { + "key": "CCC", + "message": "message4096" + }, + { + "key": "CCC", + "message": "message4097" + }, + { + "key": "", + "message": "message4098" + }, + { + "key": "AAA", + "message": "message4099" + }, + { + "key": "AAA", + "message": "message4100" + }, + { + "key": "AAA", + "message": "message4101" + }, + { + "key": "", + "message": "message4102" + }, + { + "key": "AAA", + "message": "message4103" + }, + { + "key": "BBB", + "message": "message4104" + }, + { + "key": "CCC", + "message": "message4105" + }, + { + "key": "", + "message": "message4106" + }, + { + "key": "CCC", + "message": "message4107" + }, + { + "key": "", + "message": "message4108" + }, + { + "key": "BBB", + "message": "message4109" + }, + { + "key": "BBB", + "message": "message4110" + }, + { + "key": "CCC", + "message": "message4111" + }, + { + "key": "CCC", + "message": "message4112" + }, + { + "key": "", + "message": "message4113" + }, + { + "key": "", + "message": "message4114" + }, + { + "key": "BBB", + "message": "message4115" + }, + { + "key": "AAA", + "message": "message4116" + }, + { + "key": "BBB", + "message": "message4117" + }, + { + "key": "BBB", + "message": "message4118" + }, + { + "key": "BBB", + "message": "message4119" + }, + { + "key": "CCC", + "message": "message4120" + }, + { + "key": "CCC", + "message": "message4121" + }, + { + "key": "BBB", + "message": "message4122" + }, + { + "key": "CCC", + "message": "message4123" + }, + { + "key": "AAA", + "message": "message4124" + }, + { + "key": "AAA", + "message": "message4125" + }, + { + "key": "DDD", + "message": "message4126" + }, + { + "key": "DDD", + "message": "message4127" + }, + { + "key": "CCC", + "message": "message4128" + }, + { + "key": "DDD", + "message": "message4129" + }, + { + "key": "", + "message": "message4130" + }, + { + "key": "", + "message": "message4131" + }, + { + "key": "AAA", + "message": "message4132" + }, + { + "key": "DDD", + "message": "message4133" + }, + { + "key": "CCC", + "message": "message4134" + }, + { + "key": "DDD", + "message": "message4135" + }, + { + "key": "BBB", + "message": "message4136" + }, + { + "key": "BBB", + "message": "message4137" + }, + { + "key": "", + "message": "message4138" + }, + { + "key": "DDD", + "message": "message4139" + }, + { + "key": "", + "message": "message4140" + }, + { + "key": "CCC", + "message": "message4141" + }, + { + "key": "AAA", + "message": "message4142" + }, + { + "key": "CCC", + "message": "message4143" + }, + { + "key": "BBB", + "message": "message4144" + }, + { + "key": "DDD", + "message": "message4145" + }, + { + "key": "", + "message": "message4146" + }, + { + "key": "", + "message": "message4147" + }, + { + "key": "DDD", + "message": "message4148" + }, + { + "key": "CCC", + "message": "message4149" + }, + { + "key": "CCC", + "message": "message4150" + }, + { + "key": "BBB", + "message": "message4151" + }, + { + "key": "BBB", + "message": "message4152" + }, + { + "key": "BBB", + "message": "message4153" + }, + { + "key": "BBB", + "message": "message4154" + }, + { + "key": "AAA", + "message": "message4155" + }, + { + "key": "CCC", + "message": "message4156" + }, + { + "key": "", + "message": "message4157" + }, + { + "key": "", + "message": "message4158" + }, + { + "key": "AAA", + "message": "message4159" + }, + { + "key": "AAA", + "message": "message4160" + }, + { + "key": "CCC", + "message": "message4161" + }, + { + "key": "AAA", + "message": "message4162" + }, + { + "key": "AAA", + "message": "message4163" + }, + { + "key": "AAA", + "message": "message4164" + }, + { + "key": "DDD", + "message": "message4165" + }, + { + "key": "AAA", + "message": "message4166" + }, + { + "key": "DDD", + "message": "message4167" + }, + { + "key": "DDD", + "message": "message4168" + }, + { + "key": "AAA", + "message": "message4169" + }, + { + "key": "BBB", + "message": "message4170" + }, + { + "key": "BBB", + "message": "message4171" + }, + { + "key": "BBB", + "message": "message4172" + }, + { + "key": "BBB", + "message": "message4173" + }, + { + "key": "CCC", + "message": "message4174" + }, + { + "key": "AAA", + "message": "message4175" + }, + { + "key": "", + "message": "message4176" + }, + { + "key": "AAA", + "message": "message4177" + }, + { + "key": "AAA", + "message": "message4178" + }, + { + "key": "DDD", + "message": "message4179" + }, + { + "key": "CCC", + "message": "message4180" + }, + { + "key": "", + "message": "message4181" + }, + { + "key": "CCC", + "message": "message4182" + }, + { + "key": "BBB", + "message": "message4183" + }, + { + "key": "BBB", + "message": "message4184" + }, + { + "key": "DDD", + "message": "message4185" + }, + { + "key": "AAA", + "message": "message4186" + }, + { + "key": "AAA", + "message": "message4187" + }, + { + "key": "CCC", + "message": "message4188" + }, + { + "key": "DDD", + "message": "message4189" + }, + { + "key": "BBB", + "message": "message4190" + }, + { + "key": "DDD", + "message": "message4191" + }, + { + "key": "", + "message": "message4192" + }, + { + "key": "BBB", + "message": "message4193" + }, + { + "key": "DDD", + "message": "message4194" + }, + { + "key": "BBB", + "message": "message4195" + }, + { + "key": "CCC", + "message": "message4196" + }, + { + "key": "", + "message": "message4197" + }, + { + "key": "DDD", + "message": "message4198" + }, + { + "key": "", + "message": "message4199" + }, + { + "key": "CCC", + "message": "message4200" + }, + { + "key": "BBB", + "message": "message4201" + }, + { + "key": "", + "message": "message4202" + }, + { + "key": "DDD", + "message": "message4203" + }, + { + "key": "BBB", + "message": "message4204" + }, + { + "key": "AAA", + "message": "message4205" + }, + { + "key": "DDD", + "message": "message4206" + }, + { + "key": "BBB", + "message": "message4207" + }, + { + "key": "AAA", + "message": "message4208" + }, + { + "key": "BBB", + "message": "message4209" + }, + { + "key": "BBB", + "message": "message4210" + }, + { + "key": "", + "message": "message4211" + }, + { + "key": "", + "message": "message4212" + }, + { + "key": "CCC", + "message": "message4213" + }, + { + "key": "BBB", + "message": "message4214" + }, + { + "key": "AAA", + "message": "message4215" + }, + { + "key": "AAA", + "message": "message4216" + }, + { + "key": "", + "message": "message4217" + }, + { + "key": "", + "message": "message4218" + }, + { + "key": "DDD", + "message": "message4219" + }, + { + "key": "", + "message": "message4220" + }, + { + "key": "AAA", + "message": "message4221" + }, + { + "key": "CCC", + "message": "message4222" + }, + { + "key": "", + "message": "message4223" + }, + { + "key": "CCC", + "message": "message4224" + }, + { + "key": "BBB", + "message": "message4225" + }, + { + "key": "DDD", + "message": "message4226" + }, + { + "key": "AAA", + "message": "message4227" + }, + { + "key": "CCC", + "message": "message4228" + }, + { + "key": "DDD", + "message": "message4229" + }, + { + "key": "BBB", + "message": "message4230" + }, + { + "key": "AAA", + "message": "message4231" + }, + { + "key": "BBB", + "message": "message4232" + }, + { + "key": "CCC", + "message": "message4233" + }, + { + "key": "DDD", + "message": "message4234" + }, + { + "key": "BBB", + "message": "message4235" + }, + { + "key": "CCC", + "message": "message4236" + }, + { + "key": "CCC", + "message": "message4237" + }, + { + "key": "CCC", + "message": "message4238" + }, + { + "key": "", + "message": "message4239" + }, + { + "key": "BBB", + "message": "message4240" + }, + { + "key": "", + "message": "message4241" + }, + { + "key": "CCC", + "message": "message4242" + }, + { + "key": "DDD", + "message": "message4243" + }, + { + "key": "CCC", + "message": "message4244" + }, + { + "key": "AAA", + "message": "message4245" + }, + { + "key": "DDD", + "message": "message4246" + }, + { + "key": "BBB", + "message": "message4247" + }, + { + "key": "BBB", + "message": "message4248" + }, + { + "key": "", + "message": "message4249" + }, + { + "key": "BBB", + "message": "message4250" + }, + { + "key": "DDD", + "message": "message4251" + }, + { + "key": "", + "message": "message4252" + }, + { + "key": "DDD", + "message": "message4253" + }, + { + "key": "AAA", + "message": "message4254" + }, + { + "key": "DDD", + "message": "message4255" + }, + { + "key": "BBB", + "message": "message4256" + }, + { + "key": "", + "message": "message4257" + }, + { + "key": "CCC", + "message": "message4258" + }, + { + "key": "", + "message": "message4259" + }, + { + "key": "AAA", + "message": "message4260" + }, + { + "key": "BBB", + "message": "message4261" + }, + { + "key": "CCC", + "message": "message4262" + }, + { + "key": "", + "message": "message4263" + }, + { + "key": "BBB", + "message": "message4264" + }, + { + "key": "BBB", + "message": "message4265" + }, + { + "key": "", + "message": "message4266" + }, + { + "key": "", + "message": "message4267" + }, + { + "key": "", + "message": "message4268" + }, + { + "key": "AAA", + "message": "message4269" + }, + { + "key": "AAA", + "message": "message4270" + }, + { + "key": "DDD", + "message": "message4271" + }, + { + "key": "DDD", + "message": "message4272" + }, + { + "key": "BBB", + "message": "message4273" + }, + { + "key": "DDD", + "message": "message4274" + }, + { + "key": "DDD", + "message": "message4275" + }, + { + "key": "BBB", + "message": "message4276" + }, + { + "key": "", + "message": "message4277" + }, + { + "key": "DDD", + "message": "message4278" + }, + { + "key": "BBB", + "message": "message4279" + }, + { + "key": "BBB", + "message": "message4280" + }, + { + "key": "", + "message": "message4281" + }, + { + "key": "CCC", + "message": "message4282" + }, + { + "key": "CCC", + "message": "message4283" + }, + { + "key": "DDD", + "message": "message4284" + }, + { + "key": "CCC", + "message": "message4285" + }, + { + "key": "AAA", + "message": "message4286" + }, + { + "key": "DDD", + "message": "message4287" + }, + { + "key": "BBB", + "message": "message4288" + }, + { + "key": "DDD", + "message": "message4289" + }, + { + "key": "CCC", + "message": "message4290" + }, + { + "key": "", + "message": "message4291" + }, + { + "key": "AAA", + "message": "message4292" + }, + { + "key": "AAA", + "message": "message4293" + }, + { + "key": "", + "message": "message4294" + }, + { + "key": "", + "message": "message4295" + }, + { + "key": "DDD", + "message": "message4296" + }, + { + "key": "CCC", + "message": "message4297" + }, + { + "key": "AAA", + "message": "message4298" + }, + { + "key": "", + "message": "message4299" + }, + { + "key": "", + "message": "message4300" + }, + { + "key": "DDD", + "message": "message4301" + }, + { + "key": "CCC", + "message": "message4302" + }, + { + "key": "CCC", + "message": "message4303" + }, + { + "key": "AAA", + "message": "message4304" + }, + { + "key": "CCC", + "message": "message4305" + }, + { + "key": "CCC", + "message": "message4306" + }, + { + "key": "CCC", + "message": "message4307" + }, + { + "key": "AAA", + "message": "message4308" + }, + { + "key": "BBB", + "message": "message4309" + }, + { + "key": "DDD", + "message": "message4310" + }, + { + "key": "AAA", + "message": "message4311" + }, + { + "key": "AAA", + "message": "message4312" + }, + { + "key": "AAA", + "message": "message4313" + }, + { + "key": "", + "message": "message4314" + }, + { + "key": "AAA", + "message": "message4315" + }, + { + "key": "AAA", + "message": "message4316" + }, + { + "key": "DDD", + "message": "message4317" + }, + { + "key": "AAA", + "message": "message4318" + }, + { + "key": "CCC", + "message": "message4319" + }, + { + "key": "", + "message": "message4320" + }, + { + "key": "", + "message": "message4321" + }, + { + "key": "", + "message": "message4322" + }, + { + "key": "BBB", + "message": "message4323" + }, + { + "key": "CCC", + "message": "message4324" + }, + { + "key": "AAA", + "message": "message4325" + }, + { + "key": "AAA", + "message": "message4326" + }, + { + "key": "", + "message": "message4327" + }, + { + "key": "CCC", + "message": "message4328" + }, + { + "key": "DDD", + "message": "message4329" + }, + { + "key": "DDD", + "message": "message4330" + }, + { + "key": "BBB", + "message": "message4331" + }, + { + "key": "CCC", + "message": "message4332" + }, + { + "key": "", + "message": "message4333" + }, + { + "key": "", + "message": "message4334" + }, + { + "key": "", + "message": "message4335" + }, + { + "key": "CCC", + "message": "message4336" + }, + { + "key": "", + "message": "message4337" + }, + { + "key": "DDD", + "message": "message4338" + }, + { + "key": "BBB", + "message": "message4339" + }, + { + "key": "CCC", + "message": "message4340" + }, + { + "key": "BBB", + "message": "message4341" + }, + { + "key": "CCC", + "message": "message4342" + }, + { + "key": "CCC", + "message": "message4343" + }, + { + "key": "BBB", + "message": "message4344" + }, + { + "key": "CCC", + "message": "message4345" + }, + { + "key": "DDD", + "message": "message4346" + }, + { + "key": "AAA", + "message": "message4347" + }, + { + "key": "DDD", + "message": "message4348" + }, + { + "key": "", + "message": "message4349" + }, + { + "key": "DDD", + "message": "message4350" + }, + { + "key": "DDD", + "message": "message4351" + }, + { + "key": "AAA", + "message": "message4352" + }, + { + "key": "AAA", + "message": "message4353" + }, + { + "key": "BBB", + "message": "message4354" + }, + { + "key": "BBB", + "message": "message4355" + }, + { + "key": "AAA", + "message": "message4356" + }, + { + "key": "CCC", + "message": "message4357" + }, + { + "key": "BBB", + "message": "message4358" + }, + { + "key": "BBB", + "message": "message4359" + }, + { + "key": "BBB", + "message": "message4360" + }, + { + "key": "", + "message": "message4361" + }, + { + "key": "DDD", + "message": "message4362" + }, + { + "key": "", + "message": "message4363" + }, + { + "key": "DDD", + "message": "message4364" + }, + { + "key": "", + "message": "message4365" + }, + { + "key": "AAA", + "message": "message4366" + }, + { + "key": "AAA", + "message": "message4367" + }, + { + "key": "DDD", + "message": "message4368" + }, + { + "key": "AAA", + "message": "message4369" + }, + { + "key": "CCC", + "message": "message4370" + }, + { + "key": "BBB", + "message": "message4371" + }, + { + "key": "AAA", + "message": "message4372" + }, + { + "key": "BBB", + "message": "message4373" + }, + { + "key": "BBB", + "message": "message4374" + }, + { + "key": "CCC", + "message": "message4375" + }, + { + "key": "AAA", + "message": "message4376" + }, + { + "key": "AAA", + "message": "message4377" + }, + { + "key": "DDD", + "message": "message4378" + }, + { + "key": "AAA", + "message": "message4379" + }, + { + "key": "BBB", + "message": "message4380" + }, + { + "key": "DDD", + "message": "message4381" + }, + { + "key": "CCC", + "message": "message4382" + }, + { + "key": "CCC", + "message": "message4383" + }, + { + "key": "DDD", + "message": "message4384" + }, + { + "key": "CCC", + "message": "message4385" + }, + { + "key": "DDD", + "message": "message4386" + }, + { + "key": "BBB", + "message": "message4387" + }, + { + "key": "BBB", + "message": "message4388" + }, + { + "key": "", + "message": "message4389" + }, + { + "key": "", + "message": "message4390" + }, + { + "key": "AAA", + "message": "message4391" + }, + { + "key": "BBB", + "message": "message4392" + }, + { + "key": "BBB", + "message": "message4393" + }, + { + "key": "AAA", + "message": "message4394" + }, + { + "key": "CCC", + "message": "message4395" + }, + { + "key": "CCC", + "message": "message4396" + }, + { + "key": "", + "message": "message4397" + }, + { + "key": "DDD", + "message": "message4398" + }, + { + "key": "AAA", + "message": "message4399" + }, + { + "key": "BBB", + "message": "message4400" + }, + { + "key": "BBB", + "message": "message4401" + }, + { + "key": "BBB", + "message": "message4402" + }, + { + "key": "", + "message": "message4403" + }, + { + "key": "BBB", + "message": "message4404" + }, + { + "key": "DDD", + "message": "message4405" + }, + { + "key": "CCC", + "message": "message4406" + }, + { + "key": "DDD", + "message": "message4407" + }, + { + "key": "AAA", + "message": "message4408" + }, + { + "key": "CCC", + "message": "message4409" + }, + { + "key": "CCC", + "message": "message4410" + }, + { + "key": "DDD", + "message": "message4411" + }, + { + "key": "", + "message": "message4412" + }, + { + "key": "DDD", + "message": "message4413" + }, + { + "key": "BBB", + "message": "message4414" + }, + { + "key": "CCC", + "message": "message4415" + }, + { + "key": "", + "message": "message4416" + }, + { + "key": "BBB", + "message": "message4417" + }, + { + "key": "CCC", + "message": "message4418" + }, + { + "key": "AAA", + "message": "message4419" + }, + { + "key": "AAA", + "message": "message4420" + }, + { + "key": "CCC", + "message": "message4421" + }, + { + "key": "CCC", + "message": "message4422" + }, + { + "key": "DDD", + "message": "message4423" + }, + { + "key": "DDD", + "message": "message4424" + }, + { + "key": "AAA", + "message": "message4425" + }, + { + "key": "BBB", + "message": "message4426" + }, + { + "key": "DDD", + "message": "message4427" + }, + { + "key": "", + "message": "message4428" + }, + { + "key": "DDD", + "message": "message4429" + }, + { + "key": "", + "message": "message4430" + }, + { + "key": "DDD", + "message": "message4431" + }, + { + "key": "BBB", + "message": "message4432" + }, + { + "key": "BBB", + "message": "message4433" + }, + { + "key": "BBB", + "message": "message4434" + }, + { + "key": "BBB", + "message": "message4435" + }, + { + "key": "CCC", + "message": "message4436" + }, + { + "key": "CCC", + "message": "message4437" + }, + { + "key": "", + "message": "message4438" + }, + { + "key": "AAA", + "message": "message4439" + }, + { + "key": "", + "message": "message4440" + }, + { + "key": "BBB", + "message": "message4441" + }, + { + "key": "AAA", + "message": "message4442" + }, + { + "key": "AAA", + "message": "message4443" + }, + { + "key": "BBB", + "message": "message4444" + }, + { + "key": "DDD", + "message": "message4445" + }, + { + "key": "", + "message": "message4446" + }, + { + "key": "AAA", + "message": "message4447" + }, + { + "key": "AAA", + "message": "message4448" + }, + { + "key": "", + "message": "message4449" + }, + { + "key": "BBB", + "message": "message4450" + }, + { + "key": "BBB", + "message": "message4451" + }, + { + "key": "CCC", + "message": "message4452" + }, + { + "key": "CCC", + "message": "message4453" + }, + { + "key": "CCC", + "message": "message4454" + }, + { + "key": "", + "message": "message4455" + }, + { + "key": "", + "message": "message4456" + }, + { + "key": "CCC", + "message": "message4457" + }, + { + "key": "CCC", + "message": "message4458" + }, + { + "key": "BBB", + "message": "message4459" + }, + { + "key": "AAA", + "message": "message4460" + }, + { + "key": "AAA", + "message": "message4461" + }, + { + "key": "AAA", + "message": "message4462" + }, + { + "key": "BBB", + "message": "message4463" + }, + { + "key": "BBB", + "message": "message4464" + }, + { + "key": "", + "message": "message4465" + }, + { + "key": "AAA", + "message": "message4466" + }, + { + "key": "AAA", + "message": "message4467" + }, + { + "key": "AAA", + "message": "message4468" + }, + { + "key": "CCC", + "message": "message4469" + }, + { + "key": "", + "message": "message4470" + }, + { + "key": "DDD", + "message": "message4471" + }, + { + "key": "AAA", + "message": "message4472" + }, + { + "key": "AAA", + "message": "message4473" + }, + { + "key": "DDD", + "message": "message4474" + }, + { + "key": "BBB", + "message": "message4475" + }, + { + "key": "DDD", + "message": "message4476" + }, + { + "key": "BBB", + "message": "message4477" + }, + { + "key": "AAA", + "message": "message4478" + }, + { + "key": "BBB", + "message": "message4479" + }, + { + "key": "AAA", + "message": "message4480" + }, + { + "key": "CCC", + "message": "message4481" + }, + { + "key": "AAA", + "message": "message4482" + }, + { + "key": "AAA", + "message": "message4483" + }, + { + "key": "CCC", + "message": "message4484" + }, + { + "key": "AAA", + "message": "message4485" + }, + { + "key": "BBB", + "message": "message4486" + }, + { + "key": "", + "message": "message4487" + }, + { + "key": "", + "message": "message4488" + }, + { + "key": "BBB", + "message": "message4489" + }, + { + "key": "CCC", + "message": "message4490" + }, + { + "key": "BBB", + "message": "message4491" + }, + { + "key": "DDD", + "message": "message4492" + }, + { + "key": "", + "message": "message4493" + }, + { + "key": "DDD", + "message": "message4494" + }, + { + "key": "AAA", + "message": "message4495" + }, + { + "key": "CCC", + "message": "message4496" + }, + { + "key": "DDD", + "message": "message4497" + }, + { + "key": "CCC", + "message": "message4498" + }, + { + "key": "BBB", + "message": "message4499" + }, + { + "key": "CCC", + "message": "message4500" + }, + { + "key": "", + "message": "message4501" + }, + { + "key": "BBB", + "message": "message4502" + }, + { + "key": "AAA", + "message": "message4503" + }, + { + "key": "AAA", + "message": "message4504" + }, + { + "key": "BBB", + "message": "message4505" + }, + { + "key": "", + "message": "message4506" + }, + { + "key": "", + "message": "message4507" + }, + { + "key": "DDD", + "message": "message4508" + }, + { + "key": "", + "message": "message4509" + }, + { + "key": "BBB", + "message": "message4510" + }, + { + "key": "", + "message": "message4511" + }, + { + "key": "", + "message": "message4512" + }, + { + "key": "BBB", + "message": "message4513" + }, + { + "key": "DDD", + "message": "message4514" + }, + { + "key": "BBB", + "message": "message4515" + }, + { + "key": "BBB", + "message": "message4516" + }, + { + "key": "AAA", + "message": "message4517" + }, + { + "key": "DDD", + "message": "message4518" + }, + { + "key": "DDD", + "message": "message4519" + }, + { + "key": "AAA", + "message": "message4520" + }, + { + "key": "DDD", + "message": "message4521" + }, + { + "key": "CCC", + "message": "message4522" + }, + { + "key": "CCC", + "message": "message4523" + }, + { + "key": "DDD", + "message": "message4524" + }, + { + "key": "BBB", + "message": "message4525" + }, + { + "key": "CCC", + "message": "message4526" + }, + { + "key": "BBB", + "message": "message4527" + }, + { + "key": "", + "message": "message4528" + }, + { + "key": "", + "message": "message4529" + }, + { + "key": "BBB", + "message": "message4530" + }, + { + "key": "DDD", + "message": "message4531" + }, + { + "key": "DDD", + "message": "message4532" + }, + { + "key": "DDD", + "message": "message4533" + }, + { + "key": "", + "message": "message4534" + }, + { + "key": "BBB", + "message": "message4535" + }, + { + "key": "", + "message": "message4536" + }, + { + "key": "CCC", + "message": "message4537" + }, + { + "key": "DDD", + "message": "message4538" + }, + { + "key": "", + "message": "message4539" + }, + { + "key": "CCC", + "message": "message4540" + }, + { + "key": "CCC", + "message": "message4541" + }, + { + "key": "DDD", + "message": "message4542" + }, + { + "key": "BBB", + "message": "message4543" + }, + { + "key": "DDD", + "message": "message4544" + }, + { + "key": "BBB", + "message": "message4545" + }, + { + "key": "CCC", + "message": "message4546" + }, + { + "key": "CCC", + "message": "message4547" + }, + { + "key": "", + "message": "message4548" + }, + { + "key": "AAA", + "message": "message4549" + }, + { + "key": "BBB", + "message": "message4550" + }, + { + "key": "DDD", + "message": "message4551" + }, + { + "key": "BBB", + "message": "message4552" + }, + { + "key": "DDD", + "message": "message4553" + }, + { + "key": "", + "message": "message4554" + }, + { + "key": "AAA", + "message": "message4555" + }, + { + "key": "DDD", + "message": "message4556" + }, + { + "key": "", + "message": "message4557" + }, + { + "key": "CCC", + "message": "message4558" + }, + { + "key": "BBB", + "message": "message4559" + }, + { + "key": "DDD", + "message": "message4560" + }, + { + "key": "AAA", + "message": "message4561" + }, + { + "key": "AAA", + "message": "message4562" + }, + { + "key": "DDD", + "message": "message4563" + }, + { + "key": "AAA", + "message": "message4564" + }, + { + "key": "AAA", + "message": "message4565" + }, + { + "key": "DDD", + "message": "message4566" + }, + { + "key": "DDD", + "message": "message4567" + }, + { + "key": "", + "message": "message4568" + }, + { + "key": "CCC", + "message": "message4569" + }, + { + "key": "BBB", + "message": "message4570" + }, + { + "key": "CCC", + "message": "message4571" + }, + { + "key": "CCC", + "message": "message4572" + }, + { + "key": "CCC", + "message": "message4573" + }, + { + "key": "", + "message": "message4574" + }, + { + "key": "DDD", + "message": "message4575" + }, + { + "key": "AAA", + "message": "message4576" + }, + { + "key": "", + "message": "message4577" + }, + { + "key": "CCC", + "message": "message4578" + }, + { + "key": "BBB", + "message": "message4579" + }, + { + "key": "BBB", + "message": "message4580" + }, + { + "key": "AAA", + "message": "message4581" + }, + { + "key": "CCC", + "message": "message4582" + }, + { + "key": "AAA", + "message": "message4583" + }, + { + "key": "DDD", + "message": "message4584" + }, + { + "key": "DDD", + "message": "message4585" + }, + { + "key": "BBB", + "message": "message4586" + }, + { + "key": "CCC", + "message": "message4587" + }, + { + "key": "CCC", + "message": "message4588" + }, + { + "key": "AAA", + "message": "message4589" + }, + { + "key": "AAA", + "message": "message4590" + }, + { + "key": "", + "message": "message4591" + }, + { + "key": "CCC", + "message": "message4592" + }, + { + "key": "DDD", + "message": "message4593" + }, + { + "key": "CCC", + "message": "message4594" + }, + { + "key": "AAA", + "message": "message4595" + }, + { + "key": "DDD", + "message": "message4596" + }, + { + "key": "DDD", + "message": "message4597" + }, + { + "key": "DDD", + "message": "message4598" + }, + { + "key": "CCC", + "message": "message4599" + }, + { + "key": "", + "message": "message4600" + }, + { + "key": "", + "message": "message4601" + }, + { + "key": "", + "message": "message4602" + }, + { + "key": "AAA", + "message": "message4603" + }, + { + "key": "", + "message": "message4604" + }, + { + "key": "CCC", + "message": "message4605" + }, + { + "key": "DDD", + "message": "message4606" + }, + { + "key": "DDD", + "message": "message4607" + }, + { + "key": "", + "message": "message4608" + }, + { + "key": "AAA", + "message": "message4609" + }, + { + "key": "BBB", + "message": "message4610" + }, + { + "key": "CCC", + "message": "message4611" + }, + { + "key": "CCC", + "message": "message4612" + }, + { + "key": "CCC", + "message": "message4613" + }, + { + "key": "AAA", + "message": "message4614" + }, + { + "key": "BBB", + "message": "message4615" + }, + { + "key": "", + "message": "message4616" + }, + { + "key": "", + "message": "message4617" + }, + { + "key": "", + "message": "message4618" + }, + { + "key": "CCC", + "message": "message4619" + }, + { + "key": "DDD", + "message": "message4620" + }, + { + "key": "AAA", + "message": "message4621" + }, + { + "key": "CCC", + "message": "message4622" + }, + { + "key": "BBB", + "message": "message4623" + }, + { + "key": "DDD", + "message": "message4624" + }, + { + "key": "BBB", + "message": "message4625" + }, + { + "key": "AAA", + "message": "message4626" + }, + { + "key": "BBB", + "message": "message4627" + }, + { + "key": "CCC", + "message": "message4628" + }, + { + "key": "", + "message": "message4629" + }, + { + "key": "AAA", + "message": "message4630" + }, + { + "key": "AAA", + "message": "message4631" + }, + { + "key": "", + "message": "message4632" + }, + { + "key": "", + "message": "message4633" + }, + { + "key": "DDD", + "message": "message4634" + }, + { + "key": "DDD", + "message": "message4635" + }, + { + "key": "CCC", + "message": "message4636" + }, + { + "key": "AAA", + "message": "message4637" + }, + { + "key": "", + "message": "message4638" + }, + { + "key": "", + "message": "message4639" + }, + { + "key": "AAA", + "message": "message4640" + }, + { + "key": "CCC", + "message": "message4641" + }, + { + "key": "BBB", + "message": "message4642" + }, + { + "key": "AAA", + "message": "message4643" + }, + { + "key": "AAA", + "message": "message4644" + }, + { + "key": "AAA", + "message": "message4645" + }, + { + "key": "BBB", + "message": "message4646" + }, + { + "key": "BBB", + "message": "message4647" + }, + { + "key": "", + "message": "message4648" + }, + { + "key": "AAA", + "message": "message4649" + }, + { + "key": "DDD", + "message": "message4650" + }, + { + "key": "AAA", + "message": "message4651" + }, + { + "key": "DDD", + "message": "message4652" + }, + { + "key": "", + "message": "message4653" + }, + { + "key": "AAA", + "message": "message4654" + }, + { + "key": "DDD", + "message": "message4655" + }, + { + "key": "AAA", + "message": "message4656" + }, + { + "key": "", + "message": "message4657" + }, + { + "key": "", + "message": "message4658" + }, + { + "key": "DDD", + "message": "message4659" + }, + { + "key": "DDD", + "message": "message4660" + }, + { + "key": "CCC", + "message": "message4661" + }, + { + "key": "BBB", + "message": "message4662" + }, + { + "key": "AAA", + "message": "message4663" + }, + { + "key": "DDD", + "message": "message4664" + }, + { + "key": "DDD", + "message": "message4665" + }, + { + "key": "BBB", + "message": "message4666" + }, + { + "key": "CCC", + "message": "message4667" + }, + { + "key": "", + "message": "message4668" + }, + { + "key": "", + "message": "message4669" + }, + { + "key": "CCC", + "message": "message4670" + }, + { + "key": "DDD", + "message": "message4671" + }, + { + "key": "DDD", + "message": "message4672" + }, + { + "key": "", + "message": "message4673" + }, + { + "key": "CCC", + "message": "message4674" + }, + { + "key": "", + "message": "message4675" + }, + { + "key": "DDD", + "message": "message4676" + }, + { + "key": "", + "message": "message4677" + }, + { + "key": "", + "message": "message4678" + }, + { + "key": "BBB", + "message": "message4679" + }, + { + "key": "DDD", + "message": "message4680" + }, + { + "key": "", + "message": "message4681" + }, + { + "key": "", + "message": "message4682" + }, + { + "key": "", + "message": "message4683" + }, + { + "key": "BBB", + "message": "message4684" + }, + { + "key": "AAA", + "message": "message4685" + }, + { + "key": "", + "message": "message4686" + }, + { + "key": "", + "message": "message4687" + }, + { + "key": "CCC", + "message": "message4688" + }, + { + "key": "AAA", + "message": "message4689" + }, + { + "key": "BBB", + "message": "message4690" + }, + { + "key": "DDD", + "message": "message4691" + }, + { + "key": "CCC", + "message": "message4692" + }, + { + "key": "", + "message": "message4693" + }, + { + "key": "DDD", + "message": "message4694" + }, + { + "key": "", + "message": "message4695" + }, + { + "key": "BBB", + "message": "message4696" + }, + { + "key": "", + "message": "message4697" + }, + { + "key": "", + "message": "message4698" + }, + { + "key": "DDD", + "message": "message4699" + }, + { + "key": "BBB", + "message": "message4700" + }, + { + "key": "CCC", + "message": "message4701" + }, + { + "key": "CCC", + "message": "message4702" + }, + { + "key": "AAA", + "message": "message4703" + }, + { + "key": "AAA", + "message": "message4704" + }, + { + "key": "AAA", + "message": "message4705" + }, + { + "key": "", + "message": "message4706" + }, + { + "key": "CCC", + "message": "message4707" + }, + { + "key": "BBB", + "message": "message4708" + }, + { + "key": "BBB", + "message": "message4709" + }, + { + "key": "DDD", + "message": "message4710" + }, + { + "key": "AAA", + "message": "message4711" + }, + { + "key": "BBB", + "message": "message4712" + }, + { + "key": "CCC", + "message": "message4713" + }, + { + "key": "DDD", + "message": "message4714" + }, + { + "key": "AAA", + "message": "message4715" + }, + { + "key": "AAA", + "message": "message4716" + }, + { + "key": "", + "message": "message4717" + }, + { + "key": "BBB", + "message": "message4718" + }, + { + "key": "AAA", + "message": "message4719" + }, + { + "key": "BBB", + "message": "message4720" + }, + { + "key": "DDD", + "message": "message4721" + }, + { + "key": "", + "message": "message4722" + }, + { + "key": "AAA", + "message": "message4723" + }, + { + "key": "DDD", + "message": "message4724" + }, + { + "key": "AAA", + "message": "message4725" + }, + { + "key": "AAA", + "message": "message4726" + }, + { + "key": "CCC", + "message": "message4727" + }, + { + "key": "DDD", + "message": "message4728" + }, + { + "key": "DDD", + "message": "message4729" + }, + { + "key": "DDD", + "message": "message4730" + }, + { + "key": "DDD", + "message": "message4731" + }, + { + "key": "BBB", + "message": "message4732" + }, + { + "key": "", + "message": "message4733" + }, + { + "key": "BBB", + "message": "message4734" + }, + { + "key": "AAA", + "message": "message4735" + }, + { + "key": "DDD", + "message": "message4736" + }, + { + "key": "BBB", + "message": "message4737" + }, + { + "key": "AAA", + "message": "message4738" + }, + { + "key": "BBB", + "message": "message4739" + }, + { + "key": "AAA", + "message": "message4740" + }, + { + "key": "AAA", + "message": "message4741" + }, + { + "key": "", + "message": "message4742" + }, + { + "key": "DDD", + "message": "message4743" + }, + { + "key": "CCC", + "message": "message4744" + }, + { + "key": "CCC", + "message": "message4745" + }, + { + "key": "DDD", + "message": "message4746" + }, + { + "key": "BBB", + "message": "message4747" + }, + { + "key": "CCC", + "message": "message4748" + }, + { + "key": "BBB", + "message": "message4749" + }, + { + "key": "CCC", + "message": "message4750" + }, + { + "key": "DDD", + "message": "message4751" + }, + { + "key": "", + "message": "message4752" + }, + { + "key": "CCC", + "message": "message4753" + }, + { + "key": "", + "message": "message4754" + }, + { + "key": "", + "message": "message4755" + }, + { + "key": "AAA", + "message": "message4756" + }, + { + "key": "DDD", + "message": "message4757" + }, + { + "key": "", + "message": "message4758" + }, + { + "key": "DDD", + "message": "message4759" + }, + { + "key": "", + "message": "message4760" + }, + { + "key": "", + "message": "message4761" + }, + { + "key": "DDD", + "message": "message4762" + }, + { + "key": "", + "message": "message4763" + }, + { + "key": "BBB", + "message": "message4764" + }, + { + "key": "CCC", + "message": "message4765" + }, + { + "key": "AAA", + "message": "message4766" + }, + { + "key": "AAA", + "message": "message4767" + }, + { + "key": "CCC", + "message": "message4768" + }, + { + "key": "BBB", + "message": "message4769" + }, + { + "key": "AAA", + "message": "message4770" + }, + { + "key": "CCC", + "message": "message4771" + }, + { + "key": "CCC", + "message": "message4772" + }, + { + "key": "", + "message": "message4773" + }, + { + "key": "BBB", + "message": "message4774" + }, + { + "key": "BBB", + "message": "message4775" + }, + { + "key": "CCC", + "message": "message4776" + }, + { + "key": "BBB", + "message": "message4777" + }, + { + "key": "BBB", + "message": "message4778" + }, + { + "key": "CCC", + "message": "message4779" + }, + { + "key": "AAA", + "message": "message4780" + }, + { + "key": "CCC", + "message": "message4781" + }, + { + "key": "BBB", + "message": "message4782" + }, + { + "key": "BBB", + "message": "message4783" + }, + { + "key": "", + "message": "message4784" + }, + { + "key": "DDD", + "message": "message4785" + }, + { + "key": "DDD", + "message": "message4786" + }, + { + "key": "DDD", + "message": "message4787" + }, + { + "key": "CCC", + "message": "message4788" + }, + { + "key": "", + "message": "message4789" + }, + { + "key": "CCC", + "message": "message4790" + }, + { + "key": "CCC", + "message": "message4791" + }, + { + "key": "DDD", + "message": "message4792" + }, + { + "key": "AAA", + "message": "message4793" + }, + { + "key": "", + "message": "message4794" + }, + { + "key": "", + "message": "message4795" + }, + { + "key": "CCC", + "message": "message4796" + }, + { + "key": "CCC", + "message": "message4797" + }, + { + "key": "AAA", + "message": "message4798" + }, + { + "key": "CCC", + "message": "message4799" + }, + { + "key": "AAA", + "message": "message4800" + }, + { + "key": "DDD", + "message": "message4801" + }, + { + "key": "AAA", + "message": "message4802" + }, + { + "key": "", + "message": "message4803" + }, + { + "key": "BBB", + "message": "message4804" + }, + { + "key": "", + "message": "message4805" + }, + { + "key": "AAA", + "message": "message4806" + }, + { + "key": "CCC", + "message": "message4807" + }, + { + "key": "DDD", + "message": "message4808" + }, + { + "key": "AAA", + "message": "message4809" + }, + { + "key": "", + "message": "message4810" + }, + { + "key": "CCC", + "message": "message4811" + }, + { + "key": "CCC", + "message": "message4812" + }, + { + "key": "", + "message": "message4813" + }, + { + "key": "", + "message": "message4814" + }, + { + "key": "BBB", + "message": "message4815" + }, + { + "key": "AAA", + "message": "message4816" + }, + { + "key": "BBB", + "message": "message4817" + }, + { + "key": "CCC", + "message": "message4818" + }, + { + "key": "BBB", + "message": "message4819" + }, + { + "key": "CCC", + "message": "message4820" + }, + { + "key": "BBB", + "message": "message4821" + }, + { + "key": "AAA", + "message": "message4822" + }, + { + "key": "", + "message": "message4823" + }, + { + "key": "AAA", + "message": "message4824" + }, + { + "key": "BBB", + "message": "message4825" + }, + { + "key": "AAA", + "message": "message4826" + }, + { + "key": "CCC", + "message": "message4827" + }, + { + "key": "", + "message": "message4828" + }, + { + "key": "BBB", + "message": "message4829" + }, + { + "key": "BBB", + "message": "message4830" + }, + { + "key": "CCC", + "message": "message4831" + }, + { + "key": "CCC", + "message": "message4832" + }, + { + "key": "CCC", + "message": "message4833" + }, + { + "key": "AAA", + "message": "message4834" + }, + { + "key": "BBB", + "message": "message4835" + }, + { + "key": "BBB", + "message": "message4836" + }, + { + "key": "BBB", + "message": "message4837" + }, + { + "key": "CCC", + "message": "message4838" + }, + { + "key": "", + "message": "message4839" + }, + { + "key": "CCC", + "message": "message4840" + }, + { + "key": "BBB", + "message": "message4841" + }, + { + "key": "DDD", + "message": "message4842" + }, + { + "key": "AAA", + "message": "message4843" + }, + { + "key": "BBB", + "message": "message4844" + }, + { + "key": "DDD", + "message": "message4845" + }, + { + "key": "DDD", + "message": "message4846" + }, + { + "key": "CCC", + "message": "message4847" + }, + { + "key": "CCC", + "message": "message4848" + }, + { + "key": "CCC", + "message": "message4849" + }, + { + "key": "AAA", + "message": "message4850" + }, + { + "key": "DDD", + "message": "message4851" + }, + { + "key": "BBB", + "message": "message4852" + }, + { + "key": "DDD", + "message": "message4853" + }, + { + "key": "", + "message": "message4854" + }, + { + "key": "CCC", + "message": "message4855" + }, + { + "key": "BBB", + "message": "message4856" + }, + { + "key": "", + "message": "message4857" + }, + { + "key": "AAA", + "message": "message4858" + }, + { + "key": "DDD", + "message": "message4859" + }, + { + "key": "CCC", + "message": "message4860" + }, + { + "key": "DDD", + "message": "message4861" + }, + { + "key": "AAA", + "message": "message4862" + }, + { + "key": "DDD", + "message": "message4863" + }, + { + "key": "AAA", + "message": "message4864" + }, + { + "key": "BBB", + "message": "message4865" + }, + { + "key": "AAA", + "message": "message4866" + }, + { + "key": "", + "message": "message4867" + }, + { + "key": "CCC", + "message": "message4868" + }, + { + "key": "BBB", + "message": "message4869" + }, + { + "key": "", + "message": "message4870" + }, + { + "key": "BBB", + "message": "message4871" + }, + { + "key": "", + "message": "message4872" + }, + { + "key": "CCC", + "message": "message4873" + }, + { + "key": "AAA", + "message": "message4874" + }, + { + "key": "", + "message": "message4875" + }, + { + "key": "DDD", + "message": "message4876" + }, + { + "key": "AAA", + "message": "message4877" + }, + { + "key": "AAA", + "message": "message4878" + }, + { + "key": "AAA", + "message": "message4879" + }, + { + "key": "CCC", + "message": "message4880" + }, + { + "key": "CCC", + "message": "message4881" + }, + { + "key": "DDD", + "message": "message4882" + }, + { + "key": "CCC", + "message": "message4883" + }, + { + "key": "CCC", + "message": "message4884" + }, + { + "key": "", + "message": "message4885" + }, + { + "key": "", + "message": "message4886" + }, + { + "key": "BBB", + "message": "message4887" + }, + { + "key": "DDD", + "message": "message4888" + }, + { + "key": "DDD", + "message": "message4889" + }, + { + "key": "DDD", + "message": "message4890" + }, + { + "key": "CCC", + "message": "message4891" + }, + { + "key": "AAA", + "message": "message4892" + }, + { + "key": "DDD", + "message": "message4893" + }, + { + "key": "DDD", + "message": "message4894" + }, + { + "key": "", + "message": "message4895" + }, + { + "key": "BBB", + "message": "message4896" + }, + { + "key": "CCC", + "message": "message4897" + }, + { + "key": "CCC", + "message": "message4898" + }, + { + "key": "", + "message": "message4899" + }, + { + "key": "BBB", + "message": "message4900" + }, + { + "key": "CCC", + "message": "message4901" + }, + { + "key": "AAA", + "message": "message4902" + }, + { + "key": "", + "message": "message4903" + }, + { + "key": "", + "message": "message4904" + }, + { + "key": "CCC", + "message": "message4905" + }, + { + "key": "DDD", + "message": "message4906" + }, + { + "key": "", + "message": "message4907" + }, + { + "key": "", + "message": "message4908" + }, + { + "key": "AAA", + "message": "message4909" + }, + { + "key": "", + "message": "message4910" + }, + { + "key": "AAA", + "message": "message4911" + }, + { + "key": "CCC", + "message": "message4912" + }, + { + "key": "CCC", + "message": "message4913" + }, + { + "key": "", + "message": "message4914" + }, + { + "key": "", + "message": "message4915" + }, + { + "key": "BBB", + "message": "message4916" + }, + { + "key": "BBB", + "message": "message4917" + }, + { + "key": "", + "message": "message4918" + }, + { + "key": "BBB", + "message": "message4919" + }, + { + "key": "", + "message": "message4920" + }, + { + "key": "BBB", + "message": "message4921" + }, + { + "key": "AAA", + "message": "message4922" + }, + { + "key": "", + "message": "message4923" + }, + { + "key": "BBB", + "message": "message4924" + }, + { + "key": "CCC", + "message": "message4925" + }, + { + "key": "BBB", + "message": "message4926" + }, + { + "key": "CCC", + "message": "message4927" + }, + { + "key": "BBB", + "message": "message4928" + }, + { + "key": "DDD", + "message": "message4929" + }, + { + "key": "", + "message": "message4930" + }, + { + "key": "BBB", + "message": "message4931" + }, + { + "key": "AAA", + "message": "message4932" + }, + { + "key": "DDD", + "message": "message4933" + }, + { + "key": "", + "message": "message4934" + }, + { + "key": "AAA", + "message": "message4935" + }, + { + "key": "BBB", + "message": "message4936" + }, + { + "key": "", + "message": "message4937" + }, + { + "key": "BBB", + "message": "message4938" + }, + { + "key": "BBB", + "message": "message4939" + }, + { + "key": "CCC", + "message": "message4940" + }, + { + "key": "CCC", + "message": "message4941" + }, + { + "key": "BBB", + "message": "message4942" + }, + { + "key": "AAA", + "message": "message4943" + }, + { + "key": "", + "message": "message4944" + }, + { + "key": "CCC", + "message": "message4945" + }, + { + "key": "AAA", + "message": "message4946" + }, + { + "key": "DDD", + "message": "message4947" + }, + { + "key": "DDD", + "message": "message4948" + }, + { + "key": "DDD", + "message": "message4949" + }, + { + "key": "CCC", + "message": "message4950" + }, + { + "key": "BBB", + "message": "message4951" + }, + { + "key": "", + "message": "message4952" + }, + { + "key": "CCC", + "message": "message4953" + }, + { + "key": "DDD", + "message": "message4954" + }, + { + "key": "AAA", + "message": "message4955" + }, + { + "key": "BBB", + "message": "message4956" + }, + { + "key": "BBB", + "message": "message4957" + }, + { + "key": "BBB", + "message": "message4958" + }, + { + "key": "", + "message": "message4959" + }, + { + "key": "CCC", + "message": "message4960" + }, + { + "key": "BBB", + "message": "message4961" + }, + { + "key": "AAA", + "message": "message4962" + }, + { + "key": "DDD", + "message": "message4963" + }, + { + "key": "BBB", + "message": "message4964" + }, + { + "key": "", + "message": "message4965" + }, + { + "key": "BBB", + "message": "message4966" + }, + { + "key": "AAA", + "message": "message4967" + }, + { + "key": "DDD", + "message": "message4968" + }, + { + "key": "DDD", + "message": "message4969" + }, + { + "key": "CCC", + "message": "message4970" + }, + { + "key": "BBB", + "message": "message4971" + }, + { + "key": "AAA", + "message": "message4972" + }, + { + "key": "CCC", + "message": "message4973" + }, + { + "key": "BBB", + "message": "message4974" + }, + { + "key": "CCC", + "message": "message4975" + }, + { + "key": "AAA", + "message": "message4976" + }, + { + "key": "CCC", + "message": "message4977" + }, + { + "key": "", + "message": "message4978" + }, + { + "key": "", + "message": "message4979" + }, + { + "key": "BBB", + "message": "message4980" + }, + { + "key": "CCC", + "message": "message4981" + }, + { + "key": "", + "message": "message4982" + }, + { + "key": "BBB", + "message": "message4983" + }, + { + "key": "AAA", + "message": "message4984" + }, + { + "key": "AAA", + "message": "message4985" + }, + { + "key": "", + "message": "message4986" + }, + { + "key": "", + "message": "message4987" + }, + { + "key": "DDD", + "message": "message4988" + }, + { + "key": "CCC", + "message": "message4989" + }, + { + "key": "BBB", + "message": "message4990" + }, + { + "key": "", + "message": "message4991" + }, + { + "key": "CCC", + "message": "message4992" + }, + { + "key": "AAA", + "message": "message4993" + }, + { + "key": "AAA", + "message": "message4994" + }, + { + "key": "BBB", + "message": "message4995" + }, + { + "key": "AAA", + "message": "message4996" + }, + { + "key": "AAA", + "message": "message4997" + }, + { + "key": "BBB", + "message": "message4998" + }, + { + "key": "CCC", + "message": "message4999" + }, + { + "key": "BBB", + "message": "message5000" + }, + { + "key": "AAA", + "message": "message5001" + }, + { + "key": "CCC", + "message": "message5002" + }, + { + "key": "", + "message": "message5003" + }, + { + "key": "DDD", + "message": "message5004" + }, + { + "key": "DDD", + "message": "message5005" + }, + { + "key": "CCC", + "message": "message5006" + }, + { + "key": "BBB", + "message": "message5007" + }, + { + "key": "CCC", + "message": "message5008" + }, + { + "key": "AAA", + "message": "message5009" + }, + { + "key": "AAA", + "message": "message5010" + }, + { + "key": "AAA", + "message": "message5011" + }, + { + "key": "", + "message": "message5012" + }, + { + "key": "BBB", + "message": "message5013" + }, + { + "key": "AAA", + "message": "message5014" + }, + { + "key": "DDD", + "message": "message5015" + }, + { + "key": "", + "message": "message5016" + }, + { + "key": "", + "message": "message5017" + }, + { + "key": "", + "message": "message5018" + }, + { + "key": "", + "message": "message5019" + }, + { + "key": "CCC", + "message": "message5020" + }, + { + "key": "BBB", + "message": "message5021" + }, + { + "key": "DDD", + "message": "message5022" + }, + { + "key": "CCC", + "message": "message5023" + }, + { + "key": "AAA", + "message": "message5024" + }, + { + "key": "CCC", + "message": "message5025" + }, + { + "key": "BBB", + "message": "message5026" + }, + { + "key": "DDD", + "message": "message5027" + }, + { + "key": "BBB", + "message": "message5028" + }, + { + "key": "CCC", + "message": "message5029" + }, + { + "key": "AAA", + "message": "message5030" + }, + { + "key": "CCC", + "message": "message5031" + }, + { + "key": "DDD", + "message": "message5032" + }, + { + "key": "CCC", + "message": "message5033" + }, + { + "key": "AAA", + "message": "message5034" + }, + { + "key": "AAA", + "message": "message5035" + }, + { + "key": "AAA", + "message": "message5036" + }, + { + "key": "DDD", + "message": "message5037" + }, + { + "key": "CCC", + "message": "message5038" + }, + { + "key": "", + "message": "message5039" + }, + { + "key": "AAA", + "message": "message5040" + }, + { + "key": "BBB", + "message": "message5041" + }, + { + "key": "CCC", + "message": "message5042" + }, + { + "key": "CCC", + "message": "message5043" + }, + { + "key": "CCC", + "message": "message5044" + }, + { + "key": "CCC", + "message": "message5045" + }, + { + "key": "CCC", + "message": "message5046" + }, + { + "key": "BBB", + "message": "message5047" + }, + { + "key": "DDD", + "message": "message5048" + }, + { + "key": "", + "message": "message5049" + }, + { + "key": "AAA", + "message": "message5050" + }, + { + "key": "DDD", + "message": "message5051" + }, + { + "key": "DDD", + "message": "message5052" + }, + { + "key": "BBB", + "message": "message5053" + }, + { + "key": "AAA", + "message": "message5054" + }, + { + "key": "BBB", + "message": "message5055" + }, + { + "key": "DDD", + "message": "message5056" + }, + { + "key": "AAA", + "message": "message5057" + }, + { + "key": "", + "message": "message5058" + }, + { + "key": "AAA", + "message": "message5059" + }, + { + "key": "DDD", + "message": "message5060" + }, + { + "key": "", + "message": "message5061" + }, + { + "key": "", + "message": "message5062" + }, + { + "key": "", + "message": "message5063" + }, + { + "key": "BBB", + "message": "message5064" + }, + { + "key": "BBB", + "message": "message5065" + }, + { + "key": "DDD", + "message": "message5066" + }, + { + "key": "DDD", + "message": "message5067" + }, + { + "key": "CCC", + "message": "message5068" + }, + { + "key": "BBB", + "message": "message5069" + }, + { + "key": "CCC", + "message": "message5070" + }, + { + "key": "DDD", + "message": "message5071" + }, + { + "key": "CCC", + "message": "message5072" + }, + { + "key": "DDD", + "message": "message5073" + }, + { + "key": "DDD", + "message": "message5074" + }, + { + "key": "", + "message": "message5075" + }, + { + "key": "DDD", + "message": "message5076" + }, + { + "key": "AAA", + "message": "message5077" + }, + { + "key": "BBB", + "message": "message5078" + }, + { + "key": "BBB", + "message": "message5079" + }, + { + "key": "AAA", + "message": "message5080" + }, + { + "key": "DDD", + "message": "message5081" + }, + { + "key": "CCC", + "message": "message5082" + }, + { + "key": "DDD", + "message": "message5083" + }, + { + "key": "DDD", + "message": "message5084" + }, + { + "key": "BBB", + "message": "message5085" + }, + { + "key": "AAA", + "message": "message5086" + }, + { + "key": "", + "message": "message5087" + }, + { + "key": "", + "message": "message5088" + }, + { + "key": "CCC", + "message": "message5089" + }, + { + "key": "DDD", + "message": "message5090" + }, + { + "key": "CCC", + "message": "message5091" + }, + { + "key": "", + "message": "message5092" + }, + { + "key": "BBB", + "message": "message5093" + }, + { + "key": "AAA", + "message": "message5094" + }, + { + "key": "BBB", + "message": "message5095" + }, + { + "key": "DDD", + "message": "message5096" + }, + { + "key": "CCC", + "message": "message5097" + }, + { + "key": "AAA", + "message": "message5098" + }, + { + "key": "AAA", + "message": "message5099" + }, + { + "key": "", + "message": "message5100" + }, + { + "key": "", + "message": "message5101" + }, + { + "key": "CCC", + "message": "message5102" + }, + { + "key": "", + "message": "message5103" + }, + { + "key": "DDD", + "message": "message5104" + }, + { + "key": "", + "message": "message5105" + }, + { + "key": "BBB", + "message": "message5106" + }, + { + "key": "BBB", + "message": "message5107" + }, + { + "key": "DDD", + "message": "message5108" + }, + { + "key": "BBB", + "message": "message5109" + }, + { + "key": "AAA", + "message": "message5110" + }, + { + "key": "BBB", + "message": "message5111" + }, + { + "key": "AAA", + "message": "message5112" + }, + { + "key": "CCC", + "message": "message5113" + }, + { + "key": "", + "message": "message5114" + }, + { + "key": "AAA", + "message": "message5115" + }, + { + "key": "AAA", + "message": "message5116" + }, + { + "key": "AAA", + "message": "message5117" + }, + { + "key": "DDD", + "message": "message5118" + }, + { + "key": "AAA", + "message": "message5119" + }, + { + "key": "BBB", + "message": "message5120" + }, + { + "key": "DDD", + "message": "message5121" + }, + { + "key": "AAA", + "message": "message5122" + }, + { + "key": "AAA", + "message": "message5123" + }, + { + "key": "DDD", + "message": "message5124" + }, + { + "key": "BBB", + "message": "message5125" + }, + { + "key": "BBB", + "message": "message5126" + }, + { + "key": "", + "message": "message5127" + }, + { + "key": "CCC", + "message": "message5128" + }, + { + "key": "", + "message": "message5129" + }, + { + "key": "", + "message": "message5130" + }, + { + "key": "CCC", + "message": "message5131" + }, + { + "key": "AAA", + "message": "message5132" + }, + { + "key": "BBB", + "message": "message5133" + }, + { + "key": "DDD", + "message": "message5134" + }, + { + "key": "BBB", + "message": "message5135" + }, + { + "key": "", + "message": "message5136" + }, + { + "key": "", + "message": "message5137" + }, + { + "key": "CCC", + "message": "message5138" + }, + { + "key": "", + "message": "message5139" + }, + { + "key": "AAA", + "message": "message5140" + }, + { + "key": "", + "message": "message5141" + }, + { + "key": "DDD", + "message": "message5142" + }, + { + "key": "BBB", + "message": "message5143" + }, + { + "key": "DDD", + "message": "message5144" + }, + { + "key": "", + "message": "message5145" + }, + { + "key": "AAA", + "message": "message5146" + }, + { + "key": "BBB", + "message": "message5147" + }, + { + "key": "BBB", + "message": "message5148" + }, + { + "key": "AAA", + "message": "message5149" + }, + { + "key": "BBB", + "message": "message5150" + }, + { + "key": "CCC", + "message": "message5151" + }, + { + "key": "BBB", + "message": "message5152" + }, + { + "key": "AAA", + "message": "message5153" + }, + { + "key": "", + "message": "message5154" + }, + { + "key": "DDD", + "message": "message5155" + }, + { + "key": "DDD", + "message": "message5156" + }, + { + "key": "DDD", + "message": "message5157" + }, + { + "key": "", + "message": "message5158" + }, + { + "key": "DDD", + "message": "message5159" + }, + { + "key": "AAA", + "message": "message5160" + }, + { + "key": "DDD", + "message": "message5161" + }, + { + "key": "CCC", + "message": "message5162" + }, + { + "key": "AAA", + "message": "message5163" + }, + { + "key": "BBB", + "message": "message5164" + }, + { + "key": "CCC", + "message": "message5165" + }, + { + "key": "BBB", + "message": "message5166" + }, + { + "key": "DDD", + "message": "message5167" + }, + { + "key": "AAA", + "message": "message5168" + }, + { + "key": "DDD", + "message": "message5169" + }, + { + "key": "DDD", + "message": "message5170" + }, + { + "key": "BBB", + "message": "message5171" + }, + { + "key": "AAA", + "message": "message5172" + }, + { + "key": "DDD", + "message": "message5173" + }, + { + "key": "AAA", + "message": "message5174" + }, + { + "key": "AAA", + "message": "message5175" + }, + { + "key": "", + "message": "message5176" + }, + { + "key": "AAA", + "message": "message5177" + }, + { + "key": "", + "message": "message5178" + }, + { + "key": "", + "message": "message5179" + }, + { + "key": "AAA", + "message": "message5180" + }, + { + "key": "CCC", + "message": "message5181" + }, + { + "key": "AAA", + "message": "message5182" + }, + { + "key": "BBB", + "message": "message5183" + }, + { + "key": "AAA", + "message": "message5184" + }, + { + "key": "AAA", + "message": "message5185" + }, + { + "key": "CCC", + "message": "message5186" + }, + { + "key": "", + "message": "message5187" + }, + { + "key": "AAA", + "message": "message5188" + }, + { + "key": "CCC", + "message": "message5189" + }, + { + "key": "BBB", + "message": "message5190" + }, + { + "key": "", + "message": "message5191" + }, + { + "key": "CCC", + "message": "message5192" + }, + { + "key": "BBB", + "message": "message5193" + }, + { + "key": "CCC", + "message": "message5194" + }, + { + "key": "BBB", + "message": "message5195" + }, + { + "key": "", + "message": "message5196" + }, + { + "key": "AAA", + "message": "message5197" + }, + { + "key": "AAA", + "message": "message5198" + }, + { + "key": "CCC", + "message": "message5199" + }, + { + "key": "BBB", + "message": "message5200" + }, + { + "key": "BBB", + "message": "message5201" + }, + { + "key": "CCC", + "message": "message5202" + }, + { + "key": "", + "message": "message5203" + }, + { + "key": "AAA", + "message": "message5204" + }, + { + "key": "CCC", + "message": "message5205" + }, + { + "key": "AAA", + "message": "message5206" + }, + { + "key": "", + "message": "message5207" + }, + { + "key": "DDD", + "message": "message5208" + }, + { + "key": "CCC", + "message": "message5209" + }, + { + "key": "", + "message": "message5210" + }, + { + "key": "", + "message": "message5211" + }, + { + "key": "BBB", + "message": "message5212" + }, + { + "key": "", + "message": "message5213" + }, + { + "key": "CCC", + "message": "message5214" + }, + { + "key": "DDD", + "message": "message5215" + }, + { + "key": "", + "message": "message5216" + }, + { + "key": "", + "message": "message5217" + }, + { + "key": "DDD", + "message": "message5218" + }, + { + "key": "AAA", + "message": "message5219" + }, + { + "key": "AAA", + "message": "message5220" + }, + { + "key": "CCC", + "message": "message5221" + }, + { + "key": "BBB", + "message": "message5222" + }, + { + "key": "DDD", + "message": "message5223" + }, + { + "key": "DDD", + "message": "message5224" + }, + { + "key": "CCC", + "message": "message5225" + }, + { + "key": "AAA", + "message": "message5226" + }, + { + "key": "DDD", + "message": "message5227" + }, + { + "key": "DDD", + "message": "message5228" + }, + { + "key": "DDD", + "message": "message5229" + }, + { + "key": "AAA", + "message": "message5230" + }, + { + "key": "BBB", + "message": "message5231" + }, + { + "key": "BBB", + "message": "message5232" + }, + { + "key": "BBB", + "message": "message5233" + }, + { + "key": "BBB", + "message": "message5234" + }, + { + "key": "AAA", + "message": "message5235" + }, + { + "key": "AAA", + "message": "message5236" + }, + { + "key": "AAA", + "message": "message5237" + }, + { + "key": "AAA", + "message": "message5238" + }, + { + "key": "DDD", + "message": "message5239" + }, + { + "key": "CCC", + "message": "message5240" + }, + { + "key": "AAA", + "message": "message5241" + }, + { + "key": "BBB", + "message": "message5242" + }, + { + "key": "BBB", + "message": "message5243" + }, + { + "key": "AAA", + "message": "message5244" + }, + { + "key": "", + "message": "message5245" + }, + { + "key": "DDD", + "message": "message5246" + }, + { + "key": "CCC", + "message": "message5247" + }, + { + "key": "BBB", + "message": "message5248" + }, + { + "key": "BBB", + "message": "message5249" + }, + { + "key": "DDD", + "message": "message5250" + }, + { + "key": "BBB", + "message": "message5251" + }, + { + "key": "", + "message": "message5252" + }, + { + "key": "CCC", + "message": "message5253" + }, + { + "key": "", + "message": "message5254" + }, + { + "key": "AAA", + "message": "message5255" + }, + { + "key": "", + "message": "message5256" + }, + { + "key": "BBB", + "message": "message5257" + }, + { + "key": "CCC", + "message": "message5258" + }, + { + "key": "BBB", + "message": "message5259" + }, + { + "key": "CCC", + "message": "message5260" + }, + { + "key": "BBB", + "message": "message5261" + }, + { + "key": "", + "message": "message5262" + }, + { + "key": "DDD", + "message": "message5263" + }, + { + "key": "AAA", + "message": "message5264" + }, + { + "key": "DDD", + "message": "message5265" + }, + { + "key": "", + "message": "message5266" + }, + { + "key": "CCC", + "message": "message5267" + }, + { + "key": "AAA", + "message": "message5268" + }, + { + "key": "CCC", + "message": "message5269" + }, + { + "key": "AAA", + "message": "message5270" + }, + { + "key": "AAA", + "message": "message5271" + }, + { + "key": "CCC", + "message": "message5272" + }, + { + "key": "AAA", + "message": "message5273" + }, + { + "key": "", + "message": "message5274" + }, + { + "key": "DDD", + "message": "message5275" + }, + { + "key": "DDD", + "message": "message5276" + }, + { + "key": "BBB", + "message": "message5277" + }, + { + "key": "DDD", + "message": "message5278" + }, + { + "key": "AAA", + "message": "message5279" + }, + { + "key": "BBB", + "message": "message5280" + }, + { + "key": "DDD", + "message": "message5281" + }, + { + "key": "DDD", + "message": "message5282" + }, + { + "key": "AAA", + "message": "message5283" + }, + { + "key": "", + "message": "message5284" + }, + { + "key": "DDD", + "message": "message5285" + }, + { + "key": "BBB", + "message": "message5286" + }, + { + "key": "BBB", + "message": "message5287" + }, + { + "key": "DDD", + "message": "message5288" + }, + { + "key": "", + "message": "message5289" + }, + { + "key": "BBB", + "message": "message5290" + }, + { + "key": "CCC", + "message": "message5291" + }, + { + "key": "AAA", + "message": "message5292" + }, + { + "key": "AAA", + "message": "message5293" + }, + { + "key": "CCC", + "message": "message5294" + }, + { + "key": "", + "message": "message5295" + }, + { + "key": "AAA", + "message": "message5296" + }, + { + "key": "", + "message": "message5297" + }, + { + "key": "CCC", + "message": "message5298" + }, + { + "key": "AAA", + "message": "message5299" + }, + { + "key": "AAA", + "message": "message5300" + }, + { + "key": "CCC", + "message": "message5301" + }, + { + "key": "BBB", + "message": "message5302" + }, + { + "key": "", + "message": "message5303" + }, + { + "key": "DDD", + "message": "message5304" + }, + { + "key": "BBB", + "message": "message5305" + }, + { + "key": "CCC", + "message": "message5306" + }, + { + "key": "BBB", + "message": "message5307" + }, + { + "key": "", + "message": "message5308" + }, + { + "key": "BBB", + "message": "message5309" + }, + { + "key": "CCC", + "message": "message5310" + }, + { + "key": "", + "message": "message5311" + }, + { + "key": "CCC", + "message": "message5312" + }, + { + "key": "AAA", + "message": "message5313" + }, + { + "key": "BBB", + "message": "message5314" + }, + { + "key": "DDD", + "message": "message5315" + }, + { + "key": "", + "message": "message5316" + }, + { + "key": "DDD", + "message": "message5317" + }, + { + "key": "CCC", + "message": "message5318" + }, + { + "key": "DDD", + "message": "message5319" + }, + { + "key": "", + "message": "message5320" + }, + { + "key": "", + "message": "message5321" + }, + { + "key": "BBB", + "message": "message5322" + }, + { + "key": "DDD", + "message": "message5323" + }, + { + "key": "BBB", + "message": "message5324" + }, + { + "key": "", + "message": "message5325" + }, + { + "key": "CCC", + "message": "message5326" + }, + { + "key": "CCC", + "message": "message5327" + }, + { + "key": "DDD", + "message": "message5328" + }, + { + "key": "BBB", + "message": "message5329" + }, + { + "key": "BBB", + "message": "message5330" + }, + { + "key": "", + "message": "message5331" + }, + { + "key": "", + "message": "message5332" + }, + { + "key": "BBB", + "message": "message5333" + }, + { + "key": "AAA", + "message": "message5334" + }, + { + "key": "", + "message": "message5335" + }, + { + "key": "AAA", + "message": "message5336" + }, + { + "key": "AAA", + "message": "message5337" + }, + { + "key": "", + "message": "message5338" + }, + { + "key": "CCC", + "message": "message5339" + }, + { + "key": "AAA", + "message": "message5340" + }, + { + "key": "BBB", + "message": "message5341" + }, + { + "key": "DDD", + "message": "message5342" + }, + { + "key": "", + "message": "message5343" + }, + { + "key": "CCC", + "message": "message5344" + }, + { + "key": "", + "message": "message5345" + }, + { + "key": "CCC", + "message": "message5346" + }, + { + "key": "CCC", + "message": "message5347" + }, + { + "key": "CCC", + "message": "message5348" + }, + { + "key": "", + "message": "message5349" + }, + { + "key": "BBB", + "message": "message5350" + }, + { + "key": "AAA", + "message": "message5351" + }, + { + "key": "CCC", + "message": "message5352" + }, + { + "key": "CCC", + "message": "message5353" + }, + { + "key": "CCC", + "message": "message5354" + }, + { + "key": "", + "message": "message5355" + }, + { + "key": "DDD", + "message": "message5356" + }, + { + "key": "AAA", + "message": "message5357" + }, + { + "key": "CCC", + "message": "message5358" + }, + { + "key": "DDD", + "message": "message5359" + }, + { + "key": "CCC", + "message": "message5360" + }, + { + "key": "CCC", + "message": "message5361" + }, + { + "key": "DDD", + "message": "message5362" + }, + { + "key": "AAA", + "message": "message5363" + }, + { + "key": "DDD", + "message": "message5364" + }, + { + "key": "DDD", + "message": "message5365" + }, + { + "key": "", + "message": "message5366" + }, + { + "key": "AAA", + "message": "message5367" + }, + { + "key": "", + "message": "message5368" + }, + { + "key": "", + "message": "message5369" + }, + { + "key": "DDD", + "message": "message5370" + }, + { + "key": "CCC", + "message": "message5371" + }, + { + "key": "", + "message": "message5372" + }, + { + "key": "AAA", + "message": "message5373" + }, + { + "key": "BBB", + "message": "message5374" + }, + { + "key": "", + "message": "message5375" + }, + { + "key": "CCC", + "message": "message5376" + }, + { + "key": "CCC", + "message": "message5377" + }, + { + "key": "BBB", + "message": "message5378" + }, + { + "key": "DDD", + "message": "message5379" + }, + { + "key": "BBB", + "message": "message5380" + }, + { + "key": "AAA", + "message": "message5381" + }, + { + "key": "DDD", + "message": "message5382" + }, + { + "key": "AAA", + "message": "message5383" + }, + { + "key": "BBB", + "message": "message5384" + }, + { + "key": "CCC", + "message": "message5385" + }, + { + "key": "AAA", + "message": "message5386" + }, + { + "key": "BBB", + "message": "message5387" + }, + { + "key": "", + "message": "message5388" + }, + { + "key": "DDD", + "message": "message5389" + }, + { + "key": "CCC", + "message": "message5390" + }, + { + "key": "CCC", + "message": "message5391" + }, + { + "key": "AAA", + "message": "message5392" + }, + { + "key": "BBB", + "message": "message5393" + }, + { + "key": "AAA", + "message": "message5394" + }, + { + "key": "DDD", + "message": "message5395" + }, + { + "key": "CCC", + "message": "message5396" + }, + { + "key": "CCC", + "message": "message5397" + }, + { + "key": "DDD", + "message": "message5398" + }, + { + "key": "CCC", + "message": "message5399" + }, + { + "key": "BBB", + "message": "message5400" + }, + { + "key": "CCC", + "message": "message5401" + }, + { + "key": "AAA", + "message": "message5402" + }, + { + "key": "", + "message": "message5403" + }, + { + "key": "CCC", + "message": "message5404" + }, + { + "key": "", + "message": "message5405" + }, + { + "key": "", + "message": "message5406" + }, + { + "key": "CCC", + "message": "message5407" + }, + { + "key": "AAA", + "message": "message5408" + }, + { + "key": "CCC", + "message": "message5409" + }, + { + "key": "BBB", + "message": "message5410" + }, + { + "key": "BBB", + "message": "message5411" + }, + { + "key": "DDD", + "message": "message5412" + }, + { + "key": "BBB", + "message": "message5413" + }, + { + "key": "AAA", + "message": "message5414" + }, + { + "key": "CCC", + "message": "message5415" + }, + { + "key": "CCC", + "message": "message5416" + }, + { + "key": "", + "message": "message5417" + }, + { + "key": "AAA", + "message": "message5418" + }, + { + "key": "AAA", + "message": "message5419" + }, + { + "key": "AAA", + "message": "message5420" + }, + { + "key": "DDD", + "message": "message5421" + }, + { + "key": "DDD", + "message": "message5422" + }, + { + "key": "AAA", + "message": "message5423" + }, + { + "key": "BBB", + "message": "message5424" + }, + { + "key": "DDD", + "message": "message5425" + }, + { + "key": "DDD", + "message": "message5426" + }, + { + "key": "", + "message": "message5427" + }, + { + "key": "AAA", + "message": "message5428" + }, + { + "key": "AAA", + "message": "message5429" + }, + { + "key": "BBB", + "message": "message5430" + }, + { + "key": "BBB", + "message": "message5431" + }, + { + "key": "AAA", + "message": "message5432" + }, + { + "key": "BBB", + "message": "message5433" + }, + { + "key": "AAA", + "message": "message5434" + }, + { + "key": "AAA", + "message": "message5435" + }, + { + "key": "BBB", + "message": "message5436" + }, + { + "key": "CCC", + "message": "message5437" + }, + { + "key": "AAA", + "message": "message5438" + }, + { + "key": "DDD", + "message": "message5439" + }, + { + "key": "DDD", + "message": "message5440" + }, + { + "key": "DDD", + "message": "message5441" + }, + { + "key": "AAA", + "message": "message5442" + }, + { + "key": "DDD", + "message": "message5443" + }, + { + "key": "AAA", + "message": "message5444" + }, + { + "key": "BBB", + "message": "message5445" + }, + { + "key": "DDD", + "message": "message5446" + }, + { + "key": "AAA", + "message": "message5447" + }, + { + "key": "BBB", + "message": "message5448" + }, + { + "key": "AAA", + "message": "message5449" + }, + { + "key": "BBB", + "message": "message5450" + }, + { + "key": "BBB", + "message": "message5451" + }, + { + "key": "DDD", + "message": "message5452" + }, + { + "key": "AAA", + "message": "message5453" + }, + { + "key": "BBB", + "message": "message5454" + }, + { + "key": "CCC", + "message": "message5455" + }, + { + "key": "", + "message": "message5456" + }, + { + "key": "CCC", + "message": "message5457" + }, + { + "key": "AAA", + "message": "message5458" + }, + { + "key": "", + "message": "message5459" + }, + { + "key": "CCC", + "message": "message5460" + }, + { + "key": "DDD", + "message": "message5461" + }, + { + "key": "CCC", + "message": "message5462" + }, + { + "key": "AAA", + "message": "message5463" + }, + { + "key": "DDD", + "message": "message5464" + }, + { + "key": "CCC", + "message": "message5465" + }, + { + "key": "", + "message": "message5466" + }, + { + "key": "BBB", + "message": "message5467" + }, + { + "key": "BBB", + "message": "message5468" + }, + { + "key": "DDD", + "message": "message5469" + }, + { + "key": "BBB", + "message": "message5470" + }, + { + "key": "CCC", + "message": "message5471" + }, + { + "key": "BBB", + "message": "message5472" + }, + { + "key": "", + "message": "message5473" + }, + { + "key": "DDD", + "message": "message5474" + }, + { + "key": "CCC", + "message": "message5475" + }, + { + "key": "CCC", + "message": "message5476" + }, + { + "key": "DDD", + "message": "message5477" + }, + { + "key": "AAA", + "message": "message5478" + }, + { + "key": "DDD", + "message": "message5479" + }, + { + "key": "DDD", + "message": "message5480" + }, + { + "key": "", + "message": "message5481" + }, + { + "key": "DDD", + "message": "message5482" + }, + { + "key": "DDD", + "message": "message5483" + }, + { + "key": "DDD", + "message": "message5484" + }, + { + "key": "CCC", + "message": "message5485" + }, + { + "key": "DDD", + "message": "message5486" + }, + { + "key": "BBB", + "message": "message5487" + }, + { + "key": "AAA", + "message": "message5488" + }, + { + "key": "BBB", + "message": "message5489" + }, + { + "key": "DDD", + "message": "message5490" + }, + { + "key": "", + "message": "message5491" + }, + { + "key": "AAA", + "message": "message5492" + }, + { + "key": "BBB", + "message": "message5493" + }, + { + "key": "DDD", + "message": "message5494" + }, + { + "key": "CCC", + "message": "message5495" + }, + { + "key": "BBB", + "message": "message5496" + }, + { + "key": "AAA", + "message": "message5497" + }, + { + "key": "", + "message": "message5498" + }, + { + "key": "DDD", + "message": "message5499" + }, + { + "key": "AAA", + "message": "message5500" + }, + { + "key": "CCC", + "message": "message5501" + }, + { + "key": "BBB", + "message": "message5502" + }, + { + "key": "", + "message": "message5503" + }, + { + "key": "DDD", + "message": "message5504" + }, + { + "key": "", + "message": "message5505" + }, + { + "key": "CCC", + "message": "message5506" + }, + { + "key": "BBB", + "message": "message5507" + }, + { + "key": "AAA", + "message": "message5508" + }, + { + "key": "", + "message": "message5509" + }, + { + "key": "CCC", + "message": "message5510" + }, + { + "key": "DDD", + "message": "message5511" + }, + { + "key": "CCC", + "message": "message5512" + }, + { + "key": "AAA", + "message": "message5513" + }, + { + "key": "", + "message": "message5514" + }, + { + "key": "CCC", + "message": "message5515" + }, + { + "key": "CCC", + "message": "message5516" + }, + { + "key": "BBB", + "message": "message5517" + }, + { + "key": "DDD", + "message": "message5518" + }, + { + "key": "DDD", + "message": "message5519" + }, + { + "key": "", + "message": "message5520" + }, + { + "key": "", + "message": "message5521" + }, + { + "key": "BBB", + "message": "message5522" + }, + { + "key": "AAA", + "message": "message5523" + }, + { + "key": "BBB", + "message": "message5524" + }, + { + "key": "", + "message": "message5525" + }, + { + "key": "DDD", + "message": "message5526" + }, + { + "key": "AAA", + "message": "message5527" + }, + { + "key": "DDD", + "message": "message5528" + }, + { + "key": "DDD", + "message": "message5529" + }, + { + "key": "AAA", + "message": "message5530" + }, + { + "key": "AAA", + "message": "message5531" + }, + { + "key": "", + "message": "message5532" + }, + { + "key": "AAA", + "message": "message5533" + }, + { + "key": "", + "message": "message5534" + }, + { + "key": "CCC", + "message": "message5535" + }, + { + "key": "DDD", + "message": "message5536" + }, + { + "key": "", + "message": "message5537" + }, + { + "key": "DDD", + "message": "message5538" + }, + { + "key": "", + "message": "message5539" + }, + { + "key": "AAA", + "message": "message5540" + }, + { + "key": "DDD", + "message": "message5541" + }, + { + "key": "BBB", + "message": "message5542" + }, + { + "key": "DDD", + "message": "message5543" + }, + { + "key": "DDD", + "message": "message5544" + }, + { + "key": "DDD", + "message": "message5545" + }, + { + "key": "CCC", + "message": "message5546" + }, + { + "key": "CCC", + "message": "message5547" + }, + { + "key": "DDD", + "message": "message5548" + }, + { + "key": "DDD", + "message": "message5549" + }, + { + "key": "DDD", + "message": "message5550" + }, + { + "key": "DDD", + "message": "message5551" + }, + { + "key": "BBB", + "message": "message5552" + }, + { + "key": "", + "message": "message5553" + }, + { + "key": "DDD", + "message": "message5554" + }, + { + "key": "DDD", + "message": "message5555" + }, + { + "key": "DDD", + "message": "message5556" + }, + { + "key": "", + "message": "message5557" + }, + { + "key": "AAA", + "message": "message5558" + }, + { + "key": "", + "message": "message5559" + }, + { + "key": "DDD", + "message": "message5560" + }, + { + "key": "CCC", + "message": "message5561" + }, + { + "key": "BBB", + "message": "message5562" + }, + { + "key": "AAA", + "message": "message5563" + }, + { + "key": "AAA", + "message": "message5564" + }, + { + "key": "CCC", + "message": "message5565" + }, + { + "key": "BBB", + "message": "message5566" + }, + { + "key": "", + "message": "message5567" + }, + { + "key": "AAA", + "message": "message5568" + }, + { + "key": "DDD", + "message": "message5569" + }, + { + "key": "", + "message": "message5570" + }, + { + "key": "", + "message": "message5571" + }, + { + "key": "BBB", + "message": "message5572" + }, + { + "key": "BBB", + "message": "message5573" + }, + { + "key": "BBB", + "message": "message5574" + }, + { + "key": "DDD", + "message": "message5575" + }, + { + "key": "", + "message": "message5576" + }, + { + "key": "DDD", + "message": "message5577" + }, + { + "key": "", + "message": "message5578" + }, + { + "key": "AAA", + "message": "message5579" + }, + { + "key": "", + "message": "message5580" + }, + { + "key": "BBB", + "message": "message5581" + }, + { + "key": "AAA", + "message": "message5582" + }, + { + "key": "CCC", + "message": "message5583" + }, + { + "key": "CCC", + "message": "message5584" + }, + { + "key": "BBB", + "message": "message5585" + }, + { + "key": "BBB", + "message": "message5586" + }, + { + "key": "CCC", + "message": "message5587" + }, + { + "key": "DDD", + "message": "message5588" + }, + { + "key": "BBB", + "message": "message5589" + }, + { + "key": "", + "message": "message5590" + }, + { + "key": "AAA", + "message": "message5591" + }, + { + "key": "DDD", + "message": "message5592" + }, + { + "key": "", + "message": "message5593" + }, + { + "key": "BBB", + "message": "message5594" + }, + { + "key": "BBB", + "message": "message5595" + }, + { + "key": "CCC", + "message": "message5596" + }, + { + "key": "BBB", + "message": "message5597" + }, + { + "key": "", + "message": "message5598" + }, + { + "key": "BBB", + "message": "message5599" + }, + { + "key": "", + "message": "message5600" + }, + { + "key": "BBB", + "message": "message5601" + }, + { + "key": "BBB", + "message": "message5602" + }, + { + "key": "BBB", + "message": "message5603" + }, + { + "key": "", + "message": "message5604" + }, + { + "key": "BBB", + "message": "message5605" + }, + { + "key": "", + "message": "message5606" + }, + { + "key": "AAA", + "message": "message5607" + }, + { + "key": "", + "message": "message5608" + }, + { + "key": "DDD", + "message": "message5609" + }, + { + "key": "BBB", + "message": "message5610" + }, + { + "key": "CCC", + "message": "message5611" + }, + { + "key": "DDD", + "message": "message5612" + }, + { + "key": "AAA", + "message": "message5613" + }, + { + "key": "AAA", + "message": "message5614" + }, + { + "key": "AAA", + "message": "message5615" + }, + { + "key": "DDD", + "message": "message5616" + }, + { + "key": "BBB", + "message": "message5617" + }, + { + "key": "DDD", + "message": "message5618" + }, + { + "key": "BBB", + "message": "message5619" + }, + { + "key": "", + "message": "message5620" + }, + { + "key": "CCC", + "message": "message5621" + }, + { + "key": "AAA", + "message": "message5622" + }, + { + "key": "AAA", + "message": "message5623" + }, + { + "key": "AAA", + "message": "message5624" + }, + { + "key": "DDD", + "message": "message5625" + }, + { + "key": "BBB", + "message": "message5626" + }, + { + "key": "CCC", + "message": "message5627" + }, + { + "key": "DDD", + "message": "message5628" + }, + { + "key": "", + "message": "message5629" + }, + { + "key": "DDD", + "message": "message5630" + }, + { + "key": "CCC", + "message": "message5631" + }, + { + "key": "BBB", + "message": "message5632" + }, + { + "key": "DDD", + "message": "message5633" + }, + { + "key": "DDD", + "message": "message5634" + }, + { + "key": "", + "message": "message5635" + }, + { + "key": "BBB", + "message": "message5636" + }, + { + "key": "DDD", + "message": "message5637" + }, + { + "key": "", + "message": "message5638" + }, + { + "key": "BBB", + "message": "message5639" + }, + { + "key": "CCC", + "message": "message5640" + }, + { + "key": "BBB", + "message": "message5641" + }, + { + "key": "CCC", + "message": "message5642" + }, + { + "key": "AAA", + "message": "message5643" + }, + { + "key": "", + "message": "message5644" + }, + { + "key": "", + "message": "message5645" + }, + { + "key": "DDD", + "message": "message5646" + }, + { + "key": "BBB", + "message": "message5647" + }, + { + "key": "BBB", + "message": "message5648" + }, + { + "key": "CCC", + "message": "message5649" + }, + { + "key": "", + "message": "message5650" + }, + { + "key": "DDD", + "message": "message5651" + }, + { + "key": "BBB", + "message": "message5652" + }, + { + "key": "", + "message": "message5653" + }, + { + "key": "DDD", + "message": "message5654" + }, + { + "key": "CCC", + "message": "message5655" + }, + { + "key": "DDD", + "message": "message5656" + }, + { + "key": "CCC", + "message": "message5657" + }, + { + "key": "CCC", + "message": "message5658" + }, + { + "key": "AAA", + "message": "message5659" + }, + { + "key": "", + "message": "message5660" + }, + { + "key": "DDD", + "message": "message5661" + }, + { + "key": "AAA", + "message": "message5662" + }, + { + "key": "AAA", + "message": "message5663" + }, + { + "key": "BBB", + "message": "message5664" + }, + { + "key": "AAA", + "message": "message5665" + }, + { + "key": "CCC", + "message": "message5666" + }, + { + "key": "CCC", + "message": "message5667" + }, + { + "key": "BBB", + "message": "message5668" + }, + { + "key": "AAA", + "message": "message5669" + }, + { + "key": "CCC", + "message": "message5670" + }, + { + "key": "DDD", + "message": "message5671" + }, + { + "key": "AAA", + "message": "message5672" + }, + { + "key": "DDD", + "message": "message5673" + }, + { + "key": "DDD", + "message": "message5674" + }, + { + "key": "", + "message": "message5675" + }, + { + "key": "CCC", + "message": "message5676" + }, + { + "key": "DDD", + "message": "message5677" + }, + { + "key": "CCC", + "message": "message5678" + }, + { + "key": "AAA", + "message": "message5679" + }, + { + "key": "DDD", + "message": "message5680" + }, + { + "key": "", + "message": "message5681" + }, + { + "key": "CCC", + "message": "message5682" + }, + { + "key": "DDD", + "message": "message5683" + }, + { + "key": "CCC", + "message": "message5684" + }, + { + "key": "AAA", + "message": "message5685" + }, + { + "key": "", + "message": "message5686" + }, + { + "key": "", + "message": "message5687" + }, + { + "key": "DDD", + "message": "message5688" + }, + { + "key": "AAA", + "message": "message5689" + }, + { + "key": "DDD", + "message": "message5690" + }, + { + "key": "CCC", + "message": "message5691" + }, + { + "key": "AAA", + "message": "message5692" + }, + { + "key": "CCC", + "message": "message5693" + }, + { + "key": "AAA", + "message": "message5694" + }, + { + "key": "DDD", + "message": "message5695" + }, + { + "key": "DDD", + "message": "message5696" + }, + { + "key": "", + "message": "message5697" + }, + { + "key": "DDD", + "message": "message5698" + }, + { + "key": "DDD", + "message": "message5699" + }, + { + "key": "", + "message": "message5700" + }, + { + "key": "AAA", + "message": "message5701" + }, + { + "key": "DDD", + "message": "message5702" + }, + { + "key": "DDD", + "message": "message5703" + }, + { + "key": "BBB", + "message": "message5704" + }, + { + "key": "BBB", + "message": "message5705" + }, + { + "key": "", + "message": "message5706" + }, + { + "key": "AAA", + "message": "message5707" + }, + { + "key": "", + "message": "message5708" + }, + { + "key": "BBB", + "message": "message5709" + }, + { + "key": "BBB", + "message": "message5710" + }, + { + "key": "AAA", + "message": "message5711" + }, + { + "key": "", + "message": "message5712" + }, + { + "key": "BBB", + "message": "message5713" + }, + { + "key": "AAA", + "message": "message5714" + }, + { + "key": "AAA", + "message": "message5715" + }, + { + "key": "BBB", + "message": "message5716" + }, + { + "key": "CCC", + "message": "message5717" + }, + { + "key": "CCC", + "message": "message5718" + }, + { + "key": "CCC", + "message": "message5719" + }, + { + "key": "", + "message": "message5720" + }, + { + "key": "DDD", + "message": "message5721" + }, + { + "key": "CCC", + "message": "message5722" + }, + { + "key": "DDD", + "message": "message5723" + }, + { + "key": "", + "message": "message5724" + }, + { + "key": "AAA", + "message": "message5725" + }, + { + "key": "DDD", + "message": "message5726" + }, + { + "key": "", + "message": "message5727" + }, + { + "key": "DDD", + "message": "message5728" + }, + { + "key": "", + "message": "message5729" + }, + { + "key": "CCC", + "message": "message5730" + }, + { + "key": "BBB", + "message": "message5731" + }, + { + "key": "BBB", + "message": "message5732" + }, + { + "key": "CCC", + "message": "message5733" + }, + { + "key": "DDD", + "message": "message5734" + }, + { + "key": "CCC", + "message": "message5735" + }, + { + "key": "", + "message": "message5736" + }, + { + "key": "", + "message": "message5737" + }, + { + "key": "CCC", + "message": "message5738" + }, + { + "key": "AAA", + "message": "message5739" + }, + { + "key": "CCC", + "message": "message5740" + }, + { + "key": "CCC", + "message": "message5741" + }, + { + "key": "", + "message": "message5742" + }, + { + "key": "AAA", + "message": "message5743" + }, + { + "key": "BBB", + "message": "message5744" + }, + { + "key": "BBB", + "message": "message5745" + }, + { + "key": "", + "message": "message5746" + }, + { + "key": "AAA", + "message": "message5747" + }, + { + "key": "AAA", + "message": "message5748" + }, + { + "key": "CCC", + "message": "message5749" + }, + { + "key": "BBB", + "message": "message5750" + }, + { + "key": "", + "message": "message5751" + }, + { + "key": "", + "message": "message5752" + }, + { + "key": "DDD", + "message": "message5753" + }, + { + "key": "", + "message": "message5754" + }, + { + "key": "BBB", + "message": "message5755" + }, + { + "key": "AAA", + "message": "message5756" + }, + { + "key": "AAA", + "message": "message5757" + }, + { + "key": "CCC", + "message": "message5758" + }, + { + "key": "AAA", + "message": "message5759" + }, + { + "key": "DDD", + "message": "message5760" + }, + { + "key": "AAA", + "message": "message5761" + }, + { + "key": "CCC", + "message": "message5762" + }, + { + "key": "", + "message": "message5763" + }, + { + "key": "CCC", + "message": "message5764" + }, + { + "key": "AAA", + "message": "message5765" + }, + { + "key": "BBB", + "message": "message5766" + }, + { + "key": "DDD", + "message": "message5767" + }, + { + "key": "BBB", + "message": "message5768" + }, + { + "key": "AAA", + "message": "message5769" + }, + { + "key": "", + "message": "message5770" + }, + { + "key": "BBB", + "message": "message5771" + }, + { + "key": "", + "message": "message5772" + }, + { + "key": "CCC", + "message": "message5773" + }, + { + "key": "BBB", + "message": "message5774" + }, + { + "key": "AAA", + "message": "message5775" + }, + { + "key": "AAA", + "message": "message5776" + }, + { + "key": "", + "message": "message5777" + }, + { + "key": "DDD", + "message": "message5778" + }, + { + "key": "", + "message": "message5779" + }, + { + "key": "", + "message": "message5780" + }, + { + "key": "", + "message": "message5781" + }, + { + "key": "BBB", + "message": "message5782" + }, + { + "key": "DDD", + "message": "message5783" + }, + { + "key": "", + "message": "message5784" + }, + { + "key": "DDD", + "message": "message5785" + }, + { + "key": "AAA", + "message": "message5786" + }, + { + "key": "CCC", + "message": "message5787" + }, + { + "key": "DDD", + "message": "message5788" + }, + { + "key": "DDD", + "message": "message5789" + }, + { + "key": "CCC", + "message": "message5790" + }, + { + "key": "", + "message": "message5791" + }, + { + "key": "", + "message": "message5792" + }, + { + "key": "DDD", + "message": "message5793" + }, + { + "key": "BBB", + "message": "message5794" + }, + { + "key": "BBB", + "message": "message5795" + }, + { + "key": "CCC", + "message": "message5796" + }, + { + "key": "CCC", + "message": "message5797" + }, + { + "key": "", + "message": "message5798" + }, + { + "key": "DDD", + "message": "message5799" + }, + { + "key": "", + "message": "message5800" + }, + { + "key": "", + "message": "message5801" + }, + { + "key": "AAA", + "message": "message5802" + }, + { + "key": "CCC", + "message": "message5803" + }, + { + "key": "BBB", + "message": "message5804" + }, + { + "key": "", + "message": "message5805" + }, + { + "key": "AAA", + "message": "message5806" + }, + { + "key": "BBB", + "message": "message5807" + }, + { + "key": "CCC", + "message": "message5808" + }, + { + "key": "BBB", + "message": "message5809" + }, + { + "key": "CCC", + "message": "message5810" + }, + { + "key": "", + "message": "message5811" + }, + { + "key": "", + "message": "message5812" + }, + { + "key": "AAA", + "message": "message5813" + }, + { + "key": "CCC", + "message": "message5814" + }, + { + "key": "DDD", + "message": "message5815" + }, + { + "key": "BBB", + "message": "message5816" + }, + { + "key": "", + "message": "message5817" + }, + { + "key": "DDD", + "message": "message5818" + }, + { + "key": "DDD", + "message": "message5819" + }, + { + "key": "BBB", + "message": "message5820" + }, + { + "key": "DDD", + "message": "message5821" + }, + { + "key": "AAA", + "message": "message5822" + }, + { + "key": "CCC", + "message": "message5823" + }, + { + "key": "BBB", + "message": "message5824" + }, + { + "key": "BBB", + "message": "message5825" + }, + { + "key": "", + "message": "message5826" + }, + { + "key": "BBB", + "message": "message5827" + }, + { + "key": "CCC", + "message": "message5828" + }, + { + "key": "CCC", + "message": "message5829" + }, + { + "key": "DDD", + "message": "message5830" + }, + { + "key": "BBB", + "message": "message5831" + }, + { + "key": "CCC", + "message": "message5832" + }, + { + "key": "AAA", + "message": "message5833" + }, + { + "key": "AAA", + "message": "message5834" + }, + { + "key": "BBB", + "message": "message5835" + }, + { + "key": "BBB", + "message": "message5836" + }, + { + "key": "", + "message": "message5837" + }, + { + "key": "AAA", + "message": "message5838" + }, + { + "key": "DDD", + "message": "message5839" + }, + { + "key": "AAA", + "message": "message5840" + }, + { + "key": "DDD", + "message": "message5841" + }, + { + "key": "", + "message": "message5842" + }, + { + "key": "CCC", + "message": "message5843" + }, + { + "key": "BBB", + "message": "message5844" + }, + { + "key": "BBB", + "message": "message5845" + }, + { + "key": "CCC", + "message": "message5846" + }, + { + "key": "CCC", + "message": "message5847" + }, + { + "key": "AAA", + "message": "message5848" + }, + { + "key": "BBB", + "message": "message5849" + }, + { + "key": "DDD", + "message": "message5850" + }, + { + "key": "", + "message": "message5851" + }, + { + "key": "CCC", + "message": "message5852" + }, + { + "key": "CCC", + "message": "message5853" + }, + { + "key": "AAA", + "message": "message5854" + }, + { + "key": "CCC", + "message": "message5855" + }, + { + "key": "AAA", + "message": "message5856" + }, + { + "key": "BBB", + "message": "message5857" + }, + { + "key": "", + "message": "message5858" + }, + { + "key": "DDD", + "message": "message5859" + }, + { + "key": "DDD", + "message": "message5860" + }, + { + "key": "", + "message": "message5861" + }, + { + "key": "BBB", + "message": "message5862" + }, + { + "key": "DDD", + "message": "message5863" + }, + { + "key": "BBB", + "message": "message5864" + }, + { + "key": "", + "message": "message5865" + }, + { + "key": "CCC", + "message": "message5866" + }, + { + "key": "", + "message": "message5867" + }, + { + "key": "", + "message": "message5868" + }, + { + "key": "AAA", + "message": "message5869" + }, + { + "key": "", + "message": "message5870" + }, + { + "key": "BBB", + "message": "message5871" + }, + { + "key": "AAA", + "message": "message5872" + }, + { + "key": "CCC", + "message": "message5873" + }, + { + "key": "AAA", + "message": "message5874" + }, + { + "key": "CCC", + "message": "message5875" + }, + { + "key": "AAA", + "message": "message5876" + }, + { + "key": "DDD", + "message": "message5877" + }, + { + "key": "AAA", + "message": "message5878" + }, + { + "key": "BBB", + "message": "message5879" + }, + { + "key": "CCC", + "message": "message5880" + }, + { + "key": "AAA", + "message": "message5881" + }, + { + "key": "AAA", + "message": "message5882" + }, + { + "key": "", + "message": "message5883" + }, + { + "key": "BBB", + "message": "message5884" + }, + { + "key": "DDD", + "message": "message5885" + }, + { + "key": "DDD", + "message": "message5886" + }, + { + "key": "", + "message": "message5887" + }, + { + "key": "AAA", + "message": "message5888" + }, + { + "key": "", + "message": "message5889" + }, + { + "key": "AAA", + "message": "message5890" + }, + { + "key": "CCC", + "message": "message5891" + }, + { + "key": "BBB", + "message": "message5892" + }, + { + "key": "", + "message": "message5893" + }, + { + "key": "AAA", + "message": "message5894" + }, + { + "key": "AAA", + "message": "message5895" + }, + { + "key": "BBB", + "message": "message5896" + }, + { + "key": "CCC", + "message": "message5897" + }, + { + "key": "CCC", + "message": "message5898" + }, + { + "key": "AAA", + "message": "message5899" + }, + { + "key": "", + "message": "message5900" + }, + { + "key": "", + "message": "message5901" + }, + { + "key": "CCC", + "message": "message5902" + }, + { + "key": "DDD", + "message": "message5903" + }, + { + "key": "CCC", + "message": "message5904" + }, + { + "key": "BBB", + "message": "message5905" + }, + { + "key": "DDD", + "message": "message5906" + }, + { + "key": "BBB", + "message": "message5907" + }, + { + "key": "BBB", + "message": "message5908" + }, + { + "key": "DDD", + "message": "message5909" + }, + { + "key": "DDD", + "message": "message5910" + }, + { + "key": "", + "message": "message5911" + }, + { + "key": "DDD", + "message": "message5912" + }, + { + "key": "AAA", + "message": "message5913" + }, + { + "key": "AAA", + "message": "message5914" + }, + { + "key": "AAA", + "message": "message5915" + }, + { + "key": "", + "message": "message5916" + }, + { + "key": "DDD", + "message": "message5917" + }, + { + "key": "DDD", + "message": "message5918" + }, + { + "key": "BBB", + "message": "message5919" + }, + { + "key": "BBB", + "message": "message5920" + }, + { + "key": "AAA", + "message": "message5921" + }, + { + "key": "", + "message": "message5922" + }, + { + "key": "CCC", + "message": "message5923" + }, + { + "key": "DDD", + "message": "message5924" + }, + { + "key": "BBB", + "message": "message5925" + }, + { + "key": "", + "message": "message5926" + }, + { + "key": "BBB", + "message": "message5927" + }, + { + "key": "", + "message": "message5928" + }, + { + "key": "BBB", + "message": "message5929" + }, + { + "key": "CCC", + "message": "message5930" + }, + { + "key": "CCC", + "message": "message5931" + }, + { + "key": "BBB", + "message": "message5932" + }, + { + "key": "AAA", + "message": "message5933" + }, + { + "key": "CCC", + "message": "message5934" + }, + { + "key": "BBB", + "message": "message5935" + }, + { + "key": "DDD", + "message": "message5936" + }, + { + "key": "AAA", + "message": "message5937" + }, + { + "key": "", + "message": "message5938" + }, + { + "key": "CCC", + "message": "message5939" + }, + { + "key": "AAA", + "message": "message5940" + }, + { + "key": "DDD", + "message": "message5941" + }, + { + "key": "BBB", + "message": "message5942" + }, + { + "key": "CCC", + "message": "message5943" + }, + { + "key": "BBB", + "message": "message5944" + }, + { + "key": "AAA", + "message": "message5945" + }, + { + "key": "CCC", + "message": "message5946" + }, + { + "key": "BBB", + "message": "message5947" + }, + { + "key": "", + "message": "message5948" + }, + { + "key": "", + "message": "message5949" + }, + { + "key": "DDD", + "message": "message5950" + }, + { + "key": "", + "message": "message5951" + }, + { + "key": "BBB", + "message": "message5952" + }, + { + "key": "DDD", + "message": "message5953" + }, + { + "key": "BBB", + "message": "message5954" + }, + { + "key": "DDD", + "message": "message5955" + }, + { + "key": "BBB", + "message": "message5956" + }, + { + "key": "DDD", + "message": "message5957" + }, + { + "key": "AAA", + "message": "message5958" + }, + { + "key": "CCC", + "message": "message5959" + }, + { + "key": "", + "message": "message5960" + }, + { + "key": "", + "message": "message5961" + }, + { + "key": "BBB", + "message": "message5962" + }, + { + "key": "BBB", + "message": "message5963" + }, + { + "key": "", + "message": "message5964" + }, + { + "key": "DDD", + "message": "message5965" + }, + { + "key": "AAA", + "message": "message5966" + }, + { + "key": "", + "message": "message5967" + }, + { + "key": "BBB", + "message": "message5968" + }, + { + "key": "AAA", + "message": "message5969" + }, + { + "key": "", + "message": "message5970" + }, + { + "key": "DDD", + "message": "message5971" + }, + { + "key": "", + "message": "message5972" + }, + { + "key": "DDD", + "message": "message5973" + }, + { + "key": "CCC", + "message": "message5974" + }, + { + "key": "DDD", + "message": "message5975" + }, + { + "key": "CCC", + "message": "message5976" + }, + { + "key": "AAA", + "message": "message5977" + }, + { + "key": "", + "message": "message5978" + }, + { + "key": "DDD", + "message": "message5979" + }, + { + "key": "AAA", + "message": "message5980" + }, + { + "key": "", + "message": "message5981" + }, + { + "key": "DDD", + "message": "message5982" + }, + { + "key": "DDD", + "message": "message5983" + }, + { + "key": "BBB", + "message": "message5984" + }, + { + "key": "DDD", + "message": "message5985" + }, + { + "key": "DDD", + "message": "message5986" + }, + { + "key": "CCC", + "message": "message5987" + }, + { + "key": "CCC", + "message": "message5988" + }, + { + "key": "CCC", + "message": "message5989" + }, + { + "key": "DDD", + "message": "message5990" + }, + { + "key": "DDD", + "message": "message5991" + }, + { + "key": "AAA", + "message": "message5992" + }, + { + "key": "BBB", + "message": "message5993" + }, + { + "key": "BBB", + "message": "message5994" + }, + { + "key": "AAA", + "message": "message5995" + }, + { + "key": "DDD", + "message": "message5996" + }, + { + "key": "AAA", + "message": "message5997" + }, + { + "key": "", + "message": "message5998" + }, + { + "key": "AAA", + "message": "message5999" + }, + { + "key": "CCC", + "message": "message6000" + }, + { + "key": "key0", + "message": "message6001" + }, + { + "key": "key1", + "message": "message6002" + }, + { + "key": "key2", + "message": "message6003" + }, + { + "key": "key3", + "message": "message6004" + }, + { + "key": "key4", + "message": "message6005" + }, + { + "key": "key5", + "message": "message6006" + }, + { + "key": "key6", + "message": "message6007" + }, + { + "key": "key7", + "message": "message6008" + }, + { + "key": "key8", + "message": "message6009" + }, + { + "key": "key9", + "message": "message6010" + }, + { + "key": "key10", + "message": "message6011" + }, + { + "key": "key11", + "message": "message6012" + }, + { + "key": "key12", + "message": "message6013" + }, + { + "key": "key13", + "message": "message6014" + }, + { + "key": "key14", + "message": "message6015" + }, + { + "key": "key15", + "message": "message6016" + }, + { + "key": "key16", + "message": "message6017" + }, + { + "key": "key17", + "message": "message6018" + }, + { + "key": "key18", + "message": "message6019" + }, + { + "key": "key19", + "message": "message6020" + }, + { + "key": "key20", + "message": "message6021" + }, + { + "key": "key21", + "message": "message6022" + }, + { + "key": "key22", + "message": "message6023" + }, + { + "key": "key23", + "message": "message6024" + }, + { + "key": "key24", + "message": "message6025" + }, + { + "key": "key25", + "message": "message6026" + }, + { + "key": "key26", + "message": "message6027" + }, + { + "key": "key27", + "message": "message6028" + }, + { + "key": "key28", + "message": "message6029" + }, + { + "key": "key29", + "message": "message6030" + }, + { + "key": "key30", + "message": "message6031" + }, + { + "key": "key31", + "message": "message6032" + }, + { + "key": "key32", + "message": "message6033" + }, + { + "key": "key33", + "message": "message6034" + }, + { + "key": "key34", + "message": "message6035" + }, + { + "key": "key35", + "message": "message6036" + }, + { + "key": "key36", + "message": "message6037" + }, + { + "key": "key37", + "message": "message6038" + }, + { + "key": "key38", + "message": "message6039" + }, + { + "key": "key39", + "message": "message6040" + }, + { + "key": "key40", + "message": "message6041" + }, + { + "key": "key41", + "message": "message6042" + }, + { + "key": "key42", + "message": "message6043" + }, + { + "key": "key43", + "message": "message6044" + }, + { + "key": "key44", + "message": "message6045" + }, + { + "key": "key45", + "message": "message6046" + }, + { + "key": "key46", + "message": "message6047" + }, + { + "key": "key47", + "message": "message6048" + }, + { + "key": "key48", + "message": "message6049" + }, + { + "key": "key49", + "message": "message6050" + }, + { + "key": "key50", + "message": "message6051" + }, + { + "key": "key51", + "message": "message6052" + }, + { + "key": "key52", + "message": "message6053" + }, + { + "key": "key53", + "message": "message6054" + }, + { + "key": "key54", + "message": "message6055" + }, + { + "key": "key55", + "message": "message6056" + }, + { + "key": "key56", + "message": "message6057" + }, + { + "key": "key57", + "message": "message6058" + }, + { + "key": "key58", + "message": "message6059" + }, + { + "key": "key59", + "message": "message6060" + }, + { + "key": "key60", + "message": "message6061" + }, + { + "key": "key61", + "message": "message6062" + }, + { + "key": "key62", + "message": "message6063" + }, + { + "key": "key63", + "message": "message6064" + }, + { + "key": "key64", + "message": "message6065" + }, + { + "key": "key65", + "message": "message6066" + }, + { + "key": "key66", + "message": "message6067" + }, + { + "key": "key67", + "message": "message6068" + }, + { + "key": "key68", + "message": "message6069" + }, + { + "key": "key69", + "message": "message6070" + }, + { + "key": "key70", + "message": "message6071" + }, + { + "key": "key71", + "message": "message6072" + }, + { + "key": "key72", + "message": "message6073" + }, + { + "key": "key73", + "message": "message6074" + }, + { + "key": "key74", + "message": "message6075" + }, + { + "key": "key75", + "message": "message6076" + }, + { + "key": "key76", + "message": "message6077" + }, + { + "key": "key77", + "message": "message6078" + }, + { + "key": "key78", + "message": "message6079" + }, + { + "key": "key79", + "message": "message6080" + }, + { + "key": "key80", + "message": "message6081" + }, + { + "key": "key81", + "message": "message6082" + }, + { + "key": "key82", + "message": "message6083" + }, + { + "key": "key83", + "message": "message6084" + }, + { + "key": "key84", + "message": "message6085" + }, + { + "key": "key85", + "message": "message6086" + }, + { + "key": "key86", + "message": "message6087" + }, + { + "key": "key87", + "message": "message6088" + }, + { + "key": "key88", + "message": "message6089" + }, + { + "key": "key89", + "message": "message6090" + }, + { + "key": "key90", + "message": "message6091" + }, + { + "key": "key91", + "message": "message6092" + }, + { + "key": "key92", + "message": "message6093" + }, + { + "key": "key93", + "message": "message6094" + }, + { + "key": "key94", + "message": "message6095" + }, + { + "key": "key95", + "message": "message6096" + }, + { + "key": "key96", + "message": "message6097" + }, + { + "key": "key97", + "message": "message6098" + }, + { + "key": "key98", + "message": "message6099" + }, + { + "key": "key99", + "message": "message6100" + }, + { + "key": "key100", + "message": "message6101" + }, + { + "key": "key101", + "message": "message6102" + }, + { + "key": "key102", + "message": "message6103" + }, + { + "key": "key103", + "message": "message6104" + }, + { + "key": "key104", + "message": "message6105" + }, + { + "key": "key105", + "message": "message6106" + }, + { + "key": "key106", + "message": "message6107" + }, + { + "key": "key107", + "message": "message6108" + }, + { + "key": "key108", + "message": "message6109" + }, + { + "key": "key109", + "message": "message6110" + }, + { + "key": "key110", + "message": "message6111" + }, + { + "key": "key111", + "message": "message6112" + }, + { + "key": "key112", + "message": "message6113" + }, + { + "key": "key113", + "message": "message6114" + }, + { + "key": "key114", + "message": "message6115" + }, + { + "key": "key115", + "message": "message6116" + }, + { + "key": "key116", + "message": "message6117" + }, + { + "key": "key117", + "message": "message6118" + }, + { + "key": "key118", + "message": "message6119" + }, + { + "key": "key119", + "message": "message6120" + }, + { + "key": "key120", + "message": "message6121" + }, + { + "key": "key121", + "message": "message6122" + }, + { + "key": "key122", + "message": "message6123" + }, + { + "key": "key123", + "message": "message6124" + }, + { + "key": "key124", + "message": "message6125" + }, + { + "key": "key125", + "message": "message6126" + }, + { + "key": "key126", + "message": "message6127" + }, + { + "key": "key127", + "message": "message6128" + }, + { + "key": "key128", + "message": "message6129" + }, + { + "key": "key129", + "message": "message6130" + }, + { + "key": "key130", + "message": "message6131" + }, + { + "key": "key131", + "message": "message6132" + }, + { + "key": "key132", + "message": "message6133" + }, + { + "key": "key133", + "message": "message6134" + }, + { + "key": "key134", + "message": "message6135" + }, + { + "key": "key135", + "message": "message6136" + }, + { + "key": "key136", + "message": "message6137" + }, + { + "key": "key137", + "message": "message6138" + }, + { + "key": "key138", + "message": "message6139" + }, + { + "key": "key139", + "message": "message6140" + }, + { + "key": "key140", + "message": "message6141" + }, + { + "key": "key141", + "message": "message6142" + }, + { + "key": "key142", + "message": "message6143" + }, + { + "key": "key143", + "message": "message6144" + }, + { + "key": "key144", + "message": "message6145" + }, + { + "key": "key145", + "message": "message6146" + }, + { + "key": "key146", + "message": "message6147" + }, + { + "key": "key147", + "message": "message6148" + }, + { + "key": "key148", + "message": "message6149" + }, + { + "key": "key149", + "message": "message6150" + }, + { + "key": "key150", + "message": "message6151" + }, + { + "key": "key151", + "message": "message6152" + }, + { + "key": "key152", + "message": "message6153" + }, + { + "key": "key153", + "message": "message6154" + }, + { + "key": "key154", + "message": "message6155" + }, + { + "key": "key155", + "message": "message6156" + }, + { + "key": "key156", + "message": "message6157" + }, + { + "key": "key157", + "message": "message6158" + }, + { + "key": "key158", + "message": "message6159" + }, + { + "key": "key159", + "message": "message6160" + }, + { + "key": "key160", + "message": "message6161" + }, + { + "key": "key161", + "message": "message6162" + }, + { + "key": "key162", + "message": "message6163" + }, + { + "key": "key163", + "message": "message6164" + }, + { + "key": "key164", + "message": "message6165" + }, + { + "key": "key165", + "message": "message6166" + }, + { + "key": "key166", + "message": "message6167" + }, + { + "key": "key167", + "message": "message6168" + }, + { + "key": "key168", + "message": "message6169" + }, + { + "key": "key169", + "message": "message6170" + }, + { + "key": "key170", + "message": "message6171" + }, + { + "key": "key171", + "message": "message6172" + }, + { + "key": "key172", + "message": "message6173" + }, + { + "key": "key173", + "message": "message6174" + }, + { + "key": "key174", + "message": "message6175" + }, + { + "key": "key175", + "message": "message6176" + }, + { + "key": "key176", + "message": "message6177" + }, + { + "key": "key177", + "message": "message6178" + }, + { + "key": "key178", + "message": "message6179" + }, + { + "key": "key179", + "message": "message6180" + }, + { + "key": "key180", + "message": "message6181" + }, + { + "key": "key181", + "message": "message6182" + }, + { + "key": "key182", + "message": "message6183" + }, + { + "key": "key183", + "message": "message6184" + }, + { + "key": "key184", + "message": "message6185" + }, + { + "key": "key185", + "message": "message6186" + }, + { + "key": "key186", + "message": "message6187" + }, + { + "key": "key187", + "message": "message6188" + }, + { + "key": "key188", + "message": "message6189" + }, + { + "key": "key189", + "message": "message6190" + }, + { + "key": "key190", + "message": "message6191" + }, + { + "key": "key191", + "message": "message6192" + }, + { + "key": "key192", + "message": "message6193" + }, + { + "key": "key193", + "message": "message6194" + }, + { + "key": "key194", + "message": "message6195" + }, + { + "key": "key195", + "message": "message6196" + }, + { + "key": "key196", + "message": "message6197" + }, + { + "key": "key197", + "message": "message6198" + }, + { + "key": "key198", + "message": "message6199" + }, + { + "key": "key199", + "message": "message6200" + }, + { + "key": "key200", + "message": "message6201" + }, + { + "key": "key201", + "message": "message6202" + }, + { + "key": "key202", + "message": "message6203" + }, + { + "key": "key203", + "message": "message6204" + }, + { + "key": "key204", + "message": "message6205" + }, + { + "key": "key205", + "message": "message6206" + }, + { + "key": "key206", + "message": "message6207" + }, + { + "key": "key207", + "message": "message6208" + }, + { + "key": "key208", + "message": "message6209" + }, + { + "key": "key209", + "message": "message6210" + }, + { + "key": "key210", + "message": "message6211" + }, + { + "key": "key211", + "message": "message6212" + }, + { + "key": "key212", + "message": "message6213" + }, + { + "key": "key213", + "message": "message6214" + }, + { + "key": "key214", + "message": "message6215" + }, + { + "key": "key215", + "message": "message6216" + }, + { + "key": "key216", + "message": "message6217" + }, + { + "key": "key217", + "message": "message6218" + }, + { + "key": "key218", + "message": "message6219" + }, + { + "key": "key219", + "message": "message6220" + }, + { + "key": "key220", + "message": "message6221" + }, + { + "key": "key221", + "message": "message6222" + }, + { + "key": "key222", + "message": "message6223" + }, + { + "key": "key223", + "message": "message6224" + }, + { + "key": "key224", + "message": "message6225" + }, + { + "key": "key225", + "message": "message6226" + }, + { + "key": "key226", + "message": "message6227" + }, + { + "key": "key227", + "message": "message6228" + }, + { + "key": "key228", + "message": "message6229" + }, + { + "key": "key229", + "message": "message6230" + }, + { + "key": "key230", + "message": "message6231" + }, + { + "key": "key231", + "message": "message6232" + }, + { + "key": "key232", + "message": "message6233" + }, + { + "key": "key233", + "message": "message6234" + }, + { + "key": "key234", + "message": "message6235" + }, + { + "key": "key235", + "message": "message6236" + }, + { + "key": "key236", + "message": "message6237" + }, + { + "key": "key237", + "message": "message6238" + }, + { + "key": "key238", + "message": "message6239" + }, + { + "key": "key239", + "message": "message6240" + }, + { + "key": "key240", + "message": "message6241" + }, + { + "key": "key241", + "message": "message6242" + }, + { + "key": "key242", + "message": "message6243" + }, + { + "key": "key243", + "message": "message6244" + }, + { + "key": "key244", + "message": "message6245" + }, + { + "key": "key245", + "message": "message6246" + }, + { + "key": "key246", + "message": "message6247" + }, + { + "key": "key247", + "message": "message6248" + }, + { + "key": "key248", + "message": "message6249" + }, + { + "key": "key249", + "message": "message6250" + }, + { + "key": "key250", + "message": "message6251" + }, + { + "key": "key251", + "message": "message6252" + }, + { + "key": "key252", + "message": "message6253" + }, + { + "key": "key253", + "message": "message6254" + }, + { + "key": "key254", + "message": "message6255" + }, + { + "key": "key255", + "message": "message6256" + }, + { + "key": "key256", + "message": "message6257" + }, + { + "key": "key257", + "message": "message6258" + }, + { + "key": "key258", + "message": "message6259" + }, + { + "key": "key259", + "message": "message6260" + }, + { + "key": "key260", + "message": "message6261" + }, + { + "key": "key261", + "message": "message6262" + }, + { + "key": "key262", + "message": "message6263" + }, + { + "key": "key263", + "message": "message6264" + }, + { + "key": "key264", + "message": "message6265" + }, + { + "key": "key265", + "message": "message6266" + }, + { + "key": "key266", + "message": "message6267" + }, + { + "key": "key267", + "message": "message6268" + }, + { + "key": "key268", + "message": "message6269" + }, + { + "key": "key269", + "message": "message6270" + }, + { + "key": "key270", + "message": "message6271" + }, + { + "key": "key271", + "message": "message6272" + }, + { + "key": "key272", + "message": "message6273" + }, + { + "key": "key273", + "message": "message6274" + }, + { + "key": "key274", + "message": "message6275" + }, + { + "key": "key275", + "message": "message6276" + }, + { + "key": "key276", + "message": "message6277" + }, + { + "key": "key277", + "message": "message6278" + }, + { + "key": "key278", + "message": "message6279" + }, + { + "key": "key279", + "message": "message6280" + }, + { + "key": "key280", + "message": "message6281" + }, + { + "key": "key281", + "message": "message6282" + }, + { + "key": "key282", + "message": "message6283" + }, + { + "key": "key283", + "message": "message6284" + }, + { + "key": "key284", + "message": "message6285" + }, + { + "key": "key285", + "message": "message6286" + }, + { + "key": "key286", + "message": "message6287" + }, + { + "key": "key287", + "message": "message6288" + }, + { + "key": "key288", + "message": "message6289" + }, + { + "key": "key289", + "message": "message6290" + }, + { + "key": "key290", + "message": "message6291" + }, + { + "key": "key291", + "message": "message6292" + }, + { + "key": "key292", + "message": "message6293" + }, + { + "key": "key293", + "message": "message6294" + }, + { + "key": "key294", + "message": "message6295" + }, + { + "key": "key295", + "message": "message6296" + }, + { + "key": "key296", + "message": "message6297" + }, + { + "key": "key297", + "message": "message6298" + }, + { + "key": "key298", + "message": "message6299" + }, + { + "key": "key299", + "message": "message6300" + }, + { + "key": "key300", + "message": "message6301" + }, + { + "key": "key301", + "message": "message6302" + }, + { + "key": "key302", + "message": "message6303" + }, + { + "key": "key303", + "message": "message6304" + }, + { + "key": "key304", + "message": "message6305" + }, + { + "key": "key305", + "message": "message6306" + }, + { + "key": "key306", + "message": "message6307" + }, + { + "key": "key307", + "message": "message6308" + }, + { + "key": "key308", + "message": "message6309" + }, + { + "key": "key309", + "message": "message6310" + }, + { + "key": "key310", + "message": "message6311" + }, + { + "key": "key311", + "message": "message6312" + }, + { + "key": "key312", + "message": "message6313" + }, + { + "key": "key313", + "message": "message6314" + }, + { + "key": "key314", + "message": "message6315" + }, + { + "key": "key315", + "message": "message6316" + }, + { + "key": "key316", + "message": "message6317" + }, + { + "key": "key317", + "message": "message6318" + }, + { + "key": "key318", + "message": "message6319" + }, + { + "key": "key319", + "message": "message6320" + }, + { + "key": "key320", + "message": "message6321" + }, + { + "key": "key321", + "message": "message6322" + }, + { + "key": "key322", + "message": "message6323" + }, + { + "key": "key323", + "message": "message6324" + }, + { + "key": "key324", + "message": "message6325" + }, + { + "key": "key325", + "message": "message6326" + }, + { + "key": "key326", + "message": "message6327" + }, + { + "key": "key327", + "message": "message6328" + }, + { + "key": "key328", + "message": "message6329" + }, + { + "key": "key329", + "message": "message6330" + }, + { + "key": "key330", + "message": "message6331" + }, + { + "key": "key331", + "message": "message6332" + }, + { + "key": "key332", + "message": "message6333" + }, + { + "key": "key333", + "message": "message6334" + }, + { + "key": "key334", + "message": "message6335" + }, + { + "key": "key335", + "message": "message6336" + }, + { + "key": "key336", + "message": "message6337" + }, + { + "key": "key337", + "message": "message6338" + }, + { + "key": "key338", + "message": "message6339" + }, + { + "key": "key339", + "message": "message6340" + }, + { + "key": "key340", + "message": "message6341" + }, + { + "key": "key341", + "message": "message6342" + }, + { + "key": "key342", + "message": "message6343" + }, + { + "key": "key343", + "message": "message6344" + }, + { + "key": "key344", + "message": "message6345" + }, + { + "key": "key345", + "message": "message6346" + }, + { + "key": "key346", + "message": "message6347" + }, + { + "key": "key347", + "message": "message6348" + }, + { + "key": "key348", + "message": "message6349" + }, + { + "key": "key349", + "message": "message6350" + }, + { + "key": "key350", + "message": "message6351" + }, + { + "key": "key351", + "message": "message6352" + }, + { + "key": "key352", + "message": "message6353" + }, + { + "key": "key353", + "message": "message6354" + }, + { + "key": "key354", + "message": "message6355" + }, + { + "key": "key355", + "message": "message6356" + }, + { + "key": "key356", + "message": "message6357" + }, + { + "key": "key357", + "message": "message6358" + }, + { + "key": "key358", + "message": "message6359" + }, + { + "key": "key359", + "message": "message6360" + }, + { + "key": "key360", + "message": "message6361" + }, + { + "key": "key361", + "message": "message6362" + }, + { + "key": "key362", + "message": "message6363" + }, + { + "key": "key363", + "message": "message6364" + }, + { + "key": "key364", + "message": "message6365" + }, + { + "key": "key365", + "message": "message6366" + }, + { + "key": "key366", + "message": "message6367" + }, + { + "key": "key367", + "message": "message6368" + }, + { + "key": "key368", + "message": "message6369" + }, + { + "key": "key369", + "message": "message6370" + }, + { + "key": "key370", + "message": "message6371" + }, + { + "key": "key371", + "message": "message6372" + }, + { + "key": "key372", + "message": "message6373" + }, + { + "key": "key373", + "message": "message6374" + }, + { + "key": "key374", + "message": "message6375" + }, + { + "key": "key375", + "message": "message6376" + }, + { + "key": "key376", + "message": "message6377" + }, + { + "key": "key377", + "message": "message6378" + }, + { + "key": "key378", + "message": "message6379" + }, + { + "key": "key379", + "message": "message6380" + }, + { + "key": "key380", + "message": "message6381" + }, + { + "key": "key381", + "message": "message6382" + }, + { + "key": "key382", + "message": "message6383" + }, + { + "key": "key383", + "message": "message6384" + }, + { + "key": "key384", + "message": "message6385" + }, + { + "key": "key385", + "message": "message6386" + }, + { + "key": "key386", + "message": "message6387" + }, + { + "key": "key387", + "message": "message6388" + }, + { + "key": "key388", + "message": "message6389" + }, + { + "key": "key389", + "message": "message6390" + }, + { + "key": "key390", + "message": "message6391" + }, + { + "key": "key391", + "message": "message6392" + }, + { + "key": "key392", + "message": "message6393" + }, + { + "key": "key393", + "message": "message6394" + }, + { + "key": "key394", + "message": "message6395" + }, + { + "key": "key395", + "message": "message6396" + }, + { + "key": "key396", + "message": "message6397" + }, + { + "key": "key397", + "message": "message6398" + }, + { + "key": "key398", + "message": "message6399" + }, + { + "key": "key399", + "message": "message6400" + }, + { + "key": "key400", + "message": "message6401" + }, + { + "key": "key401", + "message": "message6402" + }, + { + "key": "key402", + "message": "message6403" + }, + { + "key": "key403", + "message": "message6404" + }, + { + "key": "key404", + "message": "message6405" + }, + { + "key": "key405", + "message": "message6406" + }, + { + "key": "key406", + "message": "message6407" + }, + { + "key": "key407", + "message": "message6408" + }, + { + "key": "key408", + "message": "message6409" + }, + { + "key": "key409", + "message": "message6410" + }, + { + "key": "key410", + "message": "message6411" + }, + { + "key": "key411", + "message": "message6412" + }, + { + "key": "key412", + "message": "message6413" + }, + { + "key": "key413", + "message": "message6414" + }, + { + "key": "key414", + "message": "message6415" + }, + { + "key": "key415", + "message": "message6416" + }, + { + "key": "key416", + "message": "message6417" + }, + { + "key": "key417", + "message": "message6418" + }, + { + "key": "key418", + "message": "message6419" + }, + { + "key": "key419", + "message": "message6420" + }, + { + "key": "key420", + "message": "message6421" + }, + { + "key": "key421", + "message": "message6422" + }, + { + "key": "key422", + "message": "message6423" + }, + { + "key": "key423", + "message": "message6424" + }, + { + "key": "key424", + "message": "message6425" + }, + { + "key": "key425", + "message": "message6426" + }, + { + "key": "key426", + "message": "message6427" + }, + { + "key": "key427", + "message": "message6428" + }, + { + "key": "key428", + "message": "message6429" + }, + { + "key": "key429", + "message": "message6430" + }, + { + "key": "key430", + "message": "message6431" + }, + { + "key": "key431", + "message": "message6432" + }, + { + "key": "key432", + "message": "message6433" + }, + { + "key": "key433", + "message": "message6434" + }, + { + "key": "key434", + "message": "message6435" + }, + { + "key": "key435", + "message": "message6436" + }, + { + "key": "key436", + "message": "message6437" + }, + { + "key": "key437", + "message": "message6438" + }, + { + "key": "key438", + "message": "message6439" + }, + { + "key": "key439", + "message": "message6440" + }, + { + "key": "key440", + "message": "message6441" + }, + { + "key": "key441", + "message": "message6442" + }, + { + "key": "key442", + "message": "message6443" + }, + { + "key": "key443", + "message": "message6444" + }, + { + "key": "key444", + "message": "message6445" + }, + { + "key": "key445", + "message": "message6446" + }, + { + "key": "key446", + "message": "message6447" + }, + { + "key": "key447", + "message": "message6448" + }, + { + "key": "key448", + "message": "message6449" + }, + { + "key": "key449", + "message": "message6450" + }, + { + "key": "key450", + "message": "message6451" + }, + { + "key": "key451", + "message": "message6452" + }, + { + "key": "key452", + "message": "message6453" + }, + { + "key": "key453", + "message": "message6454" + }, + { + "key": "key454", + "message": "message6455" + }, + { + "key": "key455", + "message": "message6456" + }, + { + "key": "key456", + "message": "message6457" + }, + { + "key": "key457", + "message": "message6458" + }, + { + "key": "key458", + "message": "message6459" + }, + { + "key": "key459", + "message": "message6460" + }, + { + "key": "key460", + "message": "message6461" + }, + { + "key": "key461", + "message": "message6462" + }, + { + "key": "key462", + "message": "message6463" + }, + { + "key": "key463", + "message": "message6464" + }, + { + "key": "key464", + "message": "message6465" + }, + { + "key": "key465", + "message": "message6466" + }, + { + "key": "key466", + "message": "message6467" + }, + { + "key": "key467", + "message": "message6468" + }, + { + "key": "key468", + "message": "message6469" + }, + { + "key": "key469", + "message": "message6470" + }, + { + "key": "key470", + "message": "message6471" + }, + { + "key": "key471", + "message": "message6472" + }, + { + "key": "key472", + "message": "message6473" + }, + { + "key": "key473", + "message": "message6474" + }, + { + "key": "key474", + "message": "message6475" + }, + { + "key": "key475", + "message": "message6476" + }, + { + "key": "key476", + "message": "message6477" + }, + { + "key": "key477", + "message": "message6478" + }, + { + "key": "key478", + "message": "message6479" + }, + { + "key": "key479", + "message": "message6480" + }, + { + "key": "key480", + "message": "message6481" + }, + { + "key": "key481", + "message": "message6482" + }, + { + "key": "key482", + "message": "message6483" + }, + { + "key": "key483", + "message": "message6484" + }, + { + "key": "key484", + "message": "message6485" + }, + { + "key": "key485", + "message": "message6486" + }, + { + "key": "key486", + "message": "message6487" + }, + { + "key": "key487", + "message": "message6488" + }, + { + "key": "key488", + "message": "message6489" + }, + { + "key": "key489", + "message": "message6490" + }, + { + "key": "key490", + "message": "message6491" + }, + { + "key": "key491", + "message": "message6492" + }, + { + "key": "key492", + "message": "message6493" + }, + { + "key": "key493", + "message": "message6494" + }, + { + "key": "key494", + "message": "message6495" + }, + { + "key": "key495", + "message": "message6496" + }, + { + "key": "key496", + "message": "message6497" + }, + { + "key": "key497", + "message": "message6498" + }, + { + "key": "key498", + "message": "message6499" + }, + { + "key": "key499", + "message": "message6500" + }, + { + "key": "key500", + "message": "message6501" + }, + { + "key": "key501", + "message": "message6502" + }, + { + "key": "key502", + "message": "message6503" + }, + { + "key": "key503", + "message": "message6504" + }, + { + "key": "key504", + "message": "message6505" + }, + { + "key": "key505", + "message": "message6506" + }, + { + "key": "key506", + "message": "message6507" + }, + { + "key": "key507", + "message": "message6508" + }, + { + "key": "key508", + "message": "message6509" + }, + { + "key": "key509", + "message": "message6510" + }, + { + "key": "key510", + "message": "message6511" + }, + { + "key": "key511", + "message": "message6512" + }, + { + "key": "key512", + "message": "message6513" + }, + { + "key": "key513", + "message": "message6514" + }, + { + "key": "key514", + "message": "message6515" + }, + { + "key": "key515", + "message": "message6516" + }, + { + "key": "key516", + "message": "message6517" + }, + { + "key": "key517", + "message": "message6518" + }, + { + "key": "key518", + "message": "message6519" + }, + { + "key": "key519", + "message": "message6520" + }, + { + "key": "key520", + "message": "message6521" + }, + { + "key": "key521", + "message": "message6522" + }, + { + "key": "key522", + "message": "message6523" + }, + { + "key": "key523", + "message": "message6524" + }, + { + "key": "key524", + "message": "message6525" + }, + { + "key": "key525", + "message": "message6526" + }, + { + "key": "key526", + "message": "message6527" + }, + { + "key": "key527", + "message": "message6528" + }, + { + "key": "key528", + "message": "message6529" + }, + { + "key": "key529", + "message": "message6530" + }, + { + "key": "key530", + "message": "message6531" + }, + { + "key": "key531", + "message": "message6532" + }, + { + "key": "key532", + "message": "message6533" + }, + { + "key": "key533", + "message": "message6534" + }, + { + "key": "key534", + "message": "message6535" + }, + { + "key": "key535", + "message": "message6536" + }, + { + "key": "key536", + "message": "message6537" + }, + { + "key": "key537", + "message": "message6538" + }, + { + "key": "key538", + "message": "message6539" + }, + { + "key": "key539", + "message": "message6540" + }, + { + "key": "key540", + "message": "message6541" + }, + { + "key": "key541", + "message": "message6542" + }, + { + "key": "key542", + "message": "message6543" + }, + { + "key": "key543", + "message": "message6544" + }, + { + "key": "key544", + "message": "message6545" + }, + { + "key": "key545", + "message": "message6546" + }, + { + "key": "key546", + "message": "message6547" + }, + { + "key": "key547", + "message": "message6548" + }, + { + "key": "key548", + "message": "message6549" + }, + { + "key": "key549", + "message": "message6550" + }, + { + "key": "key550", + "message": "message6551" + }, + { + "key": "key551", + "message": "message6552" + }, + { + "key": "key552", + "message": "message6553" + }, + { + "key": "key553", + "message": "message6554" + }, + { + "key": "key554", + "message": "message6555" + }, + { + "key": "key555", + "message": "message6556" + }, + { + "key": "key556", + "message": "message6557" + }, + { + "key": "key557", + "message": "message6558" + }, + { + "key": "key558", + "message": "message6559" + }, + { + "key": "key559", + "message": "message6560" + }, + { + "key": "key560", + "message": "message6561" + }, + { + "key": "key561", + "message": "message6562" + }, + { + "key": "key562", + "message": "message6563" + }, + { + "key": "key563", + "message": "message6564" + }, + { + "key": "key564", + "message": "message6565" + }, + { + "key": "key565", + "message": "message6566" + }, + { + "key": "key566", + "message": "message6567" + }, + { + "key": "key567", + "message": "message6568" + }, + { + "key": "key568", + "message": "message6569" + }, + { + "key": "key569", + "message": "message6570" + }, + { + "key": "key570", + "message": "message6571" + }, + { + "key": "key571", + "message": "message6572" + }, + { + "key": "key572", + "message": "message6573" + }, + { + "key": "key573", + "message": "message6574" + }, + { + "key": "key574", + "message": "message6575" + }, + { + "key": "key575", + "message": "message6576" + }, + { + "key": "key576", + "message": "message6577" + }, + { + "key": "key577", + "message": "message6578" + }, + { + "key": "key578", + "message": "message6579" + }, + { + "key": "key579", + "message": "message6580" + }, + { + "key": "key580", + "message": "message6581" + }, + { + "key": "key581", + "message": "message6582" + }, + { + "key": "key582", + "message": "message6583" + }, + { + "key": "key583", + "message": "message6584" + }, + { + "key": "key584", + "message": "message6585" + }, + { + "key": "key585", + "message": "message6586" + }, + { + "key": "key586", + "message": "message6587" + }, + { + "key": "key587", + "message": "message6588" + }, + { + "key": "key588", + "message": "message6589" + }, + { + "key": "key589", + "message": "message6590" + }, + { + "key": "key590", + "message": "message6591" + }, + { + "key": "key591", + "message": "message6592" + }, + { + "key": "key592", + "message": "message6593" + }, + { + "key": "key593", + "message": "message6594" + }, + { + "key": "key594", + "message": "message6595" + }, + { + "key": "key595", + "message": "message6596" + }, + { + "key": "key596", + "message": "message6597" + }, + { + "key": "key597", + "message": "message6598" + }, + { + "key": "key598", + "message": "message6599" + }, + { + "key": "key599", + "message": "message6600" + }, + { + "key": "key600", + "message": "message6601" + }, + { + "key": "key601", + "message": "message6602" + }, + { + "key": "key602", + "message": "message6603" + }, + { + "key": "key603", + "message": "message6604" + }, + { + "key": "key604", + "message": "message6605" + }, + { + "key": "key605", + "message": "message6606" + }, + { + "key": "key606", + "message": "message6607" + }, + { + "key": "key607", + "message": "message6608" + }, + { + "key": "key608", + "message": "message6609" + }, + { + "key": "key609", + "message": "message6610" + }, + { + "key": "key610", + "message": "message6611" + }, + { + "key": "key611", + "message": "message6612" + }, + { + "key": "key612", + "message": "message6613" + }, + { + "key": "key613", + "message": "message6614" + }, + { + "key": "key614", + "message": "message6615" + }, + { + "key": "key615", + "message": "message6616" + }, + { + "key": "key616", + "message": "message6617" + }, + { + "key": "key617", + "message": "message6618" + }, + { + "key": "key618", + "message": "message6619" + }, + { + "key": "key619", + "message": "message6620" + }, + { + "key": "key620", + "message": "message6621" + }, + { + "key": "key621", + "message": "message6622" + }, + { + "key": "key622", + "message": "message6623" + }, + { + "key": "key623", + "message": "message6624" + }, + { + "key": "key624", + "message": "message6625" + }, + { + "key": "key625", + "message": "message6626" + }, + { + "key": "key626", + "message": "message6627" + }, + { + "key": "key627", + "message": "message6628" + }, + { + "key": "key628", + "message": "message6629" + }, + { + "key": "key629", + "message": "message6630" + }, + { + "key": "key630", + "message": "message6631" + }, + { + "key": "key631", + "message": "message6632" + }, + { + "key": "key632", + "message": "message6633" + }, + { + "key": "key633", + "message": "message6634" + }, + { + "key": "key634", + "message": "message6635" + }, + { + "key": "key635", + "message": "message6636" + }, + { + "key": "key636", + "message": "message6637" + }, + { + "key": "key637", + "message": "message6638" + }, + { + "key": "key638", + "message": "message6639" + }, + { + "key": "key639", + "message": "message6640" + }, + { + "key": "key640", + "message": "message6641" + }, + { + "key": "key641", + "message": "message6642" + }, + { + "key": "key642", + "message": "message6643" + }, + { + "key": "key643", + "message": "message6644" + }, + { + "key": "key644", + "message": "message6645" + }, + { + "key": "key645", + "message": "message6646" + }, + { + "key": "key646", + "message": "message6647" + }, + { + "key": "key647", + "message": "message6648" + }, + { + "key": "key648", + "message": "message6649" + }, + { + "key": "key649", + "message": "message6650" + }, + { + "key": "key650", + "message": "message6651" + }, + { + "key": "key651", + "message": "message6652" + }, + { + "key": "key652", + "message": "message6653" + }, + { + "key": "key653", + "message": "message6654" + }, + { + "key": "key654", + "message": "message6655" + }, + { + "key": "key655", + "message": "message6656" + }, + { + "key": "key656", + "message": "message6657" + }, + { + "key": "key657", + "message": "message6658" + }, + { + "key": "key658", + "message": "message6659" + }, + { + "key": "key659", + "message": "message6660" + }, + { + "key": "key660", + "message": "message6661" + }, + { + "key": "key661", + "message": "message6662" + }, + { + "key": "key662", + "message": "message6663" + }, + { + "key": "key663", + "message": "message6664" + }, + { + "key": "key664", + "message": "message6665" + }, + { + "key": "key665", + "message": "message6666" + }, + { + "key": "key666", + "message": "message6667" + }, + { + "key": "key667", + "message": "message6668" + }, + { + "key": "key668", + "message": "message6669" + }, + { + "key": "key669", + "message": "message6670" + }, + { + "key": "key670", + "message": "message6671" + }, + { + "key": "key671", + "message": "message6672" + }, + { + "key": "key672", + "message": "message6673" + }, + { + "key": "key673", + "message": "message6674" + }, + { + "key": "key674", + "message": "message6675" + }, + { + "key": "key675", + "message": "message6676" + }, + { + "key": "key676", + "message": "message6677" + }, + { + "key": "key677", + "message": "message6678" + }, + { + "key": "key678", + "message": "message6679" + }, + { + "key": "key679", + "message": "message6680" + }, + { + "key": "key680", + "message": "message6681" + }, + { + "key": "key681", + "message": "message6682" + }, + { + "key": "key682", + "message": "message6683" + }, + { + "key": "key683", + "message": "message6684" + }, + { + "key": "key684", + "message": "message6685" + }, + { + "key": "key685", + "message": "message6686" + }, + { + "key": "key686", + "message": "message6687" + }, + { + "key": "key687", + "message": "message6688" + }, + { + "key": "key688", + "message": "message6689" + }, + { + "key": "key689", + "message": "message6690" + }, + { + "key": "key690", + "message": "message6691" + }, + { + "key": "key691", + "message": "message6692" + }, + { + "key": "key692", + "message": "message6693" + }, + { + "key": "key693", + "message": "message6694" + }, + { + "key": "key694", + "message": "message6695" + }, + { + "key": "key695", + "message": "message6696" + }, + { + "key": "key696", + "message": "message6697" + }, + { + "key": "key697", + "message": "message6698" + }, + { + "key": "key698", + "message": "message6699" + }, + { + "key": "key699", + "message": "message6700" + }, + { + "key": "key700", + "message": "message6701" + }, + { + "key": "key701", + "message": "message6702" + }, + { + "key": "key702", + "message": "message6703" + }, + { + "key": "key703", + "message": "message6704" + }, + { + "key": "key704", + "message": "message6705" + }, + { + "key": "key705", + "message": "message6706" + }, + { + "key": "key706", + "message": "message6707" + }, + { + "key": "key707", + "message": "message6708" + }, + { + "key": "key708", + "message": "message6709" + }, + { + "key": "key709", + "message": "message6710" + }, + { + "key": "key710", + "message": "message6711" + }, + { + "key": "key711", + "message": "message6712" + }, + { + "key": "key712", + "message": "message6713" + }, + { + "key": "key713", + "message": "message6714" + }, + { + "key": "key714", + "message": "message6715" + }, + { + "key": "key715", + "message": "message6716" + }, + { + "key": "key716", + "message": "message6717" + }, + { + "key": "key717", + "message": "message6718" + }, + { + "key": "key718", + "message": "message6719" + }, + { + "key": "key719", + "message": "message6720" + }, + { + "key": "key720", + "message": "message6721" + }, + { + "key": "key721", + "message": "message6722" + }, + { + "key": "key722", + "message": "message6723" + }, + { + "key": "key723", + "message": "message6724" + }, + { + "key": "key724", + "message": "message6725" + }, + { + "key": "key725", + "message": "message6726" + }, + { + "key": "key726", + "message": "message6727" + }, + { + "key": "key727", + "message": "message6728" + }, + { + "key": "key728", + "message": "message6729" + }, + { + "key": "key729", + "message": "message6730" + }, + { + "key": "key730", + "message": "message6731" + }, + { + "key": "key731", + "message": "message6732" + }, + { + "key": "key732", + "message": "message6733" + }, + { + "key": "key733", + "message": "message6734" + }, + { + "key": "key734", + "message": "message6735" + }, + { + "key": "key735", + "message": "message6736" + }, + { + "key": "key736", + "message": "message6737" + }, + { + "key": "key737", + "message": "message6738" + }, + { + "key": "key738", + "message": "message6739" + }, + { + "key": "key739", + "message": "message6740" + }, + { + "key": "key740", + "message": "message6741" + }, + { + "key": "key741", + "message": "message6742" + }, + { + "key": "key742", + "message": "message6743" + }, + { + "key": "key743", + "message": "message6744" + }, + { + "key": "key744", + "message": "message6745" + }, + { + "key": "key745", + "message": "message6746" + }, + { + "key": "key746", + "message": "message6747" + }, + { + "key": "key747", + "message": "message6748" + }, + { + "key": "key748", + "message": "message6749" + }, + { + "key": "key749", + "message": "message6750" + }, + { + "key": "key750", + "message": "message6751" + }, + { + "key": "key751", + "message": "message6752" + }, + { + "key": "key752", + "message": "message6753" + }, + { + "key": "key753", + "message": "message6754" + }, + { + "key": "key754", + "message": "message6755" + }, + { + "key": "key755", + "message": "message6756" + }, + { + "key": "key756", + "message": "message6757" + }, + { + "key": "key757", + "message": "message6758" + }, + { + "key": "key758", + "message": "message6759" + }, + { + "key": "key759", + "message": "message6760" + }, + { + "key": "key760", + "message": "message6761" + }, + { + "key": "key761", + "message": "message6762" + }, + { + "key": "key762", + "message": "message6763" + }, + { + "key": "key763", + "message": "message6764" + }, + { + "key": "key764", + "message": "message6765" + }, + { + "key": "key765", + "message": "message6766" + }, + { + "key": "key766", + "message": "message6767" + }, + { + "key": "key767", + "message": "message6768" + }, + { + "key": "key768", + "message": "message6769" + }, + { + "key": "key769", + "message": "message6770" + }, + { + "key": "key770", + "message": "message6771" + }, + { + "key": "key771", + "message": "message6772" + }, + { + "key": "key772", + "message": "message6773" + }, + { + "key": "key773", + "message": "message6774" + }, + { + "key": "key774", + "message": "message6775" + }, + { + "key": "key775", + "message": "message6776" + }, + { + "key": "key776", + "message": "message6777" + }, + { + "key": "key777", + "message": "message6778" + }, + { + "key": "key778", + "message": "message6779" + }, + { + "key": "key779", + "message": "message6780" + }, + { + "key": "key780", + "message": "message6781" + }, + { + "key": "key781", + "message": "message6782" + }, + { + "key": "key782", + "message": "message6783" + }, + { + "key": "key783", + "message": "message6784" + }, + { + "key": "key784", + "message": "message6785" + }, + { + "key": "key785", + "message": "message6786" + }, + { + "key": "key786", + "message": "message6787" + }, + { + "key": "key787", + "message": "message6788" + }, + { + "key": "key788", + "message": "message6789" + }, + { + "key": "key789", + "message": "message6790" + }, + { + "key": "key790", + "message": "message6791" + }, + { + "key": "key791", + "message": "message6792" + }, + { + "key": "key792", + "message": "message6793" + }, + { + "key": "key793", + "message": "message6794" + }, + { + "key": "key794", + "message": "message6795" + }, + { + "key": "key795", + "message": "message6796" + }, + { + "key": "key796", + "message": "message6797" + }, + { + "key": "key797", + "message": "message6798" + }, + { + "key": "key798", + "message": "message6799" + }, + { + "key": "key799", + "message": "message6800" + }, + { + "key": "key800", + "message": "message6801" + }, + { + "key": "key801", + "message": "message6802" + }, + { + "key": "key802", + "message": "message6803" + }, + { + "key": "key803", + "message": "message6804" + }, + { + "key": "key804", + "message": "message6805" + }, + { + "key": "key805", + "message": "message6806" + }, + { + "key": "key806", + "message": "message6807" + }, + { + "key": "key807", + "message": "message6808" + }, + { + "key": "key808", + "message": "message6809" + }, + { + "key": "key809", + "message": "message6810" + }, + { + "key": "key810", + "message": "message6811" + }, + { + "key": "key811", + "message": "message6812" + }, + { + "key": "key812", + "message": "message6813" + }, + { + "key": "key813", + "message": "message6814" + }, + { + "key": "key814", + "message": "message6815" + }, + { + "key": "key815", + "message": "message6816" + }, + { + "key": "key816", + "message": "message6817" + }, + { + "key": "key817", + "message": "message6818" + }, + { + "key": "key818", + "message": "message6819" + }, + { + "key": "key819", + "message": "message6820" + }, + { + "key": "key820", + "message": "message6821" + }, + { + "key": "key821", + "message": "message6822" + }, + { + "key": "key822", + "message": "message6823" + }, + { + "key": "key823", + "message": "message6824" + }, + { + "key": "key824", + "message": "message6825" + }, + { + "key": "key825", + "message": "message6826" + }, + { + "key": "key826", + "message": "message6827" + }, + { + "key": "key827", + "message": "message6828" + }, + { + "key": "key828", + "message": "message6829" + }, + { + "key": "key829", + "message": "message6830" + }, + { + "key": "key830", + "message": "message6831" + }, + { + "key": "key831", + "message": "message6832" + }, + { + "key": "key832", + "message": "message6833" + }, + { + "key": "key833", + "message": "message6834" + }, + { + "key": "key834", + "message": "message6835" + }, + { + "key": "key835", + "message": "message6836" + }, + { + "key": "key836", + "message": "message6837" + }, + { + "key": "key837", + "message": "message6838" + }, + { + "key": "key838", + "message": "message6839" + }, + { + "key": "key839", + "message": "message6840" + }, + { + "key": "key840", + "message": "message6841" + }, + { + "key": "key841", + "message": "message6842" + }, + { + "key": "key842", + "message": "message6843" + }, + { + "key": "key843", + "message": "message6844" + }, + { + "key": "key844", + "message": "message6845" + }, + { + "key": "key845", + "message": "message6846" + }, + { + "key": "key846", + "message": "message6847" + }, + { + "key": "key847", + "message": "message6848" + }, + { + "key": "key848", + "message": "message6849" + }, + { + "key": "key849", + "message": "message6850" + }, + { + "key": "key850", + "message": "message6851" + }, + { + "key": "key851", + "message": "message6852" + }, + { + "key": "key852", + "message": "message6853" + }, + { + "key": "key853", + "message": "message6854" + }, + { + "key": "key854", + "message": "message6855" + }, + { + "key": "key855", + "message": "message6856" + }, + { + "key": "key856", + "message": "message6857" + }, + { + "key": "key857", + "message": "message6858" + }, + { + "key": "key858", + "message": "message6859" + }, + { + "key": "key859", + "message": "message6860" + }, + { + "key": "key860", + "message": "message6861" + }, + { + "key": "key861", + "message": "message6862" + }, + { + "key": "key862", + "message": "message6863" + }, + { + "key": "key863", + "message": "message6864" + }, + { + "key": "key864", + "message": "message6865" + }, + { + "key": "key865", + "message": "message6866" + }, + { + "key": "key866", + "message": "message6867" + }, + { + "key": "key867", + "message": "message6868" + }, + { + "key": "key868", + "message": "message6869" + }, + { + "key": "key869", + "message": "message6870" + }, + { + "key": "key870", + "message": "message6871" + }, + { + "key": "key871", + "message": "message6872" + }, + { + "key": "key872", + "message": "message6873" + }, + { + "key": "key873", + "message": "message6874" + }, + { + "key": "key874", + "message": "message6875" + }, + { + "key": "key875", + "message": "message6876" + }, + { + "key": "key876", + "message": "message6877" + }, + { + "key": "key877", + "message": "message6878" + }, + { + "key": "key878", + "message": "message6879" + }, + { + "key": "key879", + "message": "message6880" + }, + { + "key": "key880", + "message": "message6881" + }, + { + "key": "key881", + "message": "message6882" + }, + { + "key": "key882", + "message": "message6883" + }, + { + "key": "key883", + "message": "message6884" + }, + { + "key": "key884", + "message": "message6885" + }, + { + "key": "key885", + "message": "message6886" + }, + { + "key": "key886", + "message": "message6887" + }, + { + "key": "key887", + "message": "message6888" + }, + { + "key": "key888", + "message": "message6889" + }, + { + "key": "key889", + "message": "message6890" + }, + { + "key": "key890", + "message": "message6891" + }, + { + "key": "key891", + "message": "message6892" + }, + { + "key": "key892", + "message": "message6893" + }, + { + "key": "key893", + "message": "message6894" + }, + { + "key": "key894", + "message": "message6895" + }, + { + "key": "key895", + "message": "message6896" + }, + { + "key": "key896", + "message": "message6897" + }, + { + "key": "key897", + "message": "message6898" + }, + { + "key": "key898", + "message": "message6899" + }, + { + "key": "key899", + "message": "message6900" + }, + { + "key": "key900", + "message": "message6901" + }, + { + "key": "key901", + "message": "message6902" + }, + { + "key": "key902", + "message": "message6903" + }, + { + "key": "key903", + "message": "message6904" + }, + { + "key": "key904", + "message": "message6905" + }, + { + "key": "key905", + "message": "message6906" + }, + { + "key": "key906", + "message": "message6907" + }, + { + "key": "key907", + "message": "message6908" + }, + { + "key": "key908", + "message": "message6909" + }, + { + "key": "key909", + "message": "message6910" + }, + { + "key": "key910", + "message": "message6911" + }, + { + "key": "key911", + "message": "message6912" + }, + { + "key": "key912", + "message": "message6913" + }, + { + "key": "key913", + "message": "message6914" + }, + { + "key": "key914", + "message": "message6915" + }, + { + "key": "key915", + "message": "message6916" + }, + { + "key": "key916", + "message": "message6917" + }, + { + "key": "key917", + "message": "message6918" + }, + { + "key": "key918", + "message": "message6919" + }, + { + "key": "key919", + "message": "message6920" + }, + { + "key": "key920", + "message": "message6921" + }, + { + "key": "key921", + "message": "message6922" + }, + { + "key": "key922", + "message": "message6923" + }, + { + "key": "key923", + "message": "message6924" + }, + { + "key": "key924", + "message": "message6925" + }, + { + "key": "key925", + "message": "message6926" + }, + { + "key": "key926", + "message": "message6927" + }, + { + "key": "key927", + "message": "message6928" + }, + { + "key": "key928", + "message": "message6929" + }, + { + "key": "key929", + "message": "message6930" + }, + { + "key": "key930", + "message": "message6931" + }, + { + "key": "key931", + "message": "message6932" + }, + { + "key": "key932", + "message": "message6933" + }, + { + "key": "key933", + "message": "message6934" + }, + { + "key": "key934", + "message": "message6935" + }, + { + "key": "key935", + "message": "message6936" + }, + { + "key": "key936", + "message": "message6937" + }, + { + "key": "key937", + "message": "message6938" + }, + { + "key": "key938", + "message": "message6939" + }, + { + "key": "key939", + "message": "message6940" + }, + { + "key": "key940", + "message": "message6941" + }, + { + "key": "key941", + "message": "message6942" + }, + { + "key": "key942", + "message": "message6943" + }, + { + "key": "key943", + "message": "message6944" + }, + { + "key": "key944", + "message": "message6945" + }, + { + "key": "key945", + "message": "message6946" + }, + { + "key": "key946", + "message": "message6947" + }, + { + "key": "key947", + "message": "message6948" + }, + { + "key": "key948", + "message": "message6949" + }, + { + "key": "key949", + "message": "message6950" + }, + { + "key": "key950", + "message": "message6951" + }, + { + "key": "key951", + "message": "message6952" + }, + { + "key": "key952", + "message": "message6953" + }, + { + "key": "key953", + "message": "message6954" + }, + { + "key": "key954", + "message": "message6955" + }, + { + "key": "key955", + "message": "message6956" + }, + { + "key": "key956", + "message": "message6957" + }, + { + "key": "key957", + "message": "message6958" + }, + { + "key": "key958", + "message": "message6959" + }, + { + "key": "key959", + "message": "message6960" + }, + { + "key": "key960", + "message": "message6961" + }, + { + "key": "key961", + "message": "message6962" + }, + { + "key": "key962", + "message": "message6963" + }, + { + "key": "key963", + "message": "message6964" + }, + { + "key": "key964", + "message": "message6965" + }, + { + "key": "key965", + "message": "message6966" + }, + { + "key": "key966", + "message": "message6967" + }, + { + "key": "key967", + "message": "message6968" + }, + { + "key": "key968", + "message": "message6969" + }, + { + "key": "key969", + "message": "message6970" + }, + { + "key": "key970", + "message": "message6971" + }, + { + "key": "key971", + "message": "message6972" + }, + { + "key": "key972", + "message": "message6973" + }, + { + "key": "key973", + "message": "message6974" + }, + { + "key": "key974", + "message": "message6975" + }, + { + "key": "key975", + "message": "message6976" + }, + { + "key": "key976", + "message": "message6977" + }, + { + "key": "key977", + "message": "message6978" + }, + { + "key": "key978", + "message": "message6979" + }, + { + "key": "key979", + "message": "message6980" + }, + { + "key": "key980", + "message": "message6981" + }, + { + "key": "key981", + "message": "message6982" + }, + { + "key": "key982", + "message": "message6983" + }, + { + "key": "key983", + "message": "message6984" + }, + { + "key": "key984", + "message": "message6985" + }, + { + "key": "key985", + "message": "message6986" + }, + { + "key": "key986", + "message": "message6987" + }, + { + "key": "key987", + "message": "message6988" + }, + { + "key": "key988", + "message": "message6989" + }, + { + "key": "key989", + "message": "message6990" + }, + { + "key": "key990", + "message": "message6991" + }, + { + "key": "key991", + "message": "message6992" + }, + { + "key": "key992", + "message": "message6993" + }, + { + "key": "key993", + "message": "message6994" + }, + { + "key": "key994", + "message": "message6995" + }, + { + "key": "key995", + "message": "message6996" + }, + { + "key": "key996", + "message": "message6997" + }, + { + "key": "key997", + "message": "message6998" + }, + { + "key": "key998", + "message": "message6999" + }, + { + "key": "key999", + "message": "message7000" + }, + { + "key": "key1000", + "message": "message7001" + }, + { + "key": "key1001", + "message": "message7002" + }, + { + "key": "key1002", + "message": "message7003" + }, + { + "key": "key1003", + "message": "message7004" + }, + { + "key": "key1004", + "message": "message7005" + }, + { + "key": "key1005", + "message": "message7006" + }, + { + "key": "key1006", + "message": "message7007" + }, + { + "key": "key1007", + "message": "message7008" + }, + { + "key": "key1008", + "message": "message7009" + }, + { + "key": "key1009", + "message": "message7010" + }, + { + "key": "key1010", + "message": "message7011" + }, + { + "key": "key1011", + "message": "message7012" + }, + { + "key": "key1012", + "message": "message7013" + }, + { + "key": "key1013", + "message": "message7014" + }, + { + "key": "key1014", + "message": "message7015" + }, + { + "key": "key1015", + "message": "message7016" + }, + { + "key": "key1016", + "message": "message7017" + }, + { + "key": "key1017", + "message": "message7018" + }, + { + "key": "key1018", + "message": "message7019" + }, + { + "key": "key1019", + "message": "message7020" + }, + { + "key": "key1020", + "message": "message7021" + }, + { + "key": "key1021", + "message": "message7022" + }, + { + "key": "key1022", + "message": "message7023" + }, + { + "key": "key1023", + "message": "message7024" + }, + { + "key": "key1024", + "message": "message7025" + }, + { + "key": "key1025", + "message": "message7026" + }, + { + "key": "key1026", + "message": "message7027" + }, + { + "key": "key1027", + "message": "message7028" + }, + { + "key": "key1028", + "message": "message7029" + }, + { + "key": "key1029", + "message": "message7030" + }, + { + "key": "key1030", + "message": "message7031" + }, + { + "key": "key1031", + "message": "message7032" + }, + { + "key": "key1032", + "message": "message7033" + }, + { + "key": "key1033", + "message": "message7034" + }, + { + "key": "key1034", + "message": "message7035" + }, + { + "key": "key1035", + "message": "message7036" + }, + { + "key": "key1036", + "message": "message7037" + }, + { + "key": "key1037", + "message": "message7038" + }, + { + "key": "key1038", + "message": "message7039" + }, + { + "key": "key1039", + "message": "message7040" + }, + { + "key": "key1040", + "message": "message7041" + }, + { + "key": "key1041", + "message": "message7042" + }, + { + "key": "key1042", + "message": "message7043" + }, + { + "key": "key1043", + "message": "message7044" + }, + { + "key": "key1044", + "message": "message7045" + }, + { + "key": "key1045", + "message": "message7046" + }, + { + "key": "key1046", + "message": "message7047" + }, + { + "key": "key1047", + "message": "message7048" + }, + { + "key": "key1048", + "message": "message7049" + }, + { + "key": "key1049", + "message": "message7050" + }, + { + "key": "key1050", + "message": "message7051" + }, + { + "key": "key1051", + "message": "message7052" + }, + { + "key": "key1052", + "message": "message7053" + }, + { + "key": "key1053", + "message": "message7054" + }, + { + "key": "key1054", + "message": "message7055" + }, + { + "key": "key1055", + "message": "message7056" + }, + { + "key": "key1056", + "message": "message7057" + }, + { + "key": "key1057", + "message": "message7058" + }, + { + "key": "key1058", + "message": "message7059" + }, + { + "key": "key1059", + "message": "message7060" + }, + { + "key": "key1060", + "message": "message7061" + }, + { + "key": "key1061", + "message": "message7062" + }, + { + "key": "key1062", + "message": "message7063" + }, + { + "key": "key1063", + "message": "message7064" + }, + { + "key": "key1064", + "message": "message7065" + }, + { + "key": "key1065", + "message": "message7066" + }, + { + "key": "key1066", + "message": "message7067" + }, + { + "key": "key1067", + "message": "message7068" + }, + { + "key": "key1068", + "message": "message7069" + }, + { + "key": "key1069", + "message": "message7070" + }, + { + "key": "key1070", + "message": "message7071" + }, + { + "key": "key1071", + "message": "message7072" + }, + { + "key": "key1072", + "message": "message7073" + }, + { + "key": "key1073", + "message": "message7074" + }, + { + "key": "key1074", + "message": "message7075" + }, + { + "key": "key1075", + "message": "message7076" + }, + { + "key": "key1076", + "message": "message7077" + }, + { + "key": "key1077", + "message": "message7078" + }, + { + "key": "key1078", + "message": "message7079" + }, + { + "key": "key1079", + "message": "message7080" + }, + { + "key": "key1080", + "message": "message7081" + }, + { + "key": "key1081", + "message": "message7082" + }, + { + "key": "key1082", + "message": "message7083" + }, + { + "key": "key1083", + "message": "message7084" + }, + { + "key": "key1084", + "message": "message7085" + }, + { + "key": "key1085", + "message": "message7086" + }, + { + "key": "key1086", + "message": "message7087" + }, + { + "key": "key1087", + "message": "message7088" + }, + { + "key": "key1088", + "message": "message7089" + }, + { + "key": "key1089", + "message": "message7090" + }, + { + "key": "key1090", + "message": "message7091" + }, + { + "key": "key1091", + "message": "message7092" + }, + { + "key": "key1092", + "message": "message7093" + }, + { + "key": "key1093", + "message": "message7094" + }, + { + "key": "key1094", + "message": "message7095" + }, + { + "key": "key1095", + "message": "message7096" + }, + { + "key": "key1096", + "message": "message7097" + }, + { + "key": "key1097", + "message": "message7098" + }, + { + "key": "key1098", + "message": "message7099" + }, + { + "key": "key1099", + "message": "message7100" + }, + { + "key": "key1100", + "message": "message7101" + }, + { + "key": "key1101", + "message": "message7102" + }, + { + "key": "key1102", + "message": "message7103" + }, + { + "key": "key1103", + "message": "message7104" + }, + { + "key": "key1104", + "message": "message7105" + }, + { + "key": "key1105", + "message": "message7106" + }, + { + "key": "key1106", + "message": "message7107" + }, + { + "key": "key1107", + "message": "message7108" + }, + { + "key": "key1108", + "message": "message7109" + }, + { + "key": "key1109", + "message": "message7110" + }, + { + "key": "key1110", + "message": "message7111" + }, + { + "key": "key1111", + "message": "message7112" + }, + { + "key": "key1112", + "message": "message7113" + }, + { + "key": "key1113", + "message": "message7114" + }, + { + "key": "key1114", + "message": "message7115" + }, + { + "key": "key1115", + "message": "message7116" + }, + { + "key": "key1116", + "message": "message7117" + }, + { + "key": "key1117", + "message": "message7118" + }, + { + "key": "key1118", + "message": "message7119" + }, + { + "key": "key1119", + "message": "message7120" + }, + { + "key": "key1120", + "message": "message7121" + }, + { + "key": "key1121", + "message": "message7122" + }, + { + "key": "key1122", + "message": "message7123" + }, + { + "key": "key1123", + "message": "message7124" + }, + { + "key": "key1124", + "message": "message7125" + }, + { + "key": "key1125", + "message": "message7126" + }, + { + "key": "key1126", + "message": "message7127" + }, + { + "key": "key1127", + "message": "message7128" + }, + { + "key": "key1128", + "message": "message7129" + }, + { + "key": "key1129", + "message": "message7130" + }, + { + "key": "key1130", + "message": "message7131" + }, + { + "key": "key1131", + "message": "message7132" + }, + { + "key": "key1132", + "message": "message7133" + }, + { + "key": "key1133", + "message": "message7134" + }, + { + "key": "key1134", + "message": "message7135" + }, + { + "key": "key1135", + "message": "message7136" + }, + { + "key": "key1136", + "message": "message7137" + }, + { + "key": "key1137", + "message": "message7138" + }, + { + "key": "key1138", + "message": "message7139" + }, + { + "key": "key1139", + "message": "message7140" + }, + { + "key": "key1140", + "message": "message7141" + }, + { + "key": "key1141", + "message": "message7142" + }, + { + "key": "key1142", + "message": "message7143" + }, + { + "key": "key1143", + "message": "message7144" + }, + { + "key": "key1144", + "message": "message7145" + }, + { + "key": "key1145", + "message": "message7146" + }, + { + "key": "key1146", + "message": "message7147" + }, + { + "key": "key1147", + "message": "message7148" + }, + { + "key": "key1148", + "message": "message7149" + }, + { + "key": "key1149", + "message": "message7150" + }, + { + "key": "key1150", + "message": "message7151" + }, + { + "key": "key1151", + "message": "message7152" + }, + { + "key": "key1152", + "message": "message7153" + }, + { + "key": "key1153", + "message": "message7154" + }, + { + "key": "key1154", + "message": "message7155" + }, + { + "key": "key1155", + "message": "message7156" + }, + { + "key": "key1156", + "message": "message7157" + }, + { + "key": "key1157", + "message": "message7158" + }, + { + "key": "key1158", + "message": "message7159" + }, + { + "key": "key1159", + "message": "message7160" + }, + { + "key": "key1160", + "message": "message7161" + }, + { + "key": "key1161", + "message": "message7162" + }, + { + "key": "key1162", + "message": "message7163" + }, + { + "key": "key1163", + "message": "message7164" + }, + { + "key": "key1164", + "message": "message7165" + }, + { + "key": "key1165", + "message": "message7166" + }, + { + "key": "key1166", + "message": "message7167" + }, + { + "key": "key1167", + "message": "message7168" + }, + { + "key": "key1168", + "message": "message7169" + }, + { + "key": "key1169", + "message": "message7170" + }, + { + "key": "key1170", + "message": "message7171" + }, + { + "key": "key1171", + "message": "message7172" + }, + { + "key": "key1172", + "message": "message7173" + }, + { + "key": "key1173", + "message": "message7174" + }, + { + "key": "key1174", + "message": "message7175" + }, + { + "key": "key1175", + "message": "message7176" + }, + { + "key": "key1176", + "message": "message7177" + }, + { + "key": "key1177", + "message": "message7178" + }, + { + "key": "key1178", + "message": "message7179" + }, + { + "key": "key1179", + "message": "message7180" + }, + { + "key": "key1180", + "message": "message7181" + }, + { + "key": "key1181", + "message": "message7182" + }, + { + "key": "key1182", + "message": "message7183" + }, + { + "key": "key1183", + "message": "message7184" + }, + { + "key": "key1184", + "message": "message7185" + }, + { + "key": "key1185", + "message": "message7186" + }, + { + "key": "key1186", + "message": "message7187" + }, + { + "key": "key1187", + "message": "message7188" + }, + { + "key": "key1188", + "message": "message7189" + }, + { + "key": "key1189", + "message": "message7190" + }, + { + "key": "key1190", + "message": "message7191" + }, + { + "key": "key1191", + "message": "message7192" + }, + { + "key": "key1192", + "message": "message7193" + }, + { + "key": "key1193", + "message": "message7194" + }, + { + "key": "key1194", + "message": "message7195" + }, + { + "key": "key1195", + "message": "message7196" + }, + { + "key": "key1196", + "message": "message7197" + }, + { + "key": "key1197", + "message": "message7198" + }, + { + "key": "key1198", + "message": "message7199" + }, + { + "key": "key1199", + "message": "message7200" + }, + { + "key": "key1200", + "message": "message7201" + }, + { + "key": "key1201", + "message": "message7202" + }, + { + "key": "key1202", + "message": "message7203" + }, + { + "key": "key1203", + "message": "message7204" + }, + { + "key": "key1204", + "message": "message7205" + }, + { + "key": "key1205", + "message": "message7206" + }, + { + "key": "key1206", + "message": "message7207" + }, + { + "key": "key1207", + "message": "message7208" + }, + { + "key": "key1208", + "message": "message7209" + }, + { + "key": "key1209", + "message": "message7210" + }, + { + "key": "key1210", + "message": "message7211" + }, + { + "key": "key1211", + "message": "message7212" + }, + { + "key": "key1212", + "message": "message7213" + }, + { + "key": "key1213", + "message": "message7214" + }, + { + "key": "key1214", + "message": "message7215" + }, + { + "key": "key1215", + "message": "message7216" + }, + { + "key": "key1216", + "message": "message7217" + }, + { + "key": "key1217", + "message": "message7218" + }, + { + "key": "key1218", + "message": "message7219" + }, + { + "key": "key1219", + "message": "message7220" + }, + { + "key": "key1220", + "message": "message7221" + }, + { + "key": "key1221", + "message": "message7222" + }, + { + "key": "key1222", + "message": "message7223" + }, + { + "key": "key1223", + "message": "message7224" + }, + { + "key": "key1224", + "message": "message7225" + }, + { + "key": "key1225", + "message": "message7226" + }, + { + "key": "key1226", + "message": "message7227" + }, + { + "key": "key1227", + "message": "message7228" + }, + { + "key": "key1228", + "message": "message7229" + }, + { + "key": "key1229", + "message": "message7230" + }, + { + "key": "key1230", + "message": "message7231" + }, + { + "key": "key1231", + "message": "message7232" + }, + { + "key": "key1232", + "message": "message7233" + }, + { + "key": "key1233", + "message": "message7234" + }, + { + "key": "key1234", + "message": "message7235" + }, + { + "key": "key1235", + "message": "message7236" + }, + { + "key": "key1236", + "message": "message7237" + }, + { + "key": "key1237", + "message": "message7238" + }, + { + "key": "key1238", + "message": "message7239" + }, + { + "key": "key1239", + "message": "message7240" + }, + { + "key": "key1240", + "message": "message7241" + }, + { + "key": "key1241", + "message": "message7242" + }, + { + "key": "key1242", + "message": "message7243" + }, + { + "key": "key1243", + "message": "message7244" + }, + { + "key": "key1244", + "message": "message7245" + }, + { + "key": "key1245", + "message": "message7246" + }, + { + "key": "key1246", + "message": "message7247" + }, + { + "key": "key1247", + "message": "message7248" + }, + { + "key": "key1248", + "message": "message7249" + }, + { + "key": "key1249", + "message": "message7250" + }, + { + "key": "key1250", + "message": "message7251" + }, + { + "key": "key1251", + "message": "message7252" + }, + { + "key": "key1252", + "message": "message7253" + }, + { + "key": "key1253", + "message": "message7254" + }, + { + "key": "key1254", + "message": "message7255" + }, + { + "key": "key1255", + "message": "message7256" + }, + { + "key": "key1256", + "message": "message7257" + }, + { + "key": "key1257", + "message": "message7258" + }, + { + "key": "key1258", + "message": "message7259" + }, + { + "key": "key1259", + "message": "message7260" + }, + { + "key": "key1260", + "message": "message7261" + }, + { + "key": "key1261", + "message": "message7262" + }, + { + "key": "key1262", + "message": "message7263" + }, + { + "key": "key1263", + "message": "message7264" + }, + { + "key": "key1264", + "message": "message7265" + }, + { + "key": "key1265", + "message": "message7266" + }, + { + "key": "key1266", + "message": "message7267" + }, + { + "key": "key1267", + "message": "message7268" + }, + { + "key": "key1268", + "message": "message7269" + }, + { + "key": "key1269", + "message": "message7270" + }, + { + "key": "key1270", + "message": "message7271" + }, + { + "key": "key1271", + "message": "message7272" + }, + { + "key": "key1272", + "message": "message7273" + }, + { + "key": "key1273", + "message": "message7274" + }, + { + "key": "key1274", + "message": "message7275" + }, + { + "key": "key1275", + "message": "message7276" + }, + { + "key": "key1276", + "message": "message7277" + }, + { + "key": "key1277", + "message": "message7278" + }, + { + "key": "key1278", + "message": "message7279" + }, + { + "key": "key1279", + "message": "message7280" + }, + { + "key": "key1280", + "message": "message7281" + }, + { + "key": "key1281", + "message": "message7282" + }, + { + "key": "key1282", + "message": "message7283" + }, + { + "key": "key1283", + "message": "message7284" + }, + { + "key": "key1284", + "message": "message7285" + }, + { + "key": "key1285", + "message": "message7286" + }, + { + "key": "key1286", + "message": "message7287" + }, + { + "key": "key1287", + "message": "message7288" + }, + { + "key": "key1288", + "message": "message7289" + }, + { + "key": "key1289", + "message": "message7290" + }, + { + "key": "key1290", + "message": "message7291" + }, + { + "key": "key1291", + "message": "message7292" + }, + { + "key": "key1292", + "message": "message7293" + }, + { + "key": "key1293", + "message": "message7294" + }, + { + "key": "key1294", + "message": "message7295" + }, + { + "key": "key1295", + "message": "message7296" + }, + { + "key": "key1296", + "message": "message7297" + }, + { + "key": "key1297", + "message": "message7298" + }, + { + "key": "key1298", + "message": "message7299" + }, + { + "key": "key1299", + "message": "message7300" + }, + { + "key": "key1300", + "message": "message7301" + }, + { + "key": "key1301", + "message": "message7302" + }, + { + "key": "key1302", + "message": "message7303" + }, + { + "key": "key1303", + "message": "message7304" + }, + { + "key": "key1304", + "message": "message7305" + }, + { + "key": "key1305", + "message": "message7306" + }, + { + "key": "key1306", + "message": "message7307" + }, + { + "key": "key1307", + "message": "message7308" + }, + { + "key": "key1308", + "message": "message7309" + }, + { + "key": "key1309", + "message": "message7310" + }, + { + "key": "key1310", + "message": "message7311" + }, + { + "key": "key1311", + "message": "message7312" + }, + { + "key": "key1312", + "message": "message7313" + }, + { + "key": "key1313", + "message": "message7314" + }, + { + "key": "key1314", + "message": "message7315" + }, + { + "key": "key1315", + "message": "message7316" + }, + { + "key": "key1316", + "message": "message7317" + }, + { + "key": "key1317", + "message": "message7318" + }, + { + "key": "key1318", + "message": "message7319" + }, + { + "key": "key1319", + "message": "message7320" + }, + { + "key": "key1320", + "message": "message7321" + }, + { + "key": "key1321", + "message": "message7322" + }, + { + "key": "key1322", + "message": "message7323" + }, + { + "key": "key1323", + "message": "message7324" + }, + { + "key": "key1324", + "message": "message7325" + }, + { + "key": "key1325", + "message": "message7326" + }, + { + "key": "key1326", + "message": "message7327" + }, + { + "key": "key1327", + "message": "message7328" + }, + { + "key": "key1328", + "message": "message7329" + }, + { + "key": "key1329", + "message": "message7330" + }, + { + "key": "key1330", + "message": "message7331" + }, + { + "key": "key1331", + "message": "message7332" + }, + { + "key": "key1332", + "message": "message7333" + }, + { + "key": "key1333", + "message": "message7334" + }, + { + "key": "key1334", + "message": "message7335" + }, + { + "key": "key1335", + "message": "message7336" + }, + { + "key": "key1336", + "message": "message7337" + }, + { + "key": "key1337", + "message": "message7338" + }, + { + "key": "key1338", + "message": "message7339" + }, + { + "key": "key1339", + "message": "message7340" + }, + { + "key": "key1340", + "message": "message7341" + }, + { + "key": "key1341", + "message": "message7342" + }, + { + "key": "key1342", + "message": "message7343" + }, + { + "key": "key1343", + "message": "message7344" + }, + { + "key": "key1344", + "message": "message7345" + }, + { + "key": "key1345", + "message": "message7346" + }, + { + "key": "key1346", + "message": "message7347" + }, + { + "key": "key1347", + "message": "message7348" + }, + { + "key": "key1348", + "message": "message7349" + }, + { + "key": "key1349", + "message": "message7350" + }, + { + "key": "key1350", + "message": "message7351" + }, + { + "key": "key1351", + "message": "message7352" + }, + { + "key": "key1352", + "message": "message7353" + }, + { + "key": "key1353", + "message": "message7354" + }, + { + "key": "key1354", + "message": "message7355" + }, + { + "key": "key1355", + "message": "message7356" + }, + { + "key": "key1356", + "message": "message7357" + }, + { + "key": "key1357", + "message": "message7358" + }, + { + "key": "key1358", + "message": "message7359" + }, + { + "key": "key1359", + "message": "message7360" + }, + { + "key": "key1360", + "message": "message7361" + }, + { + "key": "key1361", + "message": "message7362" + }, + { + "key": "key1362", + "message": "message7363" + }, + { + "key": "key1363", + "message": "message7364" + }, + { + "key": "key1364", + "message": "message7365" + }, + { + "key": "key1365", + "message": "message7366" + }, + { + "key": "key1366", + "message": "message7367" + }, + { + "key": "key1367", + "message": "message7368" + }, + { + "key": "key1368", + "message": "message7369" + }, + { + "key": "key1369", + "message": "message7370" + }, + { + "key": "key1370", + "message": "message7371" + }, + { + "key": "key1371", + "message": "message7372" + }, + { + "key": "key1372", + "message": "message7373" + }, + { + "key": "key1373", + "message": "message7374" + }, + { + "key": "key1374", + "message": "message7375" + }, + { + "key": "key1375", + "message": "message7376" + }, + { + "key": "key1376", + "message": "message7377" + }, + { + "key": "key1377", + "message": "message7378" + }, + { + "key": "key1378", + "message": "message7379" + }, + { + "key": "key1379", + "message": "message7380" + }, + { + "key": "key1380", + "message": "message7381" + }, + { + "key": "key1381", + "message": "message7382" + }, + { + "key": "key1382", + "message": "message7383" + }, + { + "key": "key1383", + "message": "message7384" + }, + { + "key": "key1384", + "message": "message7385" + }, + { + "key": "key1385", + "message": "message7386" + }, + { + "key": "key1386", + "message": "message7387" + }, + { + "key": "key1387", + "message": "message7388" + }, + { + "key": "key1388", + "message": "message7389" + }, + { + "key": "key1389", + "message": "message7390" + }, + { + "key": "key1390", + "message": "message7391" + }, + { + "key": "key1391", + "message": "message7392" + }, + { + "key": "key1392", + "message": "message7393" + }, + { + "key": "key1393", + "message": "message7394" + }, + { + "key": "key1394", + "message": "message7395" + }, + { + "key": "key1395", + "message": "message7396" + }, + { + "key": "key1396", + "message": "message7397" + }, + { + "key": "key1397", + "message": "message7398" + }, + { + "key": "key1398", + "message": "message7399" + }, + { + "key": "key1399", + "message": "message7400" + }, + { + "key": "key1400", + "message": "message7401" + }, + { + "key": "key1401", + "message": "message7402" + }, + { + "key": "key1402", + "message": "message7403" + }, + { + "key": "key1403", + "message": "message7404" + }, + { + "key": "key1404", + "message": "message7405" + }, + { + "key": "key1405", + "message": "message7406" + }, + { + "key": "key1406", + "message": "message7407" + }, + { + "key": "key1407", + "message": "message7408" + }, + { + "key": "key1408", + "message": "message7409" + }, + { + "key": "key1409", + "message": "message7410" + }, + { + "key": "key1410", + "message": "message7411" + }, + { + "key": "key1411", + "message": "message7412" + }, + { + "key": "key1412", + "message": "message7413" + }, + { + "key": "key1413", + "message": "message7414" + }, + { + "key": "key1414", + "message": "message7415" + }, + { + "key": "key1415", + "message": "message7416" + }, + { + "key": "key1416", + "message": "message7417" + }, + { + "key": "key1417", + "message": "message7418" + }, + { + "key": "key1418", + "message": "message7419" + }, + { + "key": "key1419", + "message": "message7420" + }, + { + "key": "key1420", + "message": "message7421" + }, + { + "key": "key1421", + "message": "message7422" + }, + { + "key": "key1422", + "message": "message7423" + }, + { + "key": "key1423", + "message": "message7424" + }, + { + "key": "key1424", + "message": "message7425" + }, + { + "key": "key1425", + "message": "message7426" + }, + { + "key": "key1426", + "message": "message7427" + }, + { + "key": "key1427", + "message": "message7428" + }, + { + "key": "key1428", + "message": "message7429" + }, + { + "key": "key1429", + "message": "message7430" + }, + { + "key": "key1430", + "message": "message7431" + }, + { + "key": "key1431", + "message": "message7432" + }, + { + "key": "key1432", + "message": "message7433" + }, + { + "key": "key1433", + "message": "message7434" + }, + { + "key": "key1434", + "message": "message7435" + }, + { + "key": "key1435", + "message": "message7436" + }, + { + "key": "key1436", + "message": "message7437" + }, + { + "key": "key1437", + "message": "message7438" + }, + { + "key": "key1438", + "message": "message7439" + }, + { + "key": "key1439", + "message": "message7440" + }, + { + "key": "key1440", + "message": "message7441" + }, + { + "key": "key1441", + "message": "message7442" + }, + { + "key": "key1442", + "message": "message7443" + }, + { + "key": "key1443", + "message": "message7444" + }, + { + "key": "key1444", + "message": "message7445" + }, + { + "key": "key1445", + "message": "message7446" + }, + { + "key": "key1446", + "message": "message7447" + }, + { + "key": "key1447", + "message": "message7448" + }, + { + "key": "key1448", + "message": "message7449" + }, + { + "key": "key1449", + "message": "message7450" + }, + { + "key": "key1450", + "message": "message7451" + }, + { + "key": "key1451", + "message": "message7452" + }, + { + "key": "key1452", + "message": "message7453" + }, + { + "key": "key1453", + "message": "message7454" + }, + { + "key": "key1454", + "message": "message7455" + }, + { + "key": "key1455", + "message": "message7456" + }, + { + "key": "key1456", + "message": "message7457" + }, + { + "key": "key1457", + "message": "message7458" + }, + { + "key": "key1458", + "message": "message7459" + }, + { + "key": "key1459", + "message": "message7460" + }, + { + "key": "key1460", + "message": "message7461" + }, + { + "key": "key1461", + "message": "message7462" + }, + { + "key": "key1462", + "message": "message7463" + }, + { + "key": "key1463", + "message": "message7464" + }, + { + "key": "key1464", + "message": "message7465" + }, + { + "key": "key1465", + "message": "message7466" + }, + { + "key": "key1466", + "message": "message7467" + }, + { + "key": "key1467", + "message": "message7468" + }, + { + "key": "key1468", + "message": "message7469" + }, + { + "key": "key1469", + "message": "message7470" + }, + { + "key": "key1470", + "message": "message7471" + }, + { + "key": "key1471", + "message": "message7472" + }, + { + "key": "key1472", + "message": "message7473" + }, + { + "key": "key1473", + "message": "message7474" + }, + { + "key": "key1474", + "message": "message7475" + }, + { + "key": "key1475", + "message": "message7476" + }, + { + "key": "key1476", + "message": "message7477" + }, + { + "key": "key1477", + "message": "message7478" + }, + { + "key": "key1478", + "message": "message7479" + }, + { + "key": "key1479", + "message": "message7480" + }, + { + "key": "key1480", + "message": "message7481" + }, + { + "key": "key1481", + "message": "message7482" + }, + { + "key": "key1482", + "message": "message7483" + }, + { + "key": "key1483", + "message": "message7484" + }, + { + "key": "key1484", + "message": "message7485" + }, + { + "key": "key1485", + "message": "message7486" + }, + { + "key": "key1486", + "message": "message7487" + }, + { + "key": "key1487", + "message": "message7488" + }, + { + "key": "key1488", + "message": "message7489" + }, + { + "key": "key1489", + "message": "message7490" + }, + { + "key": "key1490", + "message": "message7491" + }, + { + "key": "key1491", + "message": "message7492" + }, + { + "key": "key1492", + "message": "message7493" + }, + { + "key": "key1493", + "message": "message7494" + }, + { + "key": "key1494", + "message": "message7495" + }, + { + "key": "key1495", + "message": "message7496" + }, + { + "key": "key1496", + "message": "message7497" + }, + { + "key": "key1497", + "message": "message7498" + }, + { + "key": "key1498", + "message": "message7499" + }, + { + "key": "key1499", + "message": "message7500" + }, + { + "key": "key1500", + "message": "message7501" + }, + { + "key": "key1501", + "message": "message7502" + }, + { + "key": "key1502", + "message": "message7503" + }, + { + "key": "key1503", + "message": "message7504" + }, + { + "key": "key1504", + "message": "message7505" + }, + { + "key": "key1505", + "message": "message7506" + }, + { + "key": "key1506", + "message": "message7507" + }, + { + "key": "key1507", + "message": "message7508" + }, + { + "key": "key1508", + "message": "message7509" + }, + { + "key": "key1509", + "message": "message7510" + }, + { + "key": "key1510", + "message": "message7511" + }, + { + "key": "key1511", + "message": "message7512" + }, + { + "key": "key1512", + "message": "message7513" + }, + { + "key": "key1513", + "message": "message7514" + }, + { + "key": "key1514", + "message": "message7515" + }, + { + "key": "key1515", + "message": "message7516" + }, + { + "key": "key1516", + "message": "message7517" + }, + { + "key": "key1517", + "message": "message7518" + }, + { + "key": "key1518", + "message": "message7519" + }, + { + "key": "key1519", + "message": "message7520" + }, + { + "key": "key1520", + "message": "message7521" + }, + { + "key": "key1521", + "message": "message7522" + }, + { + "key": "key1522", + "message": "message7523" + }, + { + "key": "key1523", + "message": "message7524" + }, + { + "key": "key1524", + "message": "message7525" + }, + { + "key": "key1525", + "message": "message7526" + }, + { + "key": "key1526", + "message": "message7527" + }, + { + "key": "key1527", + "message": "message7528" + }, + { + "key": "key1528", + "message": "message7529" + }, + { + "key": "key1529", + "message": "message7530" + }, + { + "key": "key1530", + "message": "message7531" + }, + { + "key": "key1531", + "message": "message7532" + }, + { + "key": "key1532", + "message": "message7533" + }, + { + "key": "key1533", + "message": "message7534" + }, + { + "key": "key1534", + "message": "message7535" + }, + { + "key": "key1535", + "message": "message7536" + }, + { + "key": "key1536", + "message": "message7537" + }, + { + "key": "key1537", + "message": "message7538" + }, + { + "key": "key1538", + "message": "message7539" + }, + { + "key": "key1539", + "message": "message7540" + }, + { + "key": "key1540", + "message": "message7541" + }, + { + "key": "key1541", + "message": "message7542" + }, + { + "key": "key1542", + "message": "message7543" + }, + { + "key": "key1543", + "message": "message7544" + }, + { + "key": "key1544", + "message": "message7545" + }, + { + "key": "key1545", + "message": "message7546" + }, + { + "key": "key1546", + "message": "message7547" + }, + { + "key": "key1547", + "message": "message7548" + }, + { + "key": "key1548", + "message": "message7549" + }, + { + "key": "key1549", + "message": "message7550" + }, + { + "key": "key1550", + "message": "message7551" + }, + { + "key": "key1551", + "message": "message7552" + }, + { + "key": "key1552", + "message": "message7553" + }, + { + "key": "key1553", + "message": "message7554" + }, + { + "key": "key1554", + "message": "message7555" + }, + { + "key": "key1555", + "message": "message7556" + }, + { + "key": "key1556", + "message": "message7557" + }, + { + "key": "key1557", + "message": "message7558" + }, + { + "key": "key1558", + "message": "message7559" + }, + { + "key": "key1559", + "message": "message7560" + }, + { + "key": "key1560", + "message": "message7561" + }, + { + "key": "key1561", + "message": "message7562" + }, + { + "key": "key1562", + "message": "message7563" + }, + { + "key": "key1563", + "message": "message7564" + }, + { + "key": "key1564", + "message": "message7565" + }, + { + "key": "key1565", + "message": "message7566" + }, + { + "key": "key1566", + "message": "message7567" + }, + { + "key": "key1567", + "message": "message7568" + }, + { + "key": "key1568", + "message": "message7569" + }, + { + "key": "key1569", + "message": "message7570" + }, + { + "key": "key1570", + "message": "message7571" + }, + { + "key": "key1571", + "message": "message7572" + }, + { + "key": "key1572", + "message": "message7573" + }, + { + "key": "key1573", + "message": "message7574" + }, + { + "key": "key1574", + "message": "message7575" + }, + { + "key": "key1575", + "message": "message7576" + }, + { + "key": "key1576", + "message": "message7577" + }, + { + "key": "key1577", + "message": "message7578" + }, + { + "key": "key1578", + "message": "message7579" + }, + { + "key": "key1579", + "message": "message7580" + }, + { + "key": "key1580", + "message": "message7581" + }, + { + "key": "key1581", + "message": "message7582" + }, + { + "key": "key1582", + "message": "message7583" + }, + { + "key": "key1583", + "message": "message7584" + }, + { + "key": "key1584", + "message": "message7585" + }, + { + "key": "key1585", + "message": "message7586" + }, + { + "key": "key1586", + "message": "message7587" + }, + { + "key": "key1587", + "message": "message7588" + }, + { + "key": "key1588", + "message": "message7589" + }, + { + "key": "key1589", + "message": "message7590" + }, + { + "key": "key1590", + "message": "message7591" + }, + { + "key": "key1591", + "message": "message7592" + }, + { + "key": "key1592", + "message": "message7593" + }, + { + "key": "key1593", + "message": "message7594" + }, + { + "key": "key1594", + "message": "message7595" + }, + { + "key": "key1595", + "message": "message7596" + }, + { + "key": "key1596", + "message": "message7597" + }, + { + "key": "key1597", + "message": "message7598" + }, + { + "key": "key1598", + "message": "message7599" + }, + { + "key": "key1599", + "message": "message7600" + }, + { + "key": "key1600", + "message": "message7601" + }, + { + "key": "key1601", + "message": "message7602" + }, + { + "key": "key1602", + "message": "message7603" + }, + { + "key": "key1603", + "message": "message7604" + }, + { + "key": "key1604", + "message": "message7605" + }, + { + "key": "key1605", + "message": "message7606" + }, + { + "key": "key1606", + "message": "message7607" + }, + { + "key": "key1607", + "message": "message7608" + }, + { + "key": "key1608", + "message": "message7609" + }, + { + "key": "key1609", + "message": "message7610" + }, + { + "key": "key1610", + "message": "message7611" + }, + { + "key": "key1611", + "message": "message7612" + }, + { + "key": "key1612", + "message": "message7613" + }, + { + "key": "key1613", + "message": "message7614" + }, + { + "key": "key1614", + "message": "message7615" + }, + { + "key": "key1615", + "message": "message7616" + }, + { + "key": "key1616", + "message": "message7617" + }, + { + "key": "key1617", + "message": "message7618" + }, + { + "key": "key1618", + "message": "message7619" + }, + { + "key": "key1619", + "message": "message7620" + }, + { + "key": "key1620", + "message": "message7621" + }, + { + "key": "key1621", + "message": "message7622" + }, + { + "key": "key1622", + "message": "message7623" + }, + { + "key": "key1623", + "message": "message7624" + }, + { + "key": "key1624", + "message": "message7625" + }, + { + "key": "key1625", + "message": "message7626" + }, + { + "key": "key1626", + "message": "message7627" + }, + { + "key": "key1627", + "message": "message7628" + }, + { + "key": "key1628", + "message": "message7629" + }, + { + "key": "key1629", + "message": "message7630" + }, + { + "key": "key1630", + "message": "message7631" + }, + { + "key": "key1631", + "message": "message7632" + }, + { + "key": "key1632", + "message": "message7633" + }, + { + "key": "key1633", + "message": "message7634" + }, + { + "key": "key1634", + "message": "message7635" + }, + { + "key": "key1635", + "message": "message7636" + }, + { + "key": "key1636", + "message": "message7637" + }, + { + "key": "key1637", + "message": "message7638" + }, + { + "key": "key1638", + "message": "message7639" + }, + { + "key": "key1639", + "message": "message7640" + }, + { + "key": "key1640", + "message": "message7641" + }, + { + "key": "key1641", + "message": "message7642" + }, + { + "key": "key1642", + "message": "message7643" + }, + { + "key": "key1643", + "message": "message7644" + }, + { + "key": "key1644", + "message": "message7645" + }, + { + "key": "key1645", + "message": "message7646" + }, + { + "key": "key1646", + "message": "message7647" + }, + { + "key": "key1647", + "message": "message7648" + }, + { + "key": "key1648", + "message": "message7649" + }, + { + "key": "key1649", + "message": "message7650" + }, + { + "key": "key1650", + "message": "message7651" + }, + { + "key": "key1651", + "message": "message7652" + }, + { + "key": "key1652", + "message": "message7653" + }, + { + "key": "key1653", + "message": "message7654" + }, + { + "key": "key1654", + "message": "message7655" + }, + { + "key": "key1655", + "message": "message7656" + }, + { + "key": "key1656", + "message": "message7657" + }, + { + "key": "key1657", + "message": "message7658" + }, + { + "key": "key1658", + "message": "message7659" + }, + { + "key": "key1659", + "message": "message7660" + }, + { + "key": "key1660", + "message": "message7661" + }, + { + "key": "key1661", + "message": "message7662" + }, + { + "key": "key1662", + "message": "message7663" + }, + { + "key": "key1663", + "message": "message7664" + }, + { + "key": "key1664", + "message": "message7665" + }, + { + "key": "key1665", + "message": "message7666" + }, + { + "key": "key1666", + "message": "message7667" + }, + { + "key": "key1667", + "message": "message7668" + }, + { + "key": "key1668", + "message": "message7669" + }, + { + "key": "key1669", + "message": "message7670" + }, + { + "key": "key1670", + "message": "message7671" + }, + { + "key": "key1671", + "message": "message7672" + }, + { + "key": "key1672", + "message": "message7673" + }, + { + "key": "key1673", + "message": "message7674" + }, + { + "key": "key1674", + "message": "message7675" + }, + { + "key": "key1675", + "message": "message7676" + }, + { + "key": "key1676", + "message": "message7677" + }, + { + "key": "key1677", + "message": "message7678" + }, + { + "key": "key1678", + "message": "message7679" + }, + { + "key": "key1679", + "message": "message7680" + }, + { + "key": "key1680", + "message": "message7681" + }, + { + "key": "key1681", + "message": "message7682" + }, + { + "key": "key1682", + "message": "message7683" + }, + { + "key": "key1683", + "message": "message7684" + }, + { + "key": "key1684", + "message": "message7685" + }, + { + "key": "key1685", + "message": "message7686" + }, + { + "key": "key1686", + "message": "message7687" + }, + { + "key": "key1687", + "message": "message7688" + }, + { + "key": "key1688", + "message": "message7689" + }, + { + "key": "key1689", + "message": "message7690" + }, + { + "key": "key1690", + "message": "message7691" + }, + { + "key": "key1691", + "message": "message7692" + }, + { + "key": "key1692", + "message": "message7693" + }, + { + "key": "key1693", + "message": "message7694" + }, + { + "key": "key1694", + "message": "message7695" + }, + { + "key": "key1695", + "message": "message7696" + }, + { + "key": "key1696", + "message": "message7697" + }, + { + "key": "key1697", + "message": "message7698" + }, + { + "key": "key1698", + "message": "message7699" + }, + { + "key": "key1699", + "message": "message7700" + }, + { + "key": "key1700", + "message": "message7701" + }, + { + "key": "key1701", + "message": "message7702" + }, + { + "key": "key1702", + "message": "message7703" + }, + { + "key": "key1703", + "message": "message7704" + }, + { + "key": "key1704", + "message": "message7705" + }, + { + "key": "key1705", + "message": "message7706" + }, + { + "key": "key1706", + "message": "message7707" + }, + { + "key": "key1707", + "message": "message7708" + }, + { + "key": "key1708", + "message": "message7709" + }, + { + "key": "key1709", + "message": "message7710" + }, + { + "key": "key1710", + "message": "message7711" + }, + { + "key": "key1711", + "message": "message7712" + }, + { + "key": "key1712", + "message": "message7713" + }, + { + "key": "key1713", + "message": "message7714" + }, + { + "key": "key1714", + "message": "message7715" + }, + { + "key": "key1715", + "message": "message7716" + }, + { + "key": "key1716", + "message": "message7717" + }, + { + "key": "key1717", + "message": "message7718" + }, + { + "key": "key1718", + "message": "message7719" + }, + { + "key": "key1719", + "message": "message7720" + }, + { + "key": "key1720", + "message": "message7721" + }, + { + "key": "key1721", + "message": "message7722" + }, + { + "key": "key1722", + "message": "message7723" + }, + { + "key": "key1723", + "message": "message7724" + }, + { + "key": "key1724", + "message": "message7725" + }, + { + "key": "key1725", + "message": "message7726" + }, + { + "key": "key1726", + "message": "message7727" + }, + { + "key": "key1727", + "message": "message7728" + }, + { + "key": "key1728", + "message": "message7729" + }, + { + "key": "key1729", + "message": "message7730" + }, + { + "key": "key1730", + "message": "message7731" + }, + { + "key": "key1731", + "message": "message7732" + }, + { + "key": "key1732", + "message": "message7733" + }, + { + "key": "key1733", + "message": "message7734" + }, + { + "key": "key1734", + "message": "message7735" + }, + { + "key": "key1735", + "message": "message7736" + }, + { + "key": "key1736", + "message": "message7737" + }, + { + "key": "key1737", + "message": "message7738" + }, + { + "key": "key1738", + "message": "message7739" + }, + { + "key": "key1739", + "message": "message7740" + }, + { + "key": "key1740", + "message": "message7741" + }, + { + "key": "key1741", + "message": "message7742" + }, + { + "key": "key1742", + "message": "message7743" + }, + { + "key": "key1743", + "message": "message7744" + }, + { + "key": "key1744", + "message": "message7745" + }, + { + "key": "key1745", + "message": "message7746" + }, + { + "key": "key1746", + "message": "message7747" + }, + { + "key": "key1747", + "message": "message7748" + }, + { + "key": "key1748", + "message": "message7749" + }, + { + "key": "key1749", + "message": "message7750" + }, + { + "key": "key1750", + "message": "message7751" + }, + { + "key": "key1751", + "message": "message7752" + }, + { + "key": "key1752", + "message": "message7753" + }, + { + "key": "key1753", + "message": "message7754" + }, + { + "key": "key1754", + "message": "message7755" + }, + { + "key": "key1755", + "message": "message7756" + }, + { + "key": "key1756", + "message": "message7757" + }, + { + "key": "key1757", + "message": "message7758" + }, + { + "key": "key1758", + "message": "message7759" + }, + { + "key": "key1759", + "message": "message7760" + }, + { + "key": "key1760", + "message": "message7761" + }, + { + "key": "key1761", + "message": "message7762" + }, + { + "key": "key1762", + "message": "message7763" + }, + { + "key": "key1763", + "message": "message7764" + }, + { + "key": "key1764", + "message": "message7765" + }, + { + "key": "key1765", + "message": "message7766" + }, + { + "key": "key1766", + "message": "message7767" + }, + { + "key": "key1767", + "message": "message7768" + }, + { + "key": "key1768", + "message": "message7769" + }, + { + "key": "key1769", + "message": "message7770" + }, + { + "key": "key1770", + "message": "message7771" + }, + { + "key": "key1771", + "message": "message7772" + }, + { + "key": "key1772", + "message": "message7773" + }, + { + "key": "key1773", + "message": "message7774" + }, + { + "key": "key1774", + "message": "message7775" + }, + { + "key": "key1775", + "message": "message7776" + }, + { + "key": "key1776", + "message": "message7777" + }, + { + "key": "key1777", + "message": "message7778" + }, + { + "key": "key1778", + "message": "message7779" + }, + { + "key": "key1779", + "message": "message7780" + }, + { + "key": "key1780", + "message": "message7781" + }, + { + "key": "key1781", + "message": "message7782" + }, + { + "key": "key1782", + "message": "message7783" + }, + { + "key": "key1783", + "message": "message7784" + }, + { + "key": "key1784", + "message": "message7785" + }, + { + "key": "key1785", + "message": "message7786" + }, + { + "key": "key1786", + "message": "message7787" + }, + { + "key": "key1787", + "message": "message7788" + }, + { + "key": "key1788", + "message": "message7789" + }, + { + "key": "key1789", + "message": "message7790" + }, + { + "key": "key1790", + "message": "message7791" + }, + { + "key": "key1791", + "message": "message7792" + }, + { + "key": "key1792", + "message": "message7793" + }, + { + "key": "key1793", + "message": "message7794" + }, + { + "key": "key1794", + "message": "message7795" + }, + { + "key": "key1795", + "message": "message7796" + }, + { + "key": "key1796", + "message": "message7797" + }, + { + "key": "key1797", + "message": "message7798" + }, + { + "key": "key1798", + "message": "message7799" + }, + { + "key": "key1799", + "message": "message7800" + }, + { + "key": "key1800", + "message": "message7801" + }, + { + "key": "key1801", + "message": "message7802" + }, + { + "key": "key1802", + "message": "message7803" + }, + { + "key": "key1803", + "message": "message7804" + }, + { + "key": "key1804", + "message": "message7805" + }, + { + "key": "key1805", + "message": "message7806" + }, + { + "key": "key1806", + "message": "message7807" + }, + { + "key": "key1807", + "message": "message7808" + }, + { + "key": "key1808", + "message": "message7809" + }, + { + "key": "key1809", + "message": "message7810" + }, + { + "key": "key1810", + "message": "message7811" + }, + { + "key": "key1811", + "message": "message7812" + }, + { + "key": "key1812", + "message": "message7813" + }, + { + "key": "key1813", + "message": "message7814" + }, + { + "key": "key1814", + "message": "message7815" + }, + { + "key": "key1815", + "message": "message7816" + }, + { + "key": "key1816", + "message": "message7817" + }, + { + "key": "key1817", + "message": "message7818" + }, + { + "key": "key1818", + "message": "message7819" + }, + { + "key": "key1819", + "message": "message7820" + }, + { + "key": "key1820", + "message": "message7821" + }, + { + "key": "key1821", + "message": "message7822" + }, + { + "key": "key1822", + "message": "message7823" + }, + { + "key": "key1823", + "message": "message7824" + }, + { + "key": "key1824", + "message": "message7825" + }, + { + "key": "key1825", + "message": "message7826" + }, + { + "key": "key1826", + "message": "message7827" + }, + { + "key": "key1827", + "message": "message7828" + }, + { + "key": "key1828", + "message": "message7829" + }, + { + "key": "key1829", + "message": "message7830" + }, + { + "key": "key1830", + "message": "message7831" + }, + { + "key": "key1831", + "message": "message7832" + }, + { + "key": "key1832", + "message": "message7833" + }, + { + "key": "key1833", + "message": "message7834" + }, + { + "key": "key1834", + "message": "message7835" + }, + { + "key": "key1835", + "message": "message7836" + }, + { + "key": "key1836", + "message": "message7837" + }, + { + "key": "key1837", + "message": "message7838" + }, + { + "key": "key1838", + "message": "message7839" + }, + { + "key": "key1839", + "message": "message7840" + }, + { + "key": "key1840", + "message": "message7841" + }, + { + "key": "key1841", + "message": "message7842" + }, + { + "key": "key1842", + "message": "message7843" + }, + { + "key": "key1843", + "message": "message7844" + }, + { + "key": "key1844", + "message": "message7845" + }, + { + "key": "key1845", + "message": "message7846" + }, + { + "key": "key1846", + "message": "message7847" + }, + { + "key": "key1847", + "message": "message7848" + }, + { + "key": "key1848", + "message": "message7849" + }, + { + "key": "key1849", + "message": "message7850" + }, + { + "key": "key1850", + "message": "message7851" + }, + { + "key": "key1851", + "message": "message7852" + }, + { + "key": "key1852", + "message": "message7853" + }, + { + "key": "key1853", + "message": "message7854" + }, + { + "key": "key1854", + "message": "message7855" + }, + { + "key": "key1855", + "message": "message7856" + }, + { + "key": "key1856", + "message": "message7857" + }, + { + "key": "key1857", + "message": "message7858" + }, + { + "key": "key1858", + "message": "message7859" + }, + { + "key": "key1859", + "message": "message7860" + }, + { + "key": "key1860", + "message": "message7861" + }, + { + "key": "key1861", + "message": "message7862" + }, + { + "key": "key1862", + "message": "message7863" + }, + { + "key": "key1863", + "message": "message7864" + }, + { + "key": "key1864", + "message": "message7865" + }, + { + "key": "key1865", + "message": "message7866" + }, + { + "key": "key1866", + "message": "message7867" + }, + { + "key": "key1867", + "message": "message7868" + }, + { + "key": "key1868", + "message": "message7869" + }, + { + "key": "key1869", + "message": "message7870" + }, + { + "key": "key1870", + "message": "message7871" + }, + { + "key": "key1871", + "message": "message7872" + }, + { + "key": "key1872", + "message": "message7873" + }, + { + "key": "key1873", + "message": "message7874" + }, + { + "key": "key1874", + "message": "message7875" + }, + { + "key": "key1875", + "message": "message7876" + }, + { + "key": "key1876", + "message": "message7877" + }, + { + "key": "key1877", + "message": "message7878" + }, + { + "key": "key1878", + "message": "message7879" + }, + { + "key": "key1879", + "message": "message7880" + }, + { + "key": "key1880", + "message": "message7881" + }, + { + "key": "key1881", + "message": "message7882" + }, + { + "key": "key1882", + "message": "message7883" + }, + { + "key": "key1883", + "message": "message7884" + }, + { + "key": "key1884", + "message": "message7885" + }, + { + "key": "key1885", + "message": "message7886" + }, + { + "key": "key1886", + "message": "message7887" + }, + { + "key": "key1887", + "message": "message7888" + }, + { + "key": "key1888", + "message": "message7889" + }, + { + "key": "key1889", + "message": "message7890" + }, + { + "key": "key1890", + "message": "message7891" + }, + { + "key": "key1891", + "message": "message7892" + }, + { + "key": "key1892", + "message": "message7893" + }, + { + "key": "key1893", + "message": "message7894" + }, + { + "key": "key1894", + "message": "message7895" + }, + { + "key": "key1895", + "message": "message7896" + }, + { + "key": "key1896", + "message": "message7897" + }, + { + "key": "key1897", + "message": "message7898" + }, + { + "key": "key1898", + "message": "message7899" + }, + { + "key": "key1899", + "message": "message7900" + }, + { + "key": "key1900", + "message": "message7901" + }, + { + "key": "key1901", + "message": "message7902" + }, + { + "key": "key1902", + "message": "message7903" + }, + { + "key": "key1903", + "message": "message7904" + }, + { + "key": "key1904", + "message": "message7905" + }, + { + "key": "key1905", + "message": "message7906" + }, + { + "key": "key1906", + "message": "message7907" + }, + { + "key": "key1907", + "message": "message7908" + }, + { + "key": "key1908", + "message": "message7909" + }, + { + "key": "key1909", + "message": "message7910" + }, + { + "key": "key1910", + "message": "message7911" + }, + { + "key": "key1911", + "message": "message7912" + }, + { + "key": "key1912", + "message": "message7913" + }, + { + "key": "key1913", + "message": "message7914" + }, + { + "key": "key1914", + "message": "message7915" + }, + { + "key": "key1915", + "message": "message7916" + }, + { + "key": "key1916", + "message": "message7917" + }, + { + "key": "key1917", + "message": "message7918" + }, + { + "key": "key1918", + "message": "message7919" + }, + { + "key": "key1919", + "message": "message7920" + }, + { + "key": "key1920", + "message": "message7921" + }, + { + "key": "key1921", + "message": "message7922" + }, + { + "key": "key1922", + "message": "message7923" + }, + { + "key": "key1923", + "message": "message7924" + }, + { + "key": "key1924", + "message": "message7925" + }, + { + "key": "key1925", + "message": "message7926" + }, + { + "key": "key1926", + "message": "message7927" + }, + { + "key": "key1927", + "message": "message7928" + }, + { + "key": "key1928", + "message": "message7929" + }, + { + "key": "key1929", + "message": "message7930" + }, + { + "key": "key1930", + "message": "message7931" + }, + { + "key": "key1931", + "message": "message7932" + }, + { + "key": "key1932", + "message": "message7933" + }, + { + "key": "key1933", + "message": "message7934" + }, + { + "key": "key1934", + "message": "message7935" + }, + { + "key": "key1935", + "message": "message7936" + }, + { + "key": "key1936", + "message": "message7937" + }, + { + "key": "key1937", + "message": "message7938" + }, + { + "key": "key1938", + "message": "message7939" + }, + { + "key": "key1939", + "message": "message7940" + }, + { + "key": "key1940", + "message": "message7941" + }, + { + "key": "key1941", + "message": "message7942" + }, + { + "key": "key1942", + "message": "message7943" + }, + { + "key": "key1943", + "message": "message7944" + }, + { + "key": "key1944", + "message": "message7945" + }, + { + "key": "key1945", + "message": "message7946" + }, + { + "key": "key1946", + "message": "message7947" + }, + { + "key": "key1947", + "message": "message7948" + }, + { + "key": "key1948", + "message": "message7949" + }, + { + "key": "key1949", + "message": "message7950" + }, + { + "key": "key1950", + "message": "message7951" + }, + { + "key": "key1951", + "message": "message7952" + }, + { + "key": "key1952", + "message": "message7953" + }, + { + "key": "key1953", + "message": "message7954" + }, + { + "key": "key1954", + "message": "message7955" + }, + { + "key": "key1955", + "message": "message7956" + }, + { + "key": "key1956", + "message": "message7957" + }, + { + "key": "key1957", + "message": "message7958" + }, + { + "key": "key1958", + "message": "message7959" + }, + { + "key": "key1959", + "message": "message7960" + }, + { + "key": "key1960", + "message": "message7961" + }, + { + "key": "key1961", + "message": "message7962" + }, + { + "key": "key1962", + "message": "message7963" + }, + { + "key": "key1963", + "message": "message7964" + }, + { + "key": "key1964", + "message": "message7965" + }, + { + "key": "key1965", + "message": "message7966" + }, + { + "key": "key1966", + "message": "message7967" + }, + { + "key": "key1967", + "message": "message7968" + }, + { + "key": "key1968", + "message": "message7969" + }, + { + "key": "key1969", + "message": "message7970" + }, + { + "key": "key1970", + "message": "message7971" + }, + { + "key": "key1971", + "message": "message7972" + }, + { + "key": "key1972", + "message": "message7973" + }, + { + "key": "key1973", + "message": "message7974" + }, + { + "key": "key1974", + "message": "message7975" + }, + { + "key": "key1975", + "message": "message7976" + }, + { + "key": "key1976", + "message": "message7977" + }, + { + "key": "key1977", + "message": "message7978" + }, + { + "key": "key1978", + "message": "message7979" + }, + { + "key": "key1979", + "message": "message7980" + }, + { + "key": "key1980", + "message": "message7981" + }, + { + "key": "key1981", + "message": "message7982" + }, + { + "key": "key1982", + "message": "message7983" + }, + { + "key": "key1983", + "message": "message7984" + }, + { + "key": "key1984", + "message": "message7985" + }, + { + "key": "key1985", + "message": "message7986" + }, + { + "key": "key1986", + "message": "message7987" + }, + { + "key": "key1987", + "message": "message7988" + }, + { + "key": "key1988", + "message": "message7989" + }, + { + "key": "key1989", + "message": "message7990" + }, + { + "key": "key1990", + "message": "message7991" + }, + { + "key": "key1991", + "message": "message7992" + }, + { + "key": "key1992", + "message": "message7993" + }, + { + "key": "key1993", + "message": "message7994" + }, + { + "key": "key1994", + "message": "message7995" + }, + { + "key": "key1995", + "message": "message7996" + }, + { + "key": "key1996", + "message": "message7997" + }, + { + "key": "key1997", + "message": "message7998" + }, + { + "key": "key1998", + "message": "message7999" + }, + { + "key": "key1999", + "message": "message8000" + }, + { + "key": "", + "message": "message8001" + }, + { + "key": "", + "message": "message8002" + }, + { + "key": "", + "message": "message8003" + }, + { + "key": "", + "message": "message8004" + }, + { + "key": "", + "message": "message8005" + }, + { + "key": "", + "message": "message8006_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8007" + }, + { + "key": "", + "message": "message8008" + }, + { + "key": "", + "message": "message8009" + }, + { + "key": "", + "message": "message8010" + }, + { + "key": "", + "message": "message8011" + }, + { + "key": "", + "message": "message8012" + }, + { + "key": "", + "message": "message8013" + }, + { + "key": "", + "message": "message8014" + }, + { + "key": "", + "message": "message8015" + }, + { + "key": "", + "message": "message8016_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8017" + }, + { + "key": "", + "message": "message8018" + }, + { + "key": "", + "message": "message8019" + }, + { + "key": "", + "message": "message8020" + }, + { + "key": "", + "message": "message8021" + }, + { + "key": "", + "message": "message8022" + }, + { + "key": "", + "message": "message8023" + }, + { + "key": "", + "message": "message8024" + }, + { + "key": "", + "message": "message8025" + }, + { + "key": "", + "message": "message8026_xxxxxxxxx" + }, + { + "key": "", + "message": "message8027" + }, + { + "key": "", + "message": "message8028" + }, + { + "key": "", + "message": "message8029" + }, + { + "key": "", + "message": "message8030" + }, + { + "key": "", + "message": "message8031" + }, + { + "key": "", + "message": "message8032" + }, + { + "key": "", + "message": "message8033" + }, + { + "key": "", + "message": "message8034" + }, + { + "key": "", + "message": "message8035" + }, + { + "key": "", + "message": "message8036_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8037" + }, + { + "key": "", + "message": "message8038" + }, + { + "key": "", + "message": "message8039" + }, + { + "key": "", + "message": "message8040" + }, + { + "key": "", + "message": "message8041" + }, + { + "key": "", + "message": "message8042" + }, + { + "key": "", + "message": "message8043" + }, + { + "key": "", + "message": "message8044" + }, + { + "key": "", + "message": "message8045" + }, + { + "key": "", + "message": "message8046_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8047" + }, + { + "key": "", + "message": "message8048" + }, + { + "key": "", + "message": "message8049" + }, + { + "key": "", + "message": "message8050" + }, + { + "key": "", + "message": "message8051" + }, + { + "key": "", + "message": "message8052" + }, + { + "key": "", + "message": "message8053" + }, + { + "key": "", + "message": "message8054" + }, + { + "key": "", + "message": "message8055" + }, + { + "key": "", + "message": "message8056_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8057" + }, + { + "key": "", + "message": "message8058" + }, + { + "key": "", + "message": "message8059" + }, + { + "key": "", + "message": "message8060" + }, + { + "key": "", + "message": "message8061" + }, + { + "key": "", + "message": "message8062" + }, + { + "key": "", + "message": "message8063" + }, + { + "key": "", + "message": "message8064" + }, + { + "key": "", + "message": "message8065" + }, + { + "key": "", + "message": "message8066_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8067" + }, + { + "key": "", + "message": "message8068" + }, + { + "key": "", + "message": "message8069" + }, + { + "key": "", + "message": "message8070" + }, + { + "key": "", + "message": "message8071" + }, + { + "key": "", + "message": "message8072" + }, + { + "key": "", + "message": "message8073" + }, + { + "key": "", + "message": "message8074" + }, + { + "key": "", + "message": "message8075" + }, + { + "key": "", + "message": "message8076_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8077" + }, + { + "key": "", + "message": "message8078" + }, + { + "key": "", + "message": "message8079" + }, + { + "key": "", + "message": "message8080" + }, + { + "key": "", + "message": "message8081" + }, + { + "key": "", + "message": "message8082" + }, + { + "key": "", + "message": "message8083" + }, + { + "key": "", + "message": "message8084" + }, + { + "key": "", + "message": "message8085" + }, + { + "key": "", + "message": "message8086_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8087" + }, + { + "key": "", + "message": "message8088" + }, + { + "key": "", + "message": "message8089" + }, + { + "key": "", + "message": "message8090" + }, + { + "key": "", + "message": "message8091" + }, + { + "key": "", + "message": "message8092" + }, + { + "key": "", + "message": "message8093" + }, + { + "key": "", + "message": "message8094" + }, + { + "key": "", + "message": "message8095" + }, + { + "key": "", + "message": "message8096_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8097" + }, + { + "key": "", + "message": "message8098" + }, + { + "key": "", + "message": "message8099" + }, + { + "key": "", + "message": "message8100_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8101" + }, + { + "key": "", + "message": "message8102" + }, + { + "key": "", + "message": "message8103" + }, + { + "key": "", + "message": "message8104" + }, + { + "key": "", + "message": "message8105" + }, + { + "key": "", + "message": "message8106_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8107" + }, + { + "key": "", + "message": "message8108" + }, + { + "key": "", + "message": "message8109" + }, + { + "key": "", + "message": "message8110" + }, + { + "key": "", + "message": "message8111" + }, + { + "key": "", + "message": "message8112" + }, + { + "key": "", + "message": "message8113" + }, + { + "key": "", + "message": "message8114" + }, + { + "key": "", + "message": "message8115" + }, + { + "key": "", + "message": "message8116_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8117" + }, + { + "key": "", + "message": "message8118" + }, + { + "key": "", + "message": "message8119" + }, + { + "key": "", + "message": "message8120" + }, + { + "key": "", + "message": "message8121" + }, + { + "key": "", + "message": "message8122" + }, + { + "key": "", + "message": "message8123" + }, + { + "key": "", + "message": "message8124" + }, + { + "key": "", + "message": "message8125" + }, + { + "key": "", + "message": "message8126_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8127" + }, + { + "key": "", + "message": "message8128" + }, + { + "key": "", + "message": "message8129" + }, + { + "key": "", + "message": "message8130" + }, + { + "key": "", + "message": "message8131" + }, + { + "key": "", + "message": "message8132" + }, + { + "key": "", + "message": "message8133" + }, + { + "key": "", + "message": "message8134" + }, + { + "key": "", + "message": "message8135" + }, + { + "key": "", + "message": "message8136_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8137" + }, + { + "key": "", + "message": "message8138" + }, + { + "key": "", + "message": "message8139" + }, + { + "key": "", + "message": "message8140" + }, + { + "key": "", + "message": "message8141" + }, + { + "key": "", + "message": "message8142" + }, + { + "key": "", + "message": "message8143" + }, + { + "key": "", + "message": "message8144" + }, + { + "key": "", + "message": "message8145" + }, + { + "key": "", + "message": "message8146_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8147" + }, + { + "key": "", + "message": "message8148" + }, + { + "key": "", + "message": "message8149" + }, + { + "key": "", + "message": "message8150" + }, + { + "key": "", + "message": "message8151" + }, + { + "key": "", + "message": "message8152" + }, + { + "key": "", + "message": "message8153" + }, + { + "key": "", + "message": "message8154" + }, + { + "key": "", + "message": "message8155" + }, + { + "key": "", + "message": "message8156_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8157" + }, + { + "key": "", + "message": "message8158" + }, + { + "key": "", + "message": "message8159" + }, + { + "key": "", + "message": "message8160" + }, + { + "key": "", + "message": "message8161" + }, + { + "key": "", + "message": "message8162" + }, + { + "key": "", + "message": "message8163" + }, + { + "key": "", + "message": "message8164" + }, + { + "key": "", + "message": "message8165" + }, + { + "key": "", + "message": "message8166_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8167" + }, + { + "key": "", + "message": "message8168" + }, + { + "key": "", + "message": "message8169" + }, + { + "key": "", + "message": "message8170" + }, + { + "key": "", + "message": "message8171" + }, + { + "key": "", + "message": "message8172" + }, + { + "key": "", + "message": "message8173" + }, + { + "key": "", + "message": "message8174" + }, + { + "key": "", + "message": "message8175" + }, + { + "key": "", + "message": "message8176_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8177" + }, + { + "key": "", + "message": "message8178" + }, + { + "key": "", + "message": "message8179" + }, + { + "key": "", + "message": "message8180" + }, + { + "key": "", + "message": "message8181" + }, + { + "key": "", + "message": "message8182" + }, + { + "key": "", + "message": "message8183" + }, + { + "key": "", + "message": "message8184" + }, + { + "key": "", + "message": "message8185" + }, + { + "key": "", + "message": "message8186_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8187" + }, + { + "key": "", + "message": "message8188" + }, + { + "key": "", + "message": "message8189" + }, + { + "key": "", + "message": "message8190" + }, + { + "key": "", + "message": "message8191" + }, + { + "key": "", + "message": "message8192" + }, + { + "key": "", + "message": "message8193" + }, + { + "key": "", + "message": "message8194" + }, + { + "key": "", + "message": "message8195" + }, + { + "key": "", + "message": "message8196_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8197" + }, + { + "key": "", + "message": "message8198" + }, + { + "key": "", + "message": "message8199" + }, + { + "key": "", + "message": "message8200_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8201" + }, + { + "key": "", + "message": "message8202" + }, + { + "key": "", + "message": "message8203" + }, + { + "key": "", + "message": "message8204" + }, + { + "key": "", + "message": "message8205" + }, + { + "key": "", + "message": "message8206_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8207" + }, + { + "key": "", + "message": "message8208" + }, + { + "key": "", + "message": "message8209" + }, + { + "key": "", + "message": "message8210" + }, + { + "key": "", + "message": "message8211" + }, + { + "key": "", + "message": "message8212" + }, + { + "key": "", + "message": "message8213" + }, + { + "key": "", + "message": "message8214" + }, + { + "key": "", + "message": "message8215" + }, + { + "key": "", + "message": "message8216_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8217" + }, + { + "key": "", + "message": "message8218" + }, + { + "key": "", + "message": "message8219" + }, + { + "key": "", + "message": "message8220" + }, + { + "key": "", + "message": "message8221" + }, + { + "key": "", + "message": "message8222" + }, + { + "key": "", + "message": "message8223" + }, + { + "key": "", + "message": "message8224" + }, + { + "key": "", + "message": "message8225" + }, + { + "key": "", + "message": "message8226_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8227" + }, + { + "key": "", + "message": "message8228" + }, + { + "key": "", + "message": "message8229" + }, + { + "key": "", + "message": "message8230" + }, + { + "key": "", + "message": "message8231" + }, + { + "key": "", + "message": "message8232" + }, + { + "key": "", + "message": "message8233" + }, + { + "key": "", + "message": "message8234" + }, + { + "key": "", + "message": "message8235" + }, + { + "key": "", + "message": "message8236_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8237" + }, + { + "key": "", + "message": "message8238" + }, + { + "key": "", + "message": "message8239" + }, + { + "key": "", + "message": "message8240" + }, + { + "key": "", + "message": "message8241" + }, + { + "key": "", + "message": "message8242" + }, + { + "key": "", + "message": "message8243" + }, + { + "key": "", + "message": "message8244" + }, + { + "key": "", + "message": "message8245" + }, + { + "key": "", + "message": "message8246_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8247" + }, + { + "key": "", + "message": "message8248" + }, + { + "key": "", + "message": "message8249" + }, + { + "key": "", + "message": "message8250" + }, + { + "key": "", + "message": "message8251" + }, + { + "key": "", + "message": "message8252" + }, + { + "key": "", + "message": "message8253" + }, + { + "key": "", + "message": "message8254" + }, + { + "key": "", + "message": "message8255" + }, + { + "key": "", + "message": "message8256_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8257" + }, + { + "key": "", + "message": "message8258" + }, + { + "key": "", + "message": "message8259" + }, + { + "key": "", + "message": "message8260" + }, + { + "key": "", + "message": "message8261" + }, + { + "key": "", + "message": "message8262" + }, + { + "key": "", + "message": "message8263" + }, + { + "key": "", + "message": "message8264" + }, + { + "key": "", + "message": "message8265" + }, + { + "key": "", + "message": "message8266_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8267" + }, + { + "key": "", + "message": "message8268" + }, + { + "key": "", + "message": "message8269" + }, + { + "key": "", + "message": "message8270" + }, + { + "key": "", + "message": "message8271" + }, + { + "key": "", + "message": "message8272" + }, + { + "key": "", + "message": "message8273" + }, + { + "key": "", + "message": "message8274" + }, + { + "key": "", + "message": "message8275" + }, + { + "key": "", + "message": "message8276_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8277" + }, + { + "key": "", + "message": "message8278" + }, + { + "key": "", + "message": "message8279" + }, + { + "key": "", + "message": "message8280" + }, + { + "key": "", + "message": "message8281" + }, + { + "key": "", + "message": "message8282" + }, + { + "key": "", + "message": "message8283" + }, + { + "key": "", + "message": "message8284" + }, + { + "key": "", + "message": "message8285" + }, + { + "key": "", + "message": "message8286_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8287" + }, + { + "key": "", + "message": "message8288" + }, + { + "key": "", + "message": "message8289" + }, + { + "key": "", + "message": "message8290" + }, + { + "key": "", + "message": "message8291" + }, + { + "key": "", + "message": "message8292" + }, + { + "key": "", + "message": "message8293" + }, + { + "key": "", + "message": "message8294" + }, + { + "key": "", + "message": "message8295" + }, + { + "key": "", + "message": "message8296_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8297" + }, + { + "key": "", + "message": "message8298" + }, + { + "key": "", + "message": "message8299" + }, + { + "key": "", + "message": "message8300_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8301" + }, + { + "key": "", + "message": "message8302" + }, + { + "key": "", + "message": "message8303" + }, + { + "key": "", + "message": "message8304" + }, + { + "key": "", + "message": "message8305" + }, + { + "key": "", + "message": "message8306_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8307" + }, + { + "key": "", + "message": "message8308" + }, + { + "key": "", + "message": "message8309" + }, + { + "key": "", + "message": "message8310" + }, + { + "key": "", + "message": "message8311" + }, + { + "key": "", + "message": "message8312" + }, + { + "key": "", + "message": "message8313" + }, + { + "key": "", + "message": "message8314" + }, + { + "key": "", + "message": "message8315" + }, + { + "key": "", + "message": "message8316_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8317" + }, + { + "key": "", + "message": "message8318" + }, + { + "key": "", + "message": "message8319" + }, + { + "key": "", + "message": "message8320" + }, + { + "key": "", + "message": "message8321" + }, + { + "key": "", + "message": "message8322" + }, + { + "key": "", + "message": "message8323" + }, + { + "key": "", + "message": "message8324" + }, + { + "key": "", + "message": "message8325" + }, + { + "key": "", + "message": "message8326_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8327" + }, + { + "key": "", + "message": "message8328" + }, + { + "key": "", + "message": "message8329" + }, + { + "key": "", + "message": "message8330" + }, + { + "key": "", + "message": "message8331" + }, + { + "key": "", + "message": "message8332" + }, + { + "key": "", + "message": "message8333" + }, + { + "key": "", + "message": "message8334" + }, + { + "key": "", + "message": "message8335" + }, + { + "key": "", + "message": "message8336_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8337" + }, + { + "key": "", + "message": "message8338" + }, + { + "key": "", + "message": "message8339" + }, + { + "key": "", + "message": "message8340" + }, + { + "key": "", + "message": "message8341" + }, + { + "key": "", + "message": "message8342" + }, + { + "key": "", + "message": "message8343" + }, + { + "key": "", + "message": "message8344" + }, + { + "key": "", + "message": "message8345" + }, + { + "key": "", + "message": "message8346_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8347" + }, + { + "key": "", + "message": "message8348" + }, + { + "key": "", + "message": "message8349" + }, + { + "key": "", + "message": "message8350" + }, + { + "key": "", + "message": "message8351" + }, + { + "key": "", + "message": "message8352" + }, + { + "key": "", + "message": "message8353" + }, + { + "key": "", + "message": "message8354" + }, + { + "key": "", + "message": "message8355" + }, + { + "key": "", + "message": "message8356_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8357" + }, + { + "key": "", + "message": "message8358" + }, + { + "key": "", + "message": "message8359" + }, + { + "key": "", + "message": "message8360" + }, + { + "key": "", + "message": "message8361" + }, + { + "key": "", + "message": "message8362" + }, + { + "key": "", + "message": "message8363" + }, + { + "key": "", + "message": "message8364" + }, + { + "key": "", + "message": "message8365" + }, + { + "key": "", + "message": "message8366_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8367" + }, + { + "key": "", + "message": "message8368" + }, + { + "key": "", + "message": "message8369" + }, + { + "key": "", + "message": "message8370" + }, + { + "key": "", + "message": "message8371" + }, + { + "key": "", + "message": "message8372" + }, + { + "key": "", + "message": "message8373" + }, + { + "key": "", + "message": "message8374" + }, + { + "key": "", + "message": "message8375" + }, + { + "key": "", + "message": "message8376_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8377" + }, + { + "key": "", + "message": "message8378" + }, + { + "key": "", + "message": "message8379" + }, + { + "key": "", + "message": "message8380" + }, + { + "key": "", + "message": "message8381" + }, + { + "key": "", + "message": "message8382" + }, + { + "key": "", + "message": "message8383" + }, + { + "key": "", + "message": "message8384" + }, + { + "key": "", + "message": "message8385" + }, + { + "key": "", + "message": "message8386_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8387" + }, + { + "key": "", + "message": "message8388" + }, + { + "key": "", + "message": "message8389" + }, + { + "key": "", + "message": "message8390" + }, + { + "key": "", + "message": "message8391" + }, + { + "key": "", + "message": "message8392" + }, + { + "key": "", + "message": "message8393" + }, + { + "key": "", + "message": "message8394" + }, + { + "key": "", + "message": "message8395" + }, + { + "key": "", + "message": "message8396_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "", + "message": "message8397" + }, + { + "key": "", + "message": "message8398" + }, + { + "key": "", + "message": "message8399" + }, + { + "key": "", + "message": "message8400_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8401" + }, + { + "key": "AAA", + "message": "message8402" + }, + { + "key": "AAA", + "message": "message8403" + }, + { + "key": "AAA", + "message": "message8404" + }, + { + "key": "AAA", + "message": "message8405" + }, + { + "key": "AAA", + "message": "message8406_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8407" + }, + { + "key": "AAA", + "message": "message8408" + }, + { + "key": "AAA", + "message": "message8409" + }, + { + "key": "AAA", + "message": "message8410" + }, + { + "key": "AAA", + "message": "message8411" + }, + { + "key": "AAA", + "message": "message8412" + }, + { + "key": "AAA", + "message": "message8413" + }, + { + "key": "AAA", + "message": "message8414" + }, + { + "key": "AAA", + "message": "message8415" + }, + { + "key": "AAA", + "message": "message8416_xxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8417" + }, + { + "key": "AAA", + "message": "message8418" + }, + { + "key": "AAA", + "message": "message8419" + }, + { + "key": "AAA", + "message": "message8420" + }, + { + "key": "AAA", + "message": "message8421" + }, + { + "key": "AAA", + "message": "message8422" + }, + { + "key": "AAA", + "message": "message8423" + }, + { + "key": "AAA", + "message": "message8424" + }, + { + "key": "AAA", + "message": "message8425" + }, + { + "key": "AAA", + "message": "message8426_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8427" + }, + { + "key": "AAA", + "message": "message8428" + }, + { + "key": "AAA", + "message": "message8429" + }, + { + "key": "AAA", + "message": "message8430" + }, + { + "key": "AAA", + "message": "message8431" + }, + { + "key": "AAA", + "message": "message8432" + }, + { + "key": "AAA", + "message": "message8433" + }, + { + "key": "AAA", + "message": "message8434" + }, + { + "key": "AAA", + "message": "message8435" + }, + { + "key": "AAA", + "message": "message8436_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8437" + }, + { + "key": "AAA", + "message": "message8438" + }, + { + "key": "AAA", + "message": "message8439" + }, + { + "key": "AAA", + "message": "message8440" + }, + { + "key": "AAA", + "message": "message8441" + }, + { + "key": "AAA", + "message": "message8442" + }, + { + "key": "AAA", + "message": "message8443" + }, + { + "key": "AAA", + "message": "message8444" + }, + { + "key": "AAA", + "message": "message8445" + }, + { + "key": "AAA", + "message": "message8446_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8447" + }, + { + "key": "AAA", + "message": "message8448" + }, + { + "key": "AAA", + "message": "message8449" + }, + { + "key": "AAA", + "message": "message8450" + }, + { + "key": "AAA", + "message": "message8451" + }, + { + "key": "AAA", + "message": "message8452" + }, + { + "key": "AAA", + "message": "message8453" + }, + { + "key": "AAA", + "message": "message8454" + }, + { + "key": "AAA", + "message": "message8455" + }, + { + "key": "AAA", + "message": "message8456_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8457" + }, + { + "key": "AAA", + "message": "message8458" + }, + { + "key": "AAA", + "message": "message8459" + }, + { + "key": "AAA", + "message": "message8460" + }, + { + "key": "AAA", + "message": "message8461" + }, + { + "key": "AAA", + "message": "message8462" + }, + { + "key": "AAA", + "message": "message8463" + }, + { + "key": "AAA", + "message": "message8464" + }, + { + "key": "AAA", + "message": "message8465" + }, + { + "key": "AAA", + "message": "message8466_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8467" + }, + { + "key": "AAA", + "message": "message8468" + }, + { + "key": "AAA", + "message": "message8469" + }, + { + "key": "AAA", + "message": "message8470" + }, + { + "key": "AAA", + "message": "message8471" + }, + { + "key": "AAA", + "message": "message8472" + }, + { + "key": "AAA", + "message": "message8473" + }, + { + "key": "AAA", + "message": "message8474" + }, + { + "key": "AAA", + "message": "message8475" + }, + { + "key": "AAA", + "message": "message8476_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8477" + }, + { + "key": "AAA", + "message": "message8478" + }, + { + "key": "AAA", + "message": "message8479" + }, + { + "key": "AAA", + "message": "message8480" + }, + { + "key": "AAA", + "message": "message8481" + }, + { + "key": "AAA", + "message": "message8482" + }, + { + "key": "AAA", + "message": "message8483" + }, + { + "key": "AAA", + "message": "message8484" + }, + { + "key": "AAA", + "message": "message8485" + }, + { + "key": "AAA", + "message": "message8486_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8487" + }, + { + "key": "AAA", + "message": "message8488" + }, + { + "key": "AAA", + "message": "message8489" + }, + { + "key": "AAA", + "message": "message8490" + }, + { + "key": "AAA", + "message": "message8491" + }, + { + "key": "AAA", + "message": "message8492" + }, + { + "key": "AAA", + "message": "message8493" + }, + { + "key": "AAA", + "message": "message8494" + }, + { + "key": "AAA", + "message": "message8495" + }, + { + "key": "AAA", + "message": "message8496_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8497" + }, + { + "key": "AAA", + "message": "message8498" + }, + { + "key": "AAA", + "message": "message8499" + }, + { + "key": "AAA", + "message": "message8500_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8501" + }, + { + "key": "AAA", + "message": "message8502" + }, + { + "key": "AAA", + "message": "message8503" + }, + { + "key": "AAA", + "message": "message8504" + }, + { + "key": "AAA", + "message": "message8505" + }, + { + "key": "AAA", + "message": "message8506_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8507" + }, + { + "key": "AAA", + "message": "message8508" + }, + { + "key": "AAA", + "message": "message8509" + }, + { + "key": "AAA", + "message": "message8510" + }, + { + "key": "AAA", + "message": "message8511" + }, + { + "key": "AAA", + "message": "message8512" + }, + { + "key": "AAA", + "message": "message8513" + }, + { + "key": "AAA", + "message": "message8514" + }, + { + "key": "AAA", + "message": "message8515" + }, + { + "key": "AAA", + "message": "message8516_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8517" + }, + { + "key": "AAA", + "message": "message8518" + }, + { + "key": "AAA", + "message": "message8519" + }, + { + "key": "AAA", + "message": "message8520" + }, + { + "key": "AAA", + "message": "message8521" + }, + { + "key": "AAA", + "message": "message8522" + }, + { + "key": "AAA", + "message": "message8523" + }, + { + "key": "AAA", + "message": "message8524" + }, + { + "key": "AAA", + "message": "message8525" + }, + { + "key": "AAA", + "message": "message8526_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8527" + }, + { + "key": "AAA", + "message": "message8528" + }, + { + "key": "AAA", + "message": "message8529" + }, + { + "key": "AAA", + "message": "message8530" + }, + { + "key": "AAA", + "message": "message8531" + }, + { + "key": "AAA", + "message": "message8532" + }, + { + "key": "AAA", + "message": "message8533" + }, + { + "key": "AAA", + "message": "message8534" + }, + { + "key": "AAA", + "message": "message8535" + }, + { + "key": "AAA", + "message": "message8536_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8537" + }, + { + "key": "AAA", + "message": "message8538" + }, + { + "key": "AAA", + "message": "message8539" + }, + { + "key": "AAA", + "message": "message8540" + }, + { + "key": "AAA", + "message": "message8541" + }, + { + "key": "AAA", + "message": "message8542" + }, + { + "key": "AAA", + "message": "message8543" + }, + { + "key": "AAA", + "message": "message8544" + }, + { + "key": "AAA", + "message": "message8545" + }, + { + "key": "AAA", + "message": "message8546_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8547" + }, + { + "key": "AAA", + "message": "message8548" + }, + { + "key": "AAA", + "message": "message8549" + }, + { + "key": "AAA", + "message": "message8550" + }, + { + "key": "AAA", + "message": "message8551" + }, + { + "key": "AAA", + "message": "message8552" + }, + { + "key": "AAA", + "message": "message8553" + }, + { + "key": "AAA", + "message": "message8554" + }, + { + "key": "AAA", + "message": "message8555" + }, + { + "key": "AAA", + "message": "message8556_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8557" + }, + { + "key": "AAA", + "message": "message8558" + }, + { + "key": "AAA", + "message": "message8559" + }, + { + "key": "AAA", + "message": "message8560" + }, + { + "key": "AAA", + "message": "message8561" + }, + { + "key": "AAA", + "message": "message8562" + }, + { + "key": "AAA", + "message": "message8563" + }, + { + "key": "AAA", + "message": "message8564" + }, + { + "key": "AAA", + "message": "message8565" + }, + { + "key": "AAA", + "message": "message8566_xxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8567" + }, + { + "key": "AAA", + "message": "message8568" + }, + { + "key": "AAA", + "message": "message8569" + }, + { + "key": "AAA", + "message": "message8570" + }, + { + "key": "AAA", + "message": "message8571" + }, + { + "key": "AAA", + "message": "message8572" + }, + { + "key": "AAA", + "message": "message8573" + }, + { + "key": "AAA", + "message": "message8574" + }, + { + "key": "AAA", + "message": "message8575" + }, + { + "key": "AAA", + "message": "message8576_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8577" + }, + { + "key": "AAA", + "message": "message8578" + }, + { + "key": "AAA", + "message": "message8579" + }, + { + "key": "AAA", + "message": "message8580" + }, + { + "key": "AAA", + "message": "message8581" + }, + { + "key": "AAA", + "message": "message8582" + }, + { + "key": "AAA", + "message": "message8583" + }, + { + "key": "AAA", + "message": "message8584" + }, + { + "key": "AAA", + "message": "message8585" + }, + { + "key": "AAA", + "message": "message8586_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8587" + }, + { + "key": "AAA", + "message": "message8588" + }, + { + "key": "AAA", + "message": "message8589" + }, + { + "key": "AAA", + "message": "message8590" + }, + { + "key": "AAA", + "message": "message8591" + }, + { + "key": "AAA", + "message": "message8592" + }, + { + "key": "AAA", + "message": "message8593" + }, + { + "key": "AAA", + "message": "message8594" + }, + { + "key": "AAA", + "message": "message8595" + }, + { + "key": "AAA", + "message": "message8596_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8597" + }, + { + "key": "AAA", + "message": "message8598" + }, + { + "key": "AAA", + "message": "message8599" + }, + { + "key": "AAA", + "message": "message8600_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8601" + }, + { + "key": "AAA", + "message": "message8602" + }, + { + "key": "AAA", + "message": "message8603" + }, + { + "key": "AAA", + "message": "message8604" + }, + { + "key": "AAA", + "message": "message8605" + }, + { + "key": "AAA", + "message": "message8606_xxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8607" + }, + { + "key": "AAA", + "message": "message8608" + }, + { + "key": "AAA", + "message": "message8609" + }, + { + "key": "AAA", + "message": "message8610" + }, + { + "key": "AAA", + "message": "message8611" + }, + { + "key": "AAA", + "message": "message8612" + }, + { + "key": "AAA", + "message": "message8613" + }, + { + "key": "AAA", + "message": "message8614" + }, + { + "key": "AAA", + "message": "message8615" + }, + { + "key": "AAA", + "message": "message8616_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8617" + }, + { + "key": "AAA", + "message": "message8618" + }, + { + "key": "AAA", + "message": "message8619" + }, + { + "key": "AAA", + "message": "message8620" + }, + { + "key": "AAA", + "message": "message8621" + }, + { + "key": "AAA", + "message": "message8622" + }, + { + "key": "AAA", + "message": "message8623" + }, + { + "key": "AAA", + "message": "message8624" + }, + { + "key": "AAA", + "message": "message8625" + }, + { + "key": "AAA", + "message": "message8626_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8627" + }, + { + "key": "AAA", + "message": "message8628" + }, + { + "key": "AAA", + "message": "message8629" + }, + { + "key": "AAA", + "message": "message8630" + }, + { + "key": "AAA", + "message": "message8631" + }, + { + "key": "AAA", + "message": "message8632" + }, + { + "key": "AAA", + "message": "message8633" + }, + { + "key": "AAA", + "message": "message8634" + }, + { + "key": "AAA", + "message": "message8635" + }, + { + "key": "AAA", + "message": "message8636_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8637" + }, + { + "key": "AAA", + "message": "message8638" + }, + { + "key": "AAA", + "message": "message8639" + }, + { + "key": "AAA", + "message": "message8640" + }, + { + "key": "AAA", + "message": "message8641" + }, + { + "key": "AAA", + "message": "message8642" + }, + { + "key": "AAA", + "message": "message8643" + }, + { + "key": "AAA", + "message": "message8644" + }, + { + "key": "AAA", + "message": "message8645" + }, + { + "key": "AAA", + "message": "message8646_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8647" + }, + { + "key": "AAA", + "message": "message8648" + }, + { + "key": "AAA", + "message": "message8649" + }, + { + "key": "AAA", + "message": "message8650" + }, + { + "key": "AAA", + "message": "message8651" + }, + { + "key": "AAA", + "message": "message8652" + }, + { + "key": "AAA", + "message": "message8653" + }, + { + "key": "AAA", + "message": "message8654" + }, + { + "key": "AAA", + "message": "message8655" + }, + { + "key": "AAA", + "message": "message8656_xxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8657" + }, + { + "key": "AAA", + "message": "message8658" + }, + { + "key": "AAA", + "message": "message8659" + }, + { + "key": "AAA", + "message": "message8660" + }, + { + "key": "AAA", + "message": "message8661" + }, + { + "key": "AAA", + "message": "message8662" + }, + { + "key": "AAA", + "message": "message8663" + }, + { + "key": "AAA", + "message": "message8664" + }, + { + "key": "AAA", + "message": "message8665" + }, + { + "key": "AAA", + "message": "message8666_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8667" + }, + { + "key": "AAA", + "message": "message8668" + }, + { + "key": "AAA", + "message": "message8669" + }, + { + "key": "AAA", + "message": "message8670" + }, + { + "key": "AAA", + "message": "message8671" + }, + { + "key": "AAA", + "message": "message8672" + }, + { + "key": "AAA", + "message": "message8673" + }, + { + "key": "AAA", + "message": "message8674" + }, + { + "key": "AAA", + "message": "message8675" + }, + { + "key": "AAA", + "message": "message8676_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8677" + }, + { + "key": "AAA", + "message": "message8678" + }, + { + "key": "AAA", + "message": "message8679" + }, + { + "key": "AAA", + "message": "message8680" + }, + { + "key": "AAA", + "message": "message8681" + }, + { + "key": "AAA", + "message": "message8682" + }, + { + "key": "AAA", + "message": "message8683" + }, + { + "key": "AAA", + "message": "message8684" + }, + { + "key": "AAA", + "message": "message8685" + }, + { + "key": "AAA", + "message": "message8686_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8687" + }, + { + "key": "AAA", + "message": "message8688" + }, + { + "key": "AAA", + "message": "message8689" + }, + { + "key": "AAA", + "message": "message8690" + }, + { + "key": "AAA", + "message": "message8691" + }, + { + "key": "AAA", + "message": "message8692" + }, + { + "key": "AAA", + "message": "message8693" + }, + { + "key": "AAA", + "message": "message8694" + }, + { + "key": "AAA", + "message": "message8695" + }, + { + "key": "AAA", + "message": "message8696_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8697" + }, + { + "key": "AAA", + "message": "message8698" + }, + { + "key": "AAA", + "message": "message8699" + }, + { + "key": "AAA", + "message": "message8700_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8701" + }, + { + "key": "AAA", + "message": "message8702" + }, + { + "key": "AAA", + "message": "message8703" + }, + { + "key": "AAA", + "message": "message8704" + }, + { + "key": "AAA", + "message": "message8705" + }, + { + "key": "AAA", + "message": "message8706_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8707" + }, + { + "key": "AAA", + "message": "message8708" + }, + { + "key": "AAA", + "message": "message8709" + }, + { + "key": "AAA", + "message": "message8710" + }, + { + "key": "AAA", + "message": "message8711" + }, + { + "key": "AAA", + "message": "message8712" + }, + { + "key": "AAA", + "message": "message8713" + }, + { + "key": "AAA", + "message": "message8714" + }, + { + "key": "AAA", + "message": "message8715" + }, + { + "key": "AAA", + "message": "message8716_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8717" + }, + { + "key": "AAA", + "message": "message8718" + }, + { + "key": "AAA", + "message": "message8719" + }, + { + "key": "AAA", + "message": "message8720" + }, + { + "key": "AAA", + "message": "message8721" + }, + { + "key": "AAA", + "message": "message8722" + }, + { + "key": "AAA", + "message": "message8723" + }, + { + "key": "AAA", + "message": "message8724" + }, + { + "key": "AAA", + "message": "message8725" + }, + { + "key": "AAA", + "message": "message8726_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8727" + }, + { + "key": "AAA", + "message": "message8728" + }, + { + "key": "AAA", + "message": "message8729" + }, + { + "key": "AAA", + "message": "message8730" + }, + { + "key": "AAA", + "message": "message8731" + }, + { + "key": "AAA", + "message": "message8732" + }, + { + "key": "AAA", + "message": "message8733" + }, + { + "key": "AAA", + "message": "message8734" + }, + { + "key": "AAA", + "message": "message8735" + }, + { + "key": "AAA", + "message": "message8736_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8737" + }, + { + "key": "AAA", + "message": "message8738" + }, + { + "key": "AAA", + "message": "message8739" + }, + { + "key": "AAA", + "message": "message8740" + }, + { + "key": "AAA", + "message": "message8741" + }, + { + "key": "AAA", + "message": "message8742" + }, + { + "key": "AAA", + "message": "message8743" + }, + { + "key": "AAA", + "message": "message8744" + }, + { + "key": "AAA", + "message": "message8745" + }, + { + "key": "AAA", + "message": "message8746_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8747" + }, + { + "key": "AAA", + "message": "message8748" + }, + { + "key": "AAA", + "message": "message8749" + }, + { + "key": "AAA", + "message": "message8750" + }, + { + "key": "AAA", + "message": "message8751" + }, + { + "key": "AAA", + "message": "message8752" + }, + { + "key": "AAA", + "message": "message8753" + }, + { + "key": "AAA", + "message": "message8754" + }, + { + "key": "AAA", + "message": "message8755" + }, + { + "key": "AAA", + "message": "message8756_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8757" + }, + { + "key": "AAA", + "message": "message8758" + }, + { + "key": "AAA", + "message": "message8759" + }, + { + "key": "AAA", + "message": "message8760" + }, + { + "key": "AAA", + "message": "message8761" + }, + { + "key": "AAA", + "message": "message8762" + }, + { + "key": "AAA", + "message": "message8763" + }, + { + "key": "AAA", + "message": "message8764" + }, + { + "key": "AAA", + "message": "message8765" + }, + { + "key": "AAA", + "message": "message8766_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8767" + }, + { + "key": "AAA", + "message": "message8768" + }, + { + "key": "AAA", + "message": "message8769" + }, + { + "key": "AAA", + "message": "message8770" + }, + { + "key": "AAA", + "message": "message8771" + }, + { + "key": "AAA", + "message": "message8772" + }, + { + "key": "AAA", + "message": "message8773" + }, + { + "key": "AAA", + "message": "message8774" + }, + { + "key": "AAA", + "message": "message8775" + }, + { + "key": "AAA", + "message": "message8776_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8777" + }, + { + "key": "AAA", + "message": "message8778" + }, + { + "key": "AAA", + "message": "message8779" + }, + { + "key": "AAA", + "message": "message8780" + }, + { + "key": "AAA", + "message": "message8781" + }, + { + "key": "AAA", + "message": "message8782" + }, + { + "key": "AAA", + "message": "message8783" + }, + { + "key": "AAA", + "message": "message8784" + }, + { + "key": "AAA", + "message": "message8785" + }, + { + "key": "AAA", + "message": "message8786_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8787" + }, + { + "key": "AAA", + "message": "message8788" + }, + { + "key": "AAA", + "message": "message8789" + }, + { + "key": "AAA", + "message": "message8790" + }, + { + "key": "AAA", + "message": "message8791" + }, + { + "key": "AAA", + "message": "message8792" + }, + { + "key": "AAA", + "message": "message8793" + }, + { + "key": "AAA", + "message": "message8794" + }, + { + "key": "AAA", + "message": "message8795" + }, + { + "key": "AAA", + "message": "message8796_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "AAA", + "message": "message8797" + }, + { + "key": "AAA", + "message": "message8798" + }, + { + "key": "AAA", + "message": "message8799" + }, + { + "key": "AAA", + "message": "message8800_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8801" + }, + { + "key": "BBB", + "message": "message8802" + }, + { + "key": "BBB", + "message": "message8803" + }, + { + "key": "BBB", + "message": "message8804" + }, + { + "key": "BBB", + "message": "message8805" + }, + { + "key": "BBB", + "message": "message8806_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8807" + }, + { + "key": "BBB", + "message": "message8808" + }, + { + "key": "BBB", + "message": "message8809" + }, + { + "key": "BBB", + "message": "message8810" + }, + { + "key": "BBB", + "message": "message8811" + }, + { + "key": "BBB", + "message": "message8812" + }, + { + "key": "BBB", + "message": "message8813" + }, + { + "key": "BBB", + "message": "message8814" + }, + { + "key": "BBB", + "message": "message8815" + }, + { + "key": "BBB", + "message": "message8816_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8817" + }, + { + "key": "BBB", + "message": "message8818" + }, + { + "key": "BBB", + "message": "message8819" + }, + { + "key": "BBB", + "message": "message8820" + }, + { + "key": "BBB", + "message": "message8821" + }, + { + "key": "BBB", + "message": "message8822" + }, + { + "key": "BBB", + "message": "message8823" + }, + { + "key": "BBB", + "message": "message8824" + }, + { + "key": "BBB", + "message": "message8825" + }, + { + "key": "BBB", + "message": "message8826_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8827" + }, + { + "key": "BBB", + "message": "message8828" + }, + { + "key": "BBB", + "message": "message8829" + }, + { + "key": "BBB", + "message": "message8830" + }, + { + "key": "BBB", + "message": "message8831" + }, + { + "key": "BBB", + "message": "message8832" + }, + { + "key": "BBB", + "message": "message8833" + }, + { + "key": "BBB", + "message": "message8834" + }, + { + "key": "BBB", + "message": "message8835" + }, + { + "key": "BBB", + "message": "message8836_xxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8837" + }, + { + "key": "BBB", + "message": "message8838" + }, + { + "key": "BBB", + "message": "message8839" + }, + { + "key": "BBB", + "message": "message8840" + }, + { + "key": "BBB", + "message": "message8841" + }, + { + "key": "BBB", + "message": "message8842" + }, + { + "key": "BBB", + "message": "message8843" + }, + { + "key": "BBB", + "message": "message8844" + }, + { + "key": "BBB", + "message": "message8845" + }, + { + "key": "BBB", + "message": "message8846_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8847" + }, + { + "key": "BBB", + "message": "message8848" + }, + { + "key": "BBB", + "message": "message8849" + }, + { + "key": "BBB", + "message": "message8850" + }, + { + "key": "BBB", + "message": "message8851" + }, + { + "key": "BBB", + "message": "message8852" + }, + { + "key": "BBB", + "message": "message8853" + }, + { + "key": "BBB", + "message": "message8854" + }, + { + "key": "BBB", + "message": "message8855" + }, + { + "key": "BBB", + "message": "message8856_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8857" + }, + { + "key": "BBB", + "message": "message8858" + }, + { + "key": "BBB", + "message": "message8859" + }, + { + "key": "BBB", + "message": "message8860" + }, + { + "key": "BBB", + "message": "message8861" + }, + { + "key": "BBB", + "message": "message8862" + }, + { + "key": "BBB", + "message": "message8863" + }, + { + "key": "BBB", + "message": "message8864" + }, + { + "key": "BBB", + "message": "message8865" + }, + { + "key": "BBB", + "message": "message8866_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8867" + }, + { + "key": "BBB", + "message": "message8868" + }, + { + "key": "BBB", + "message": "message8869" + }, + { + "key": "BBB", + "message": "message8870" + }, + { + "key": "BBB", + "message": "message8871" + }, + { + "key": "BBB", + "message": "message8872" + }, + { + "key": "BBB", + "message": "message8873" + }, + { + "key": "BBB", + "message": "message8874" + }, + { + "key": "BBB", + "message": "message8875" + }, + { + "key": "BBB", + "message": "message8876_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8877" + }, + { + "key": "BBB", + "message": "message8878" + }, + { + "key": "BBB", + "message": "message8879" + }, + { + "key": "BBB", + "message": "message8880" + }, + { + "key": "BBB", + "message": "message8881" + }, + { + "key": "BBB", + "message": "message8882" + }, + { + "key": "BBB", + "message": "message8883" + }, + { + "key": "BBB", + "message": "message8884" + }, + { + "key": "BBB", + "message": "message8885" + }, + { + "key": "BBB", + "message": "message8886_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8887" + }, + { + "key": "BBB", + "message": "message8888" + }, + { + "key": "BBB", + "message": "message8889" + }, + { + "key": "BBB", + "message": "message8890" + }, + { + "key": "BBB", + "message": "message8891" + }, + { + "key": "BBB", + "message": "message8892" + }, + { + "key": "BBB", + "message": "message8893" + }, + { + "key": "BBB", + "message": "message8894" + }, + { + "key": "BBB", + "message": "message8895" + }, + { + "key": "BBB", + "message": "message8896_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8897" + }, + { + "key": "BBB", + "message": "message8898" + }, + { + "key": "BBB", + "message": "message8899" + }, + { + "key": "BBB", + "message": "message8900_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8901" + }, + { + "key": "BBB", + "message": "message8902" + }, + { + "key": "BBB", + "message": "message8903" + }, + { + "key": "BBB", + "message": "message8904" + }, + { + "key": "BBB", + "message": "message8905" + }, + { + "key": "BBB", + "message": "message8906_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8907" + }, + { + "key": "BBB", + "message": "message8908" + }, + { + "key": "BBB", + "message": "message8909" + }, + { + "key": "BBB", + "message": "message8910" + }, + { + "key": "BBB", + "message": "message8911" + }, + { + "key": "BBB", + "message": "message8912" + }, + { + "key": "BBB", + "message": "message8913" + }, + { + "key": "BBB", + "message": "message8914" + }, + { + "key": "BBB", + "message": "message8915" + }, + { + "key": "BBB", + "message": "message8916_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8917" + }, + { + "key": "BBB", + "message": "message8918" + }, + { + "key": "BBB", + "message": "message8919" + }, + { + "key": "BBB", + "message": "message8920" + }, + { + "key": "BBB", + "message": "message8921" + }, + { + "key": "BBB", + "message": "message8922" + }, + { + "key": "BBB", + "message": "message8923" + }, + { + "key": "BBB", + "message": "message8924" + }, + { + "key": "BBB", + "message": "message8925" + }, + { + "key": "BBB", + "message": "message8926_xxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8927" + }, + { + "key": "BBB", + "message": "message8928" + }, + { + "key": "BBB", + "message": "message8929" + }, + { + "key": "BBB", + "message": "message8930" + }, + { + "key": "BBB", + "message": "message8931" + }, + { + "key": "BBB", + "message": "message8932" + }, + { + "key": "BBB", + "message": "message8933" + }, + { + "key": "BBB", + "message": "message8934" + }, + { + "key": "BBB", + "message": "message8935" + }, + { + "key": "BBB", + "message": "message8936_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8937" + }, + { + "key": "BBB", + "message": "message8938" + }, + { + "key": "BBB", + "message": "message8939" + }, + { + "key": "BBB", + "message": "message8940" + }, + { + "key": "BBB", + "message": "message8941" + }, + { + "key": "BBB", + "message": "message8942" + }, + { + "key": "BBB", + "message": "message8943" + }, + { + "key": "BBB", + "message": "message8944" + }, + { + "key": "BBB", + "message": "message8945" + }, + { + "key": "BBB", + "message": "message8946_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8947" + }, + { + "key": "BBB", + "message": "message8948" + }, + { + "key": "BBB", + "message": "message8949" + }, + { + "key": "BBB", + "message": "message8950" + }, + { + "key": "BBB", + "message": "message8951" + }, + { + "key": "BBB", + "message": "message8952" + }, + { + "key": "BBB", + "message": "message8953" + }, + { + "key": "BBB", + "message": "message8954" + }, + { + "key": "BBB", + "message": "message8955" + }, + { + "key": "BBB", + "message": "message8956_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8957" + }, + { + "key": "BBB", + "message": "message8958" + }, + { + "key": "BBB", + "message": "message8959" + }, + { + "key": "BBB", + "message": "message8960" + }, + { + "key": "BBB", + "message": "message8961" + }, + { + "key": "BBB", + "message": "message8962" + }, + { + "key": "BBB", + "message": "message8963" + }, + { + "key": "BBB", + "message": "message8964" + }, + { + "key": "BBB", + "message": "message8965" + }, + { + "key": "BBB", + "message": "message8966_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8967" + }, + { + "key": "BBB", + "message": "message8968" + }, + { + "key": "BBB", + "message": "message8969" + }, + { + "key": "BBB", + "message": "message8970" + }, + { + "key": "BBB", + "message": "message8971" + }, + { + "key": "BBB", + "message": "message8972" + }, + { + "key": "BBB", + "message": "message8973" + }, + { + "key": "BBB", + "message": "message8974" + }, + { + "key": "BBB", + "message": "message8975" + }, + { + "key": "BBB", + "message": "message8976_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8977" + }, + { + "key": "BBB", + "message": "message8978" + }, + { + "key": "BBB", + "message": "message8979" + }, + { + "key": "BBB", + "message": "message8980" + }, + { + "key": "BBB", + "message": "message8981" + }, + { + "key": "BBB", + "message": "message8982" + }, + { + "key": "BBB", + "message": "message8983" + }, + { + "key": "BBB", + "message": "message8984" + }, + { + "key": "BBB", + "message": "message8985" + }, + { + "key": "BBB", + "message": "message8986_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8987" + }, + { + "key": "BBB", + "message": "message8988" + }, + { + "key": "BBB", + "message": "message8989" + }, + { + "key": "BBB", + "message": "message8990" + }, + { + "key": "BBB", + "message": "message8991" + }, + { + "key": "BBB", + "message": "message8992" + }, + { + "key": "BBB", + "message": "message8993" + }, + { + "key": "BBB", + "message": "message8994" + }, + { + "key": "BBB", + "message": "message8995" + }, + { + "key": "BBB", + "message": "message8996_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message8997" + }, + { + "key": "BBB", + "message": "message8998" + }, + { + "key": "BBB", + "message": "message8999" + }, + { + "key": "BBB", + "message": "message9000_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9001" + }, + { + "key": "BBB", + "message": "message9002" + }, + { + "key": "BBB", + "message": "message9003" + }, + { + "key": "BBB", + "message": "message9004" + }, + { + "key": "BBB", + "message": "message9005" + }, + { + "key": "BBB", + "message": "message9006_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9007" + }, + { + "key": "BBB", + "message": "message9008" + }, + { + "key": "BBB", + "message": "message9009" + }, + { + "key": "BBB", + "message": "message9010" + }, + { + "key": "BBB", + "message": "message9011" + }, + { + "key": "BBB", + "message": "message9012" + }, + { + "key": "BBB", + "message": "message9013" + }, + { + "key": "BBB", + "message": "message9014" + }, + { + "key": "BBB", + "message": "message9015" + }, + { + "key": "BBB", + "message": "message9016_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9017" + }, + { + "key": "BBB", + "message": "message9018" + }, + { + "key": "BBB", + "message": "message9019" + }, + { + "key": "BBB", + "message": "message9020" + }, + { + "key": "BBB", + "message": "message9021" + }, + { + "key": "BBB", + "message": "message9022" + }, + { + "key": "BBB", + "message": "message9023" + }, + { + "key": "BBB", + "message": "message9024" + }, + { + "key": "BBB", + "message": "message9025" + }, + { + "key": "BBB", + "message": "message9026_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9027" + }, + { + "key": "BBB", + "message": "message9028" + }, + { + "key": "BBB", + "message": "message9029" + }, + { + "key": "BBB", + "message": "message9030" + }, + { + "key": "BBB", + "message": "message9031" + }, + { + "key": "BBB", + "message": "message9032" + }, + { + "key": "BBB", + "message": "message9033" + }, + { + "key": "BBB", + "message": "message9034" + }, + { + "key": "BBB", + "message": "message9035" + }, + { + "key": "BBB", + "message": "message9036_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9037" + }, + { + "key": "BBB", + "message": "message9038" + }, + { + "key": "BBB", + "message": "message9039" + }, + { + "key": "BBB", + "message": "message9040" + }, + { + "key": "BBB", + "message": "message9041" + }, + { + "key": "BBB", + "message": "message9042" + }, + { + "key": "BBB", + "message": "message9043" + }, + { + "key": "BBB", + "message": "message9044" + }, + { + "key": "BBB", + "message": "message9045" + }, + { + "key": "BBB", + "message": "message9046_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9047" + }, + { + "key": "BBB", + "message": "message9048" + }, + { + "key": "BBB", + "message": "message9049" + }, + { + "key": "BBB", + "message": "message9050" + }, + { + "key": "BBB", + "message": "message9051" + }, + { + "key": "BBB", + "message": "message9052" + }, + { + "key": "BBB", + "message": "message9053" + }, + { + "key": "BBB", + "message": "message9054" + }, + { + "key": "BBB", + "message": "message9055" + }, + { + "key": "BBB", + "message": "message9056_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9057" + }, + { + "key": "BBB", + "message": "message9058" + }, + { + "key": "BBB", + "message": "message9059" + }, + { + "key": "BBB", + "message": "message9060" + }, + { + "key": "BBB", + "message": "message9061" + }, + { + "key": "BBB", + "message": "message9062" + }, + { + "key": "BBB", + "message": "message9063" + }, + { + "key": "BBB", + "message": "message9064" + }, + { + "key": "BBB", + "message": "message9065" + }, + { + "key": "BBB", + "message": "message9066_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9067" + }, + { + "key": "BBB", + "message": "message9068" + }, + { + "key": "BBB", + "message": "message9069" + }, + { + "key": "BBB", + "message": "message9070" + }, + { + "key": "BBB", + "message": "message9071" + }, + { + "key": "BBB", + "message": "message9072" + }, + { + "key": "BBB", + "message": "message9073" + }, + { + "key": "BBB", + "message": "message9074" + }, + { + "key": "BBB", + "message": "message9075" + }, + { + "key": "BBB", + "message": "message9076_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9077" + }, + { + "key": "BBB", + "message": "message9078" + }, + { + "key": "BBB", + "message": "message9079" + }, + { + "key": "BBB", + "message": "message9080" + }, + { + "key": "BBB", + "message": "message9081" + }, + { + "key": "BBB", + "message": "message9082" + }, + { + "key": "BBB", + "message": "message9083" + }, + { + "key": "BBB", + "message": "message9084" + }, + { + "key": "BBB", + "message": "message9085" + }, + { + "key": "BBB", + "message": "message9086_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9087" + }, + { + "key": "BBB", + "message": "message9088" + }, + { + "key": "BBB", + "message": "message9089" + }, + { + "key": "BBB", + "message": "message9090" + }, + { + "key": "BBB", + "message": "message9091" + }, + { + "key": "BBB", + "message": "message9092" + }, + { + "key": "BBB", + "message": "message9093" + }, + { + "key": "BBB", + "message": "message9094" + }, + { + "key": "BBB", + "message": "message9095" + }, + { + "key": "BBB", + "message": "message9096_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9097" + }, + { + "key": "BBB", + "message": "message9098" + }, + { + "key": "BBB", + "message": "message9099" + }, + { + "key": "BBB", + "message": "message9100_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9101" + }, + { + "key": "BBB", + "message": "message9102" + }, + { + "key": "BBB", + "message": "message9103" + }, + { + "key": "BBB", + "message": "message9104" + }, + { + "key": "BBB", + "message": "message9105" + }, + { + "key": "BBB", + "message": "message9106_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9107" + }, + { + "key": "BBB", + "message": "message9108" + }, + { + "key": "BBB", + "message": "message9109" + }, + { + "key": "BBB", + "message": "message9110" + }, + { + "key": "BBB", + "message": "message9111" + }, + { + "key": "BBB", + "message": "message9112" + }, + { + "key": "BBB", + "message": "message9113" + }, + { + "key": "BBB", + "message": "message9114" + }, + { + "key": "BBB", + "message": "message9115" + }, + { + "key": "BBB", + "message": "message9116_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9117" + }, + { + "key": "BBB", + "message": "message9118" + }, + { + "key": "BBB", + "message": "message9119" + }, + { + "key": "BBB", + "message": "message9120" + }, + { + "key": "BBB", + "message": "message9121" + }, + { + "key": "BBB", + "message": "message9122" + }, + { + "key": "BBB", + "message": "message9123" + }, + { + "key": "BBB", + "message": "message9124" + }, + { + "key": "BBB", + "message": "message9125" + }, + { + "key": "BBB", + "message": "message9126_xxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9127" + }, + { + "key": "BBB", + "message": "message9128" + }, + { + "key": "BBB", + "message": "message9129" + }, + { + "key": "BBB", + "message": "message9130" + }, + { + "key": "BBB", + "message": "message9131" + }, + { + "key": "BBB", + "message": "message9132" + }, + { + "key": "BBB", + "message": "message9133" + }, + { + "key": "BBB", + "message": "message9134" + }, + { + "key": "BBB", + "message": "message9135" + }, + { + "key": "BBB", + "message": "message9136_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9137" + }, + { + "key": "BBB", + "message": "message9138" + }, + { + "key": "BBB", + "message": "message9139" + }, + { + "key": "BBB", + "message": "message9140" + }, + { + "key": "BBB", + "message": "message9141" + }, + { + "key": "BBB", + "message": "message9142" + }, + { + "key": "BBB", + "message": "message9143" + }, + { + "key": "BBB", + "message": "message9144" + }, + { + "key": "BBB", + "message": "message9145" + }, + { + "key": "BBB", + "message": "message9146_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9147" + }, + { + "key": "BBB", + "message": "message9148" + }, + { + "key": "BBB", + "message": "message9149" + }, + { + "key": "BBB", + "message": "message9150" + }, + { + "key": "BBB", + "message": "message9151" + }, + { + "key": "BBB", + "message": "message9152" + }, + { + "key": "BBB", + "message": "message9153" + }, + { + "key": "BBB", + "message": "message9154" + }, + { + "key": "BBB", + "message": "message9155" + }, + { + "key": "BBB", + "message": "message9156_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9157" + }, + { + "key": "BBB", + "message": "message9158" + }, + { + "key": "BBB", + "message": "message9159" + }, + { + "key": "BBB", + "message": "message9160" + }, + { + "key": "BBB", + "message": "message9161" + }, + { + "key": "BBB", + "message": "message9162" + }, + { + "key": "BBB", + "message": "message9163" + }, + { + "key": "BBB", + "message": "message9164" + }, + { + "key": "BBB", + "message": "message9165" + }, + { + "key": "BBB", + "message": "message9166_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9167" + }, + { + "key": "BBB", + "message": "message9168" + }, + { + "key": "BBB", + "message": "message9169" + }, + { + "key": "BBB", + "message": "message9170" + }, + { + "key": "BBB", + "message": "message9171" + }, + { + "key": "BBB", + "message": "message9172" + }, + { + "key": "BBB", + "message": "message9173" + }, + { + "key": "BBB", + "message": "message9174" + }, + { + "key": "BBB", + "message": "message9175" + }, + { + "key": "BBB", + "message": "message9176_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9177" + }, + { + "key": "BBB", + "message": "message9178" + }, + { + "key": "BBB", + "message": "message9179" + }, + { + "key": "BBB", + "message": "message9180" + }, + { + "key": "BBB", + "message": "message9181" + }, + { + "key": "BBB", + "message": "message9182" + }, + { + "key": "BBB", + "message": "message9183" + }, + { + "key": "BBB", + "message": "message9184" + }, + { + "key": "BBB", + "message": "message9185" + }, + { + "key": "BBB", + "message": "message9186_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9187" + }, + { + "key": "BBB", + "message": "message9188" + }, + { + "key": "BBB", + "message": "message9189" + }, + { + "key": "BBB", + "message": "message9190" + }, + { + "key": "BBB", + "message": "message9191" + }, + { + "key": "BBB", + "message": "message9192" + }, + { + "key": "BBB", + "message": "message9193" + }, + { + "key": "BBB", + "message": "message9194" + }, + { + "key": "BBB", + "message": "message9195" + }, + { + "key": "BBB", + "message": "message9196_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "BBB", + "message": "message9197" + }, + { + "key": "BBB", + "message": "message9198" + }, + { + "key": "BBB", + "message": "message9199" + }, + { + "key": "BBB", + "message": "message9200_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9201" + }, + { + "key": "CCC", + "message": "message9202" + }, + { + "key": "CCC", + "message": "message9203" + }, + { + "key": "CCC", + "message": "message9204" + }, + { + "key": "CCC", + "message": "message9205" + }, + { + "key": "CCC", + "message": "message9206_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9207" + }, + { + "key": "CCC", + "message": "message9208" + }, + { + "key": "CCC", + "message": "message9209" + }, + { + "key": "CCC", + "message": "message9210" + }, + { + "key": "CCC", + "message": "message9211" + }, + { + "key": "CCC", + "message": "message9212" + }, + { + "key": "CCC", + "message": "message9213" + }, + { + "key": "CCC", + "message": "message9214" + }, + { + "key": "CCC", + "message": "message9215" + }, + { + "key": "CCC", + "message": "message9216_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9217" + }, + { + "key": "CCC", + "message": "message9218" + }, + { + "key": "CCC", + "message": "message9219" + }, + { + "key": "CCC", + "message": "message9220" + }, + { + "key": "CCC", + "message": "message9221" + }, + { + "key": "CCC", + "message": "message9222" + }, + { + "key": "CCC", + "message": "message9223" + }, + { + "key": "CCC", + "message": "message9224" + }, + { + "key": "CCC", + "message": "message9225" + }, + { + "key": "CCC", + "message": "message9226_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9227" + }, + { + "key": "CCC", + "message": "message9228" + }, + { + "key": "CCC", + "message": "message9229" + }, + { + "key": "CCC", + "message": "message9230" + }, + { + "key": "CCC", + "message": "message9231" + }, + { + "key": "CCC", + "message": "message9232" + }, + { + "key": "CCC", + "message": "message9233" + }, + { + "key": "CCC", + "message": "message9234" + }, + { + "key": "CCC", + "message": "message9235" + }, + { + "key": "CCC", + "message": "message9236_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9237" + }, + { + "key": "CCC", + "message": "message9238" + }, + { + "key": "CCC", + "message": "message9239" + }, + { + "key": "CCC", + "message": "message9240" + }, + { + "key": "CCC", + "message": "message9241" + }, + { + "key": "CCC", + "message": "message9242" + }, + { + "key": "CCC", + "message": "message9243" + }, + { + "key": "CCC", + "message": "message9244" + }, + { + "key": "CCC", + "message": "message9245" + }, + { + "key": "CCC", + "message": "message9246_xxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9247" + }, + { + "key": "CCC", + "message": "message9248" + }, + { + "key": "CCC", + "message": "message9249" + }, + { + "key": "CCC", + "message": "message9250" + }, + { + "key": "CCC", + "message": "message9251" + }, + { + "key": "CCC", + "message": "message9252" + }, + { + "key": "CCC", + "message": "message9253" + }, + { + "key": "CCC", + "message": "message9254" + }, + { + "key": "CCC", + "message": "message9255" + }, + { + "key": "CCC", + "message": "message9256_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9257" + }, + { + "key": "CCC", + "message": "message9258" + }, + { + "key": "CCC", + "message": "message9259" + }, + { + "key": "CCC", + "message": "message9260" + }, + { + "key": "CCC", + "message": "message9261" + }, + { + "key": "CCC", + "message": "message9262" + }, + { + "key": "CCC", + "message": "message9263" + }, + { + "key": "CCC", + "message": "message9264" + }, + { + "key": "CCC", + "message": "message9265" + }, + { + "key": "CCC", + "message": "message9266_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9267" + }, + { + "key": "CCC", + "message": "message9268" + }, + { + "key": "CCC", + "message": "message9269" + }, + { + "key": "CCC", + "message": "message9270" + }, + { + "key": "CCC", + "message": "message9271" + }, + { + "key": "CCC", + "message": "message9272" + }, + { + "key": "CCC", + "message": "message9273" + }, + { + "key": "CCC", + "message": "message9274" + }, + { + "key": "CCC", + "message": "message9275" + }, + { + "key": "CCC", + "message": "message9276_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9277" + }, + { + "key": "CCC", + "message": "message9278" + }, + { + "key": "CCC", + "message": "message9279" + }, + { + "key": "CCC", + "message": "message9280" + }, + { + "key": "CCC", + "message": "message9281" + }, + { + "key": "CCC", + "message": "message9282" + }, + { + "key": "CCC", + "message": "message9283" + }, + { + "key": "CCC", + "message": "message9284" + }, + { + "key": "CCC", + "message": "message9285" + }, + { + "key": "CCC", + "message": "message9286_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9287" + }, + { + "key": "CCC", + "message": "message9288" + }, + { + "key": "CCC", + "message": "message9289" + }, + { + "key": "CCC", + "message": "message9290" + }, + { + "key": "CCC", + "message": "message9291" + }, + { + "key": "CCC", + "message": "message9292" + }, + { + "key": "CCC", + "message": "message9293" + }, + { + "key": "CCC", + "message": "message9294" + }, + { + "key": "CCC", + "message": "message9295" + }, + { + "key": "CCC", + "message": "message9296_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9297" + }, + { + "key": "CCC", + "message": "message9298" + }, + { + "key": "CCC", + "message": "message9299" + }, + { + "key": "CCC", + "message": "message9300_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9301" + }, + { + "key": "CCC", + "message": "message9302" + }, + { + "key": "CCC", + "message": "message9303" + }, + { + "key": "CCC", + "message": "message9304" + }, + { + "key": "CCC", + "message": "message9305" + }, + { + "key": "CCC", + "message": "message9306_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9307" + }, + { + "key": "CCC", + "message": "message9308" + }, + { + "key": "CCC", + "message": "message9309" + }, + { + "key": "CCC", + "message": "message9310" + }, + { + "key": "CCC", + "message": "message9311" + }, + { + "key": "CCC", + "message": "message9312" + }, + { + "key": "CCC", + "message": "message9313" + }, + { + "key": "CCC", + "message": "message9314" + }, + { + "key": "CCC", + "message": "message9315" + }, + { + "key": "CCC", + "message": "message9316_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9317" + }, + { + "key": "CCC", + "message": "message9318" + }, + { + "key": "CCC", + "message": "message9319" + }, + { + "key": "CCC", + "message": "message9320" + }, + { + "key": "CCC", + "message": "message9321" + }, + { + "key": "CCC", + "message": "message9322" + }, + { + "key": "CCC", + "message": "message9323" + }, + { + "key": "CCC", + "message": "message9324" + }, + { + "key": "CCC", + "message": "message9325" + }, + { + "key": "CCC", + "message": "message9326_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9327" + }, + { + "key": "CCC", + "message": "message9328" + }, + { + "key": "CCC", + "message": "message9329" + }, + { + "key": "CCC", + "message": "message9330" + }, + { + "key": "CCC", + "message": "message9331" + }, + { + "key": "CCC", + "message": "message9332" + }, + { + "key": "CCC", + "message": "message9333" + }, + { + "key": "CCC", + "message": "message9334" + }, + { + "key": "CCC", + "message": "message9335" + }, + { + "key": "CCC", + "message": "message9336_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9337" + }, + { + "key": "CCC", + "message": "message9338" + }, + { + "key": "CCC", + "message": "message9339" + }, + { + "key": "CCC", + "message": "message9340" + }, + { + "key": "CCC", + "message": "message9341" + }, + { + "key": "CCC", + "message": "message9342" + }, + { + "key": "CCC", + "message": "message9343" + }, + { + "key": "CCC", + "message": "message9344" + }, + { + "key": "CCC", + "message": "message9345" + }, + { + "key": "CCC", + "message": "message9346_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9347" + }, + { + "key": "CCC", + "message": "message9348" + }, + { + "key": "CCC", + "message": "message9349" + }, + { + "key": "CCC", + "message": "message9350" + }, + { + "key": "CCC", + "message": "message9351" + }, + { + "key": "CCC", + "message": "message9352" + }, + { + "key": "CCC", + "message": "message9353" + }, + { + "key": "CCC", + "message": "message9354" + }, + { + "key": "CCC", + "message": "message9355" + }, + { + "key": "CCC", + "message": "message9356_xxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9357" + }, + { + "key": "CCC", + "message": "message9358" + }, + { + "key": "CCC", + "message": "message9359" + }, + { + "key": "CCC", + "message": "message9360" + }, + { + "key": "CCC", + "message": "message9361" + }, + { + "key": "CCC", + "message": "message9362" + }, + { + "key": "CCC", + "message": "message9363" + }, + { + "key": "CCC", + "message": "message9364" + }, + { + "key": "CCC", + "message": "message9365" + }, + { + "key": "CCC", + "message": "message9366_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9367" + }, + { + "key": "CCC", + "message": "message9368" + }, + { + "key": "CCC", + "message": "message9369" + }, + { + "key": "CCC", + "message": "message9370" + }, + { + "key": "CCC", + "message": "message9371" + }, + { + "key": "CCC", + "message": "message9372" + }, + { + "key": "CCC", + "message": "message9373" + }, + { + "key": "CCC", + "message": "message9374" + }, + { + "key": "CCC", + "message": "message9375" + }, + { + "key": "CCC", + "message": "message9376_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9377" + }, + { + "key": "CCC", + "message": "message9378" + }, + { + "key": "CCC", + "message": "message9379" + }, + { + "key": "CCC", + "message": "message9380" + }, + { + "key": "CCC", + "message": "message9381" + }, + { + "key": "CCC", + "message": "message9382" + }, + { + "key": "CCC", + "message": "message9383" + }, + { + "key": "CCC", + "message": "message9384" + }, + { + "key": "CCC", + "message": "message9385" + }, + { + "key": "CCC", + "message": "message9386_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9387" + }, + { + "key": "CCC", + "message": "message9388" + }, + { + "key": "CCC", + "message": "message9389" + }, + { + "key": "CCC", + "message": "message9390" + }, + { + "key": "CCC", + "message": "message9391" + }, + { + "key": "CCC", + "message": "message9392" + }, + { + "key": "CCC", + "message": "message9393" + }, + { + "key": "CCC", + "message": "message9394" + }, + { + "key": "CCC", + "message": "message9395" + }, + { + "key": "CCC", + "message": "message9396_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9397" + }, + { + "key": "CCC", + "message": "message9398" + }, + { + "key": "CCC", + "message": "message9399" + }, + { + "key": "CCC", + "message": "message9400_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9401" + }, + { + "key": "CCC", + "message": "message9402" + }, + { + "key": "CCC", + "message": "message9403" + }, + { + "key": "CCC", + "message": "message9404" + }, + { + "key": "CCC", + "message": "message9405" + }, + { + "key": "CCC", + "message": "message9406_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9407" + }, + { + "key": "CCC", + "message": "message9408" + }, + { + "key": "CCC", + "message": "message9409" + }, + { + "key": "CCC", + "message": "message9410" + }, + { + "key": "CCC", + "message": "message9411" + }, + { + "key": "CCC", + "message": "message9412" + }, + { + "key": "CCC", + "message": "message9413" + }, + { + "key": "CCC", + "message": "message9414" + }, + { + "key": "CCC", + "message": "message9415" + }, + { + "key": "CCC", + "message": "message9416_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9417" + }, + { + "key": "CCC", + "message": "message9418" + }, + { + "key": "CCC", + "message": "message9419" + }, + { + "key": "CCC", + "message": "message9420" + }, + { + "key": "CCC", + "message": "message9421" + }, + { + "key": "CCC", + "message": "message9422" + }, + { + "key": "CCC", + "message": "message9423" + }, + { + "key": "CCC", + "message": "message9424" + }, + { + "key": "CCC", + "message": "message9425" + }, + { + "key": "CCC", + "message": "message9426_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9427" + }, + { + "key": "CCC", + "message": "message9428" + }, + { + "key": "CCC", + "message": "message9429" + }, + { + "key": "CCC", + "message": "message9430" + }, + { + "key": "CCC", + "message": "message9431" + }, + { + "key": "CCC", + "message": "message9432" + }, + { + "key": "CCC", + "message": "message9433" + }, + { + "key": "CCC", + "message": "message9434" + }, + { + "key": "CCC", + "message": "message9435" + }, + { + "key": "CCC", + "message": "message9436_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9437" + }, + { + "key": "CCC", + "message": "message9438" + }, + { + "key": "CCC", + "message": "message9439" + }, + { + "key": "CCC", + "message": "message9440" + }, + { + "key": "CCC", + "message": "message9441" + }, + { + "key": "CCC", + "message": "message9442" + }, + { + "key": "CCC", + "message": "message9443" + }, + { + "key": "CCC", + "message": "message9444" + }, + { + "key": "CCC", + "message": "message9445" + }, + { + "key": "CCC", + "message": "message9446_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9447" + }, + { + "key": "CCC", + "message": "message9448" + }, + { + "key": "CCC", + "message": "message9449" + }, + { + "key": "CCC", + "message": "message9450" + }, + { + "key": "CCC", + "message": "message9451" + }, + { + "key": "CCC", + "message": "message9452" + }, + { + "key": "CCC", + "message": "message9453" + }, + { + "key": "CCC", + "message": "message9454" + }, + { + "key": "CCC", + "message": "message9455" + }, + { + "key": "CCC", + "message": "message9456_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9457" + }, + { + "key": "CCC", + "message": "message9458" + }, + { + "key": "CCC", + "message": "message9459" + }, + { + "key": "CCC", + "message": "message9460" + }, + { + "key": "CCC", + "message": "message9461" + }, + { + "key": "CCC", + "message": "message9462" + }, + { + "key": "CCC", + "message": "message9463" + }, + { + "key": "CCC", + "message": "message9464" + }, + { + "key": "CCC", + "message": "message9465" + }, + { + "key": "CCC", + "message": "message9466_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9467" + }, + { + "key": "CCC", + "message": "message9468" + }, + { + "key": "CCC", + "message": "message9469" + }, + { + "key": "CCC", + "message": "message9470" + }, + { + "key": "CCC", + "message": "message9471" + }, + { + "key": "CCC", + "message": "message9472" + }, + { + "key": "CCC", + "message": "message9473" + }, + { + "key": "CCC", + "message": "message9474" + }, + { + "key": "CCC", + "message": "message9475" + }, + { + "key": "CCC", + "message": "message9476_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9477" + }, + { + "key": "CCC", + "message": "message9478" + }, + { + "key": "CCC", + "message": "message9479" + }, + { + "key": "CCC", + "message": "message9480" + }, + { + "key": "CCC", + "message": "message9481" + }, + { + "key": "CCC", + "message": "message9482" + }, + { + "key": "CCC", + "message": "message9483" + }, + { + "key": "CCC", + "message": "message9484" + }, + { + "key": "CCC", + "message": "message9485" + }, + { + "key": "CCC", + "message": "message9486_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9487" + }, + { + "key": "CCC", + "message": "message9488" + }, + { + "key": "CCC", + "message": "message9489" + }, + { + "key": "CCC", + "message": "message9490" + }, + { + "key": "CCC", + "message": "message9491" + }, + { + "key": "CCC", + "message": "message9492" + }, + { + "key": "CCC", + "message": "message9493" + }, + { + "key": "CCC", + "message": "message9494" + }, + { + "key": "CCC", + "message": "message9495" + }, + { + "key": "CCC", + "message": "message9496_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9497" + }, + { + "key": "CCC", + "message": "message9498" + }, + { + "key": "CCC", + "message": "message9499" + }, + { + "key": "CCC", + "message": "message9500_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9501" + }, + { + "key": "CCC", + "message": "message9502" + }, + { + "key": "CCC", + "message": "message9503" + }, + { + "key": "CCC", + "message": "message9504" + }, + { + "key": "CCC", + "message": "message9505" + }, + { + "key": "CCC", + "message": "message9506_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9507" + }, + { + "key": "CCC", + "message": "message9508" + }, + { + "key": "CCC", + "message": "message9509" + }, + { + "key": "CCC", + "message": "message9510" + }, + { + "key": "CCC", + "message": "message9511" + }, + { + "key": "CCC", + "message": "message9512" + }, + { + "key": "CCC", + "message": "message9513" + }, + { + "key": "CCC", + "message": "message9514" + }, + { + "key": "CCC", + "message": "message9515" + }, + { + "key": "CCC", + "message": "message9516_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9517" + }, + { + "key": "CCC", + "message": "message9518" + }, + { + "key": "CCC", + "message": "message9519" + }, + { + "key": "CCC", + "message": "message9520" + }, + { + "key": "CCC", + "message": "message9521" + }, + { + "key": "CCC", + "message": "message9522" + }, + { + "key": "CCC", + "message": "message9523" + }, + { + "key": "CCC", + "message": "message9524" + }, + { + "key": "CCC", + "message": "message9525" + }, + { + "key": "CCC", + "message": "message9526_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9527" + }, + { + "key": "CCC", + "message": "message9528" + }, + { + "key": "CCC", + "message": "message9529" + }, + { + "key": "CCC", + "message": "message9530" + }, + { + "key": "CCC", + "message": "message9531" + }, + { + "key": "CCC", + "message": "message9532" + }, + { + "key": "CCC", + "message": "message9533" + }, + { + "key": "CCC", + "message": "message9534" + }, + { + "key": "CCC", + "message": "message9535" + }, + { + "key": "CCC", + "message": "message9536_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9537" + }, + { + "key": "CCC", + "message": "message9538" + }, + { + "key": "CCC", + "message": "message9539" + }, + { + "key": "CCC", + "message": "message9540" + }, + { + "key": "CCC", + "message": "message9541" + }, + { + "key": "CCC", + "message": "message9542" + }, + { + "key": "CCC", + "message": "message9543" + }, + { + "key": "CCC", + "message": "message9544" + }, + { + "key": "CCC", + "message": "message9545" + }, + { + "key": "CCC", + "message": "message9546_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9547" + }, + { + "key": "CCC", + "message": "message9548" + }, + { + "key": "CCC", + "message": "message9549" + }, + { + "key": "CCC", + "message": "message9550" + }, + { + "key": "CCC", + "message": "message9551" + }, + { + "key": "CCC", + "message": "message9552" + }, + { + "key": "CCC", + "message": "message9553" + }, + { + "key": "CCC", + "message": "message9554" + }, + { + "key": "CCC", + "message": "message9555" + }, + { + "key": "CCC", + "message": "message9556_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9557" + }, + { + "key": "CCC", + "message": "message9558" + }, + { + "key": "CCC", + "message": "message9559" + }, + { + "key": "CCC", + "message": "message9560" + }, + { + "key": "CCC", + "message": "message9561" + }, + { + "key": "CCC", + "message": "message9562" + }, + { + "key": "CCC", + "message": "message9563" + }, + { + "key": "CCC", + "message": "message9564" + }, + { + "key": "CCC", + "message": "message9565" + }, + { + "key": "CCC", + "message": "message9566_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9567" + }, + { + "key": "CCC", + "message": "message9568" + }, + { + "key": "CCC", + "message": "message9569" + }, + { + "key": "CCC", + "message": "message9570" + }, + { + "key": "CCC", + "message": "message9571" + }, + { + "key": "CCC", + "message": "message9572" + }, + { + "key": "CCC", + "message": "message9573" + }, + { + "key": "CCC", + "message": "message9574" + }, + { + "key": "CCC", + "message": "message9575" + }, + { + "key": "CCC", + "message": "message9576_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9577" + }, + { + "key": "CCC", + "message": "message9578" + }, + { + "key": "CCC", + "message": "message9579" + }, + { + "key": "CCC", + "message": "message9580" + }, + { + "key": "CCC", + "message": "message9581" + }, + { + "key": "CCC", + "message": "message9582" + }, + { + "key": "CCC", + "message": "message9583" + }, + { + "key": "CCC", + "message": "message9584" + }, + { + "key": "CCC", + "message": "message9585" + }, + { + "key": "CCC", + "message": "message9586_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9587" + }, + { + "key": "CCC", + "message": "message9588" + }, + { + "key": "CCC", + "message": "message9589" + }, + { + "key": "CCC", + "message": "message9590" + }, + { + "key": "CCC", + "message": "message9591" + }, + { + "key": "CCC", + "message": "message9592" + }, + { + "key": "CCC", + "message": "message9593" + }, + { + "key": "CCC", + "message": "message9594" + }, + { + "key": "CCC", + "message": "message9595" + }, + { + "key": "CCC", + "message": "message9596_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "CCC", + "message": "message9597" + }, + { + "key": "CCC", + "message": "message9598" + }, + { + "key": "CCC", + "message": "message9599" + }, + { + "key": "CCC", + "message": "message9600_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9601" + }, + { + "key": "DDD", + "message": "message9602" + }, + { + "key": "DDD", + "message": "message9603" + }, + { + "key": "DDD", + "message": "message9604" + }, + { + "key": "DDD", + "message": "message9605" + }, + { + "key": "DDD", + "message": "message9606_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9607" + }, + { + "key": "DDD", + "message": "message9608" + }, + { + "key": "DDD", + "message": "message9609" + }, + { + "key": "DDD", + "message": "message9610" + }, + { + "key": "DDD", + "message": "message9611" + }, + { + "key": "DDD", + "message": "message9612" + }, + { + "key": "DDD", + "message": "message9613" + }, + { + "key": "DDD", + "message": "message9614" + }, + { + "key": "DDD", + "message": "message9615" + }, + { + "key": "DDD", + "message": "message9616_xxxxxxxx" + }, + { + "key": "DDD", + "message": "message9617" + }, + { + "key": "DDD", + "message": "message9618" + }, + { + "key": "DDD", + "message": "message9619" + }, + { + "key": "DDD", + "message": "message9620" + }, + { + "key": "DDD", + "message": "message9621" + }, + { + "key": "DDD", + "message": "message9622" + }, + { + "key": "DDD", + "message": "message9623" + }, + { + "key": "DDD", + "message": "message9624" + }, + { + "key": "DDD", + "message": "message9625" + }, + { + "key": "DDD", + "message": "message9626_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9627" + }, + { + "key": "DDD", + "message": "message9628" + }, + { + "key": "DDD", + "message": "message9629" + }, + { + "key": "DDD", + "message": "message9630" + }, + { + "key": "DDD", + "message": "message9631" + }, + { + "key": "DDD", + "message": "message9632" + }, + { + "key": "DDD", + "message": "message9633" + }, + { + "key": "DDD", + "message": "message9634" + }, + { + "key": "DDD", + "message": "message9635" + }, + { + "key": "DDD", + "message": "message9636_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9637" + }, + { + "key": "DDD", + "message": "message9638" + }, + { + "key": "DDD", + "message": "message9639" + }, + { + "key": "DDD", + "message": "message9640" + }, + { + "key": "DDD", + "message": "message9641" + }, + { + "key": "DDD", + "message": "message9642" + }, + { + "key": "DDD", + "message": "message9643" + }, + { + "key": "DDD", + "message": "message9644" + }, + { + "key": "DDD", + "message": "message9645" + }, + { + "key": "DDD", + "message": "message9646_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9647" + }, + { + "key": "DDD", + "message": "message9648" + }, + { + "key": "DDD", + "message": "message9649" + }, + { + "key": "DDD", + "message": "message9650" + }, + { + "key": "DDD", + "message": "message9651" + }, + { + "key": "DDD", + "message": "message9652" + }, + { + "key": "DDD", + "message": "message9653" + }, + { + "key": "DDD", + "message": "message9654" + }, + { + "key": "DDD", + "message": "message9655" + }, + { + "key": "DDD", + "message": "message9656_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9657" + }, + { + "key": "DDD", + "message": "message9658" + }, + { + "key": "DDD", + "message": "message9659" + }, + { + "key": "DDD", + "message": "message9660" + }, + { + "key": "DDD", + "message": "message9661" + }, + { + "key": "DDD", + "message": "message9662" + }, + { + "key": "DDD", + "message": "message9663" + }, + { + "key": "DDD", + "message": "message9664" + }, + { + "key": "DDD", + "message": "message9665" + }, + { + "key": "DDD", + "message": "message9666_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9667" + }, + { + "key": "DDD", + "message": "message9668" + }, + { + "key": "DDD", + "message": "message9669" + }, + { + "key": "DDD", + "message": "message9670" + }, + { + "key": "DDD", + "message": "message9671" + }, + { + "key": "DDD", + "message": "message9672" + }, + { + "key": "DDD", + "message": "message9673" + }, + { + "key": "DDD", + "message": "message9674" + }, + { + "key": "DDD", + "message": "message9675" + }, + { + "key": "DDD", + "message": "message9676_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9677" + }, + { + "key": "DDD", + "message": "message9678" + }, + { + "key": "DDD", + "message": "message9679" + }, + { + "key": "DDD", + "message": "message9680" + }, + { + "key": "DDD", + "message": "message9681" + }, + { + "key": "DDD", + "message": "message9682" + }, + { + "key": "DDD", + "message": "message9683" + }, + { + "key": "DDD", + "message": "message9684" + }, + { + "key": "DDD", + "message": "message9685" + }, + { + "key": "DDD", + "message": "message9686_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9687" + }, + { + "key": "DDD", + "message": "message9688" + }, + { + "key": "DDD", + "message": "message9689" + }, + { + "key": "DDD", + "message": "message9690" + }, + { + "key": "DDD", + "message": "message9691" + }, + { + "key": "DDD", + "message": "message9692" + }, + { + "key": "DDD", + "message": "message9693" + }, + { + "key": "DDD", + "message": "message9694" + }, + { + "key": "DDD", + "message": "message9695" + }, + { + "key": "DDD", + "message": "message9696_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9697" + }, + { + "key": "DDD", + "message": "message9698" + }, + { + "key": "DDD", + "message": "message9699" + }, + { + "key": "DDD", + "message": "message9700_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9701" + }, + { + "key": "DDD", + "message": "message9702" + }, + { + "key": "DDD", + "message": "message9703" + }, + { + "key": "DDD", + "message": "message9704" + }, + { + "key": "DDD", + "message": "message9705" + }, + { + "key": "DDD", + "message": "message9706_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9707" + }, + { + "key": "DDD", + "message": "message9708" + }, + { + "key": "DDD", + "message": "message9709" + }, + { + "key": "DDD", + "message": "message9710" + }, + { + "key": "DDD", + "message": "message9711" + }, + { + "key": "DDD", + "message": "message9712" + }, + { + "key": "DDD", + "message": "message9713" + }, + { + "key": "DDD", + "message": "message9714" + }, + { + "key": "DDD", + "message": "message9715" + }, + { + "key": "DDD", + "message": "message9716_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9717" + }, + { + "key": "DDD", + "message": "message9718" + }, + { + "key": "DDD", + "message": "message9719" + }, + { + "key": "DDD", + "message": "message9720" + }, + { + "key": "DDD", + "message": "message9721" + }, + { + "key": "DDD", + "message": "message9722" + }, + { + "key": "DDD", + "message": "message9723" + }, + { + "key": "DDD", + "message": "message9724" + }, + { + "key": "DDD", + "message": "message9725" + }, + { + "key": "DDD", + "message": "message9726_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9727" + }, + { + "key": "DDD", + "message": "message9728" + }, + { + "key": "DDD", + "message": "message9729" + }, + { + "key": "DDD", + "message": "message9730" + }, + { + "key": "DDD", + "message": "message9731" + }, + { + "key": "DDD", + "message": "message9732" + }, + { + "key": "DDD", + "message": "message9733" + }, + { + "key": "DDD", + "message": "message9734" + }, + { + "key": "DDD", + "message": "message9735" + }, + { + "key": "DDD", + "message": "message9736_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9737" + }, + { + "key": "DDD", + "message": "message9738" + }, + { + "key": "DDD", + "message": "message9739" + }, + { + "key": "DDD", + "message": "message9740" + }, + { + "key": "DDD", + "message": "message9741" + }, + { + "key": "DDD", + "message": "message9742" + }, + { + "key": "DDD", + "message": "message9743" + }, + { + "key": "DDD", + "message": "message9744" + }, + { + "key": "DDD", + "message": "message9745" + }, + { + "key": "DDD", + "message": "message9746_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9747" + }, + { + "key": "DDD", + "message": "message9748" + }, + { + "key": "DDD", + "message": "message9749" + }, + { + "key": "DDD", + "message": "message9750" + }, + { + "key": "DDD", + "message": "message9751" + }, + { + "key": "DDD", + "message": "message9752" + }, + { + "key": "DDD", + "message": "message9753" + }, + { + "key": "DDD", + "message": "message9754" + }, + { + "key": "DDD", + "message": "message9755" + }, + { + "key": "DDD", + "message": "message9756_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9757" + }, + { + "key": "DDD", + "message": "message9758" + }, + { + "key": "DDD", + "message": "message9759" + }, + { + "key": "DDD", + "message": "message9760" + }, + { + "key": "DDD", + "message": "message9761" + }, + { + "key": "DDD", + "message": "message9762" + }, + { + "key": "DDD", + "message": "message9763" + }, + { + "key": "DDD", + "message": "message9764" + }, + { + "key": "DDD", + "message": "message9765" + }, + { + "key": "DDD", + "message": "message9766_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9767" + }, + { + "key": "DDD", + "message": "message9768" + }, + { + "key": "DDD", + "message": "message9769" + }, + { + "key": "DDD", + "message": "message9770" + }, + { + "key": "DDD", + "message": "message9771" + }, + { + "key": "DDD", + "message": "message9772" + }, + { + "key": "DDD", + "message": "message9773" + }, + { + "key": "DDD", + "message": "message9774" + }, + { + "key": "DDD", + "message": "message9775" + }, + { + "key": "DDD", + "message": "message9776_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9777" + }, + { + "key": "DDD", + "message": "message9778" + }, + { + "key": "DDD", + "message": "message9779" + }, + { + "key": "DDD", + "message": "message9780" + }, + { + "key": "DDD", + "message": "message9781" + }, + { + "key": "DDD", + "message": "message9782" + }, + { + "key": "DDD", + "message": "message9783" + }, + { + "key": "DDD", + "message": "message9784" + }, + { + "key": "DDD", + "message": "message9785" + }, + { + "key": "DDD", + "message": "message9786_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9787" + }, + { + "key": "DDD", + "message": "message9788" + }, + { + "key": "DDD", + "message": "message9789" + }, + { + "key": "DDD", + "message": "message9790" + }, + { + "key": "DDD", + "message": "message9791" + }, + { + "key": "DDD", + "message": "message9792" + }, + { + "key": "DDD", + "message": "message9793" + }, + { + "key": "DDD", + "message": "message9794" + }, + { + "key": "DDD", + "message": "message9795" + }, + { + "key": "DDD", + "message": "message9796_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9797" + }, + { + "key": "DDD", + "message": "message9798" + }, + { + "key": "DDD", + "message": "message9799" + }, + { + "key": "DDD", + "message": "message9800_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9801" + }, + { + "key": "DDD", + "message": "message9802" + }, + { + "key": "DDD", + "message": "message9803" + }, + { + "key": "DDD", + "message": "message9804" + }, + { + "key": "DDD", + "message": "message9805" + }, + { + "key": "DDD", + "message": "message9806_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9807" + }, + { + "key": "DDD", + "message": "message9808" + }, + { + "key": "DDD", + "message": "message9809" + }, + { + "key": "DDD", + "message": "message9810" + }, + { + "key": "DDD", + "message": "message9811" + }, + { + "key": "DDD", + "message": "message9812" + }, + { + "key": "DDD", + "message": "message9813" + }, + { + "key": "DDD", + "message": "message9814" + }, + { + "key": "DDD", + "message": "message9815" + }, + { + "key": "DDD", + "message": "message9816_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9817" + }, + { + "key": "DDD", + "message": "message9818" + }, + { + "key": "DDD", + "message": "message9819" + }, + { + "key": "DDD", + "message": "message9820" + }, + { + "key": "DDD", + "message": "message9821" + }, + { + "key": "DDD", + "message": "message9822" + }, + { + "key": "DDD", + "message": "message9823" + }, + { + "key": "DDD", + "message": "message9824" + }, + { + "key": "DDD", + "message": "message9825" + }, + { + "key": "DDD", + "message": "message9826_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9827" + }, + { + "key": "DDD", + "message": "message9828" + }, + { + "key": "DDD", + "message": "message9829" + }, + { + "key": "DDD", + "message": "message9830" + }, + { + "key": "DDD", + "message": "message9831" + }, + { + "key": "DDD", + "message": "message9832" + }, + { + "key": "DDD", + "message": "message9833" + }, + { + "key": "DDD", + "message": "message9834" + }, + { + "key": "DDD", + "message": "message9835" + }, + { + "key": "DDD", + "message": "message9836_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9837" + }, + { + "key": "DDD", + "message": "message9838" + }, + { + "key": "DDD", + "message": "message9839" + }, + { + "key": "DDD", + "message": "message9840" + }, + { + "key": "DDD", + "message": "message9841" + }, + { + "key": "DDD", + "message": "message9842" + }, + { + "key": "DDD", + "message": "message9843" + }, + { + "key": "DDD", + "message": "message9844" + }, + { + "key": "DDD", + "message": "message9845" + }, + { + "key": "DDD", + "message": "message9846_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9847" + }, + { + "key": "DDD", + "message": "message9848" + }, + { + "key": "DDD", + "message": "message9849" + }, + { + "key": "DDD", + "message": "message9850" + }, + { + "key": "DDD", + "message": "message9851" + }, + { + "key": "DDD", + "message": "message9852" + }, + { + "key": "DDD", + "message": "message9853" + }, + { + "key": "DDD", + "message": "message9854" + }, + { + "key": "DDD", + "message": "message9855" + }, + { + "key": "DDD", + "message": "message9856_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9857" + }, + { + "key": "DDD", + "message": "message9858" + }, + { + "key": "DDD", + "message": "message9859" + }, + { + "key": "DDD", + "message": "message9860" + }, + { + "key": "DDD", + "message": "message9861" + }, + { + "key": "DDD", + "message": "message9862" + }, + { + "key": "DDD", + "message": "message9863" + }, + { + "key": "DDD", + "message": "message9864" + }, + { + "key": "DDD", + "message": "message9865" + }, + { + "key": "DDD", + "message": "message9866_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9867" + }, + { + "key": "DDD", + "message": "message9868" + }, + { + "key": "DDD", + "message": "message9869" + }, + { + "key": "DDD", + "message": "message9870" + }, + { + "key": "DDD", + "message": "message9871" + }, + { + "key": "DDD", + "message": "message9872" + }, + { + "key": "DDD", + "message": "message9873" + }, + { + "key": "DDD", + "message": "message9874" + }, + { + "key": "DDD", + "message": "message9875" + }, + { + "key": "DDD", + "message": "message9876_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9877" + }, + { + "key": "DDD", + "message": "message9878" + }, + { + "key": "DDD", + "message": "message9879" + }, + { + "key": "DDD", + "message": "message9880" + }, + { + "key": "DDD", + "message": "message9881" + }, + { + "key": "DDD", + "message": "message9882" + }, + { + "key": "DDD", + "message": "message9883" + }, + { + "key": "DDD", + "message": "message9884" + }, + { + "key": "DDD", + "message": "message9885" + }, + { + "key": "DDD", + "message": "message9886_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9887" + }, + { + "key": "DDD", + "message": "message9888" + }, + { + "key": "DDD", + "message": "message9889" + }, + { + "key": "DDD", + "message": "message9890" + }, + { + "key": "DDD", + "message": "message9891" + }, + { + "key": "DDD", + "message": "message9892" + }, + { + "key": "DDD", + "message": "message9893" + }, + { + "key": "DDD", + "message": "message9894" + }, + { + "key": "DDD", + "message": "message9895" + }, + { + "key": "DDD", + "message": "message9896_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9897" + }, + { + "key": "DDD", + "message": "message9898" + }, + { + "key": "DDD", + "message": "message9899" + }, + { + "key": "DDD", + "message": "message9900_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9901" + }, + { + "key": "DDD", + "message": "message9902" + }, + { + "key": "DDD", + "message": "message9903" + }, + { + "key": "DDD", + "message": "message9904" + }, + { + "key": "DDD", + "message": "message9905" + }, + { + "key": "DDD", + "message": "message9906_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9907" + }, + { + "key": "DDD", + "message": "message9908" + }, + { + "key": "DDD", + "message": "message9909" + }, + { + "key": "DDD", + "message": "message9910" + }, + { + "key": "DDD", + "message": "message9911" + }, + { + "key": "DDD", + "message": "message9912" + }, + { + "key": "DDD", + "message": "message9913" + }, + { + "key": "DDD", + "message": "message9914" + }, + { + "key": "DDD", + "message": "message9915" + }, + { + "key": "DDD", + "message": "message9916_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9917" + }, + { + "key": "DDD", + "message": "message9918" + }, + { + "key": "DDD", + "message": "message9919" + }, + { + "key": "DDD", + "message": "message9920" + }, + { + "key": "DDD", + "message": "message9921" + }, + { + "key": "DDD", + "message": "message9922" + }, + { + "key": "DDD", + "message": "message9923" + }, + { + "key": "DDD", + "message": "message9924" + }, + { + "key": "DDD", + "message": "message9925" + }, + { + "key": "DDD", + "message": "message9926_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9927" + }, + { + "key": "DDD", + "message": "message9928" + }, + { + "key": "DDD", + "message": "message9929" + }, + { + "key": "DDD", + "message": "message9930" + }, + { + "key": "DDD", + "message": "message9931" + }, + { + "key": "DDD", + "message": "message9932" + }, + { + "key": "DDD", + "message": "message9933" + }, + { + "key": "DDD", + "message": "message9934" + }, + { + "key": "DDD", + "message": "message9935" + }, + { + "key": "DDD", + "message": "message9936_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9937" + }, + { + "key": "DDD", + "message": "message9938" + }, + { + "key": "DDD", + "message": "message9939" + }, + { + "key": "DDD", + "message": "message9940" + }, + { + "key": "DDD", + "message": "message9941" + }, + { + "key": "DDD", + "message": "message9942" + }, + { + "key": "DDD", + "message": "message9943" + }, + { + "key": "DDD", + "message": "message9944" + }, + { + "key": "DDD", + "message": "message9945" + }, + { + "key": "DDD", + "message": "message9946_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9947" + }, + { + "key": "DDD", + "message": "message9948" + }, + { + "key": "DDD", + "message": "message9949" + }, + { + "key": "DDD", + "message": "message9950" + }, + { + "key": "DDD", + "message": "message9951" + }, + { + "key": "DDD", + "message": "message9952" + }, + { + "key": "DDD", + "message": "message9953" + }, + { + "key": "DDD", + "message": "message9954" + }, + { + "key": "DDD", + "message": "message9955" + }, + { + "key": "DDD", + "message": "message9956_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9957" + }, + { + "key": "DDD", + "message": "message9958" + }, + { + "key": "DDD", + "message": "message9959" + }, + { + "key": "DDD", + "message": "message9960" + }, + { + "key": "DDD", + "message": "message9961" + }, + { + "key": "DDD", + "message": "message9962" + }, + { + "key": "DDD", + "message": "message9963" + }, + { + "key": "DDD", + "message": "message9964" + }, + { + "key": "DDD", + "message": "message9965" + }, + { + "key": "DDD", + "message": "message9966_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9967" + }, + { + "key": "DDD", + "message": "message9968" + }, + { + "key": "DDD", + "message": "message9969" + }, + { + "key": "DDD", + "message": "message9970" + }, + { + "key": "DDD", + "message": "message9971" + }, + { + "key": "DDD", + "message": "message9972" + }, + { + "key": "DDD", + "message": "message9973" + }, + { + "key": "DDD", + "message": "message9974" + }, + { + "key": "DDD", + "message": "message9975" + }, + { + "key": "DDD", + "message": "message9976_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9977" + }, + { + "key": "DDD", + "message": "message9978" + }, + { + "key": "DDD", + "message": "message9979" + }, + { + "key": "DDD", + "message": "message9980" + }, + { + "key": "DDD", + "message": "message9981" + }, + { + "key": "DDD", + "message": "message9982" + }, + { + "key": "DDD", + "message": "message9983" + }, + { + "key": "DDD", + "message": "message9984" + }, + { + "key": "DDD", + "message": "message9985" + }, + { + "key": "DDD", + "message": "message9986_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9987" + }, + { + "key": "DDD", + "message": "message9988" + }, + { + "key": "DDD", + "message": "message9989" + }, + { + "key": "DDD", + "message": "message9990" + }, + { + "key": "DDD", + "message": "message9991" + }, + { + "key": "DDD", + "message": "message9992" + }, + { + "key": "DDD", + "message": "message9993" + }, + { + "key": "DDD", + "message": "message9994" + }, + { + "key": "DDD", + "message": "message9995" + }, + { + "key": "DDD", + "message": "message9996_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "key": "DDD", + "message": "message9997" + }, + { + "key": "DDD", + "message": "message9998" + }, + { + "key": "DDD", + "message": "message9999" + }, + { + "key": "DDD", + "message": "message10000_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + } + ], + "expected": [ + { + "key": "", + "messages": [ + "message1", + "message6", + "message11", + "message16", + "message21", + "message26", + "message31", + "message36", + "message41", + "message46", + "message51", + "message56", + "message61", + "message66", + "message71", + "message76", + "message81", + "message86", + "message91", + "message96", + "message101", + "message106", + "message111", + "message116", + "message121", + "message126", + "message131", + "message136", + "message141", + "message146", + "message151", + "message156", + "message161", + "message166", + "message171", + "message176", + "message181", + "message186", + "message191", + "message196", + "message201", + "message206", + "message211", + "message216", + "message221", + "message226", + "message231", + "message236", + "message241", + "message246", + "message251", + "message256", + "message261", + "message266", + "message271", + "message276", + "message281", + "message286", + "message291", + "message296", + "message301", + "message306", + "message311", + "message316", + "message321", + "message326", + "message331", + "message336", + "message341", + "message346", + "message351", + "message356", + "message361", + "message366", + "message371", + "message376", + "message381", + "message386", + "message391", + "message396", + "message401", + "message406", + "message411", + "message416", + "message421", + "message426", + "message431", + "message436", + "message441", + "message446", + "message451", + "message456", + "message461", + "message466", + "message471", + "message476", + "message481", + "message486", + "message491", + "message496", + "message501", + "message506", + "message511", + "message516", + "message521", + "message526", + "message531", + "message536", + "message541", + "message546", + "message551", + "message556", + "message561", + "message566", + "message571", + "message576", + "message581", + "message586", + "message591", + "message596", + "message601", + "message606", + "message611", + "message616", + "message621", + "message626", + "message631", + "message636", + "message641", + "message646", + "message651", + "message656", + "message661", + "message666", + "message671", + "message676", + "message681", + "message686", + "message691", + "message696", + "message701", + "message706", + "message711", + "message716", + "message721", + "message726", + "message731", + "message736", + "message741", + "message746", + "message751", + "message756", + "message761", + "message766", + "message771", + "message776", + "message781", + "message786", + "message791", + "message796", + "message801", + "message806", + "message811", + "message816", + "message821", + "message826", + "message831", + "message836", + "message841", + "message846", + "message851", + "message856", + "message861", + "message866", + "message871", + "message876", + "message881", + "message886", + "message891", + "message896", + "message901", + "message906", + "message911", + "message916", + "message921", + "message926", + "message931", + "message936", + "message941", + "message946", + "message951", + "message956", + "message961", + "message966", + "message971", + "message976", + "message981", + "message986", + "message991", + "message996", + "message1001", + "message1006", + "message1011", + "message1016", + "message1021", + "message1026", + "message1031", + "message1036", + "message1041", + "message1046", + "message1051", + "message1056", + "message1061", + "message1066", + "message1071", + "message1076", + "message1081", + "message1086", + "message1091", + "message1096", + "message1101", + "message1106", + "message1111", + "message1116", + "message1121", + "message1126", + "message1131", + "message1136", + "message1141", + "message1146", + "message1151", + "message1156", + "message1161", + "message1166", + "message1171", + "message1176", + "message1181", + "message1186", + "message1191", + "message1196", + "message1201", + "message1206", + "message1211", + "message1216", + "message1221", + "message1226", + "message1231", + "message1236", + "message1241", + "message1246", + "message1251", + "message1256", + "message1261", + "message1266", + "message1271", + "message1276", + "message1281", + "message1286", + "message1291", + "message1296", + "message1301", + "message1306", + "message1311", + "message1316", + "message1321", + "message1326", + "message1331", + "message1336", + "message1341", + "message1346", + "message1351", + "message1356", + "message1361", + "message1366", + "message1371", + "message1376", + "message1381", + "message1386", + "message1391", + "message1396", + "message1401", + "message1406", + "message1411", + "message1416", + "message1421", + "message1426", + "message1431", + "message1436", + "message1441", + "message1446", + "message1451", + "message1456", + "message1461", + "message1466", + "message1471", + "message1476", + "message1481", + "message1486", + "message1491", + "message1496", + "message1501", + "message1506", + "message1511", + "message1516", + "message1521", + "message1526", + "message1531", + "message1536", + "message1541", + "message1546", + "message1551", + "message1556", + "message1561", + "message1566", + "message1571", + "message1576", + "message1581", + "message1586", + "message1591", + "message1596", + "message1601", + "message1606", + "message1611", + "message1616", + "message1621", + "message1626", + "message1631", + "message1636", + "message1641", + "message1646", + "message1651", + "message1656", + "message1661", + "message1666", + "message1671", + "message1676", + "message1681", + "message1686", + "message1691", + "message1696", + "message1701", + "message1706", + "message1711", + "message1716", + "message1721", + "message1726", + "message1731", + "message1736", + "message1741", + "message1746", + "message1751", + "message1756", + "message1761", + "message1766", + "message1771", + "message1776", + "message1781", + "message1786", + "message1791", + "message1796", + "message1801", + "message1806", + "message1811", + "message1816", + "message1821", + "message1826", + "message1831", + "message1836", + "message1841", + "message1846", + "message1851", + "message1856", + "message1861", + "message1866", + "message1871", + "message1876", + "message1881", + "message1886", + "message1891", + "message1896", + "message1901", + "message1906", + "message1911", + "message1916", + "message1921", + "message1926", + "message1931", + "message1936", + "message1941", + "message1946", + "message1951", + "message1956", + "message1961", + "message1966", + "message1971", + "message1976", + "message1981", + "message1986", + "message1991", + "message1996", + "message2001", + "message2002", + "message2003", + "message2004", + "message2005", + "message2006", + "message2007", + "message2008", + "message2009", + "message2010", + "message2011", + "message2012", + "message2013", + "message2014", + "message2015", + "message2016", + "message2017", + "message2018", + "message2019", + "message2020", + "message2021", + "message2022", + "message2023", + "message2024", + "message2025", + "message2026", + "message2027", + "message2028", + "message2029", + "message2030", + "message2031", + "message2032", + "message2033", + "message2034", + "message2035", + "message2036", + "message2037", + "message2038", + "message2039", + "message2040", + "message2041", + "message2042", + "message2043", + "message2044", + "message2045", + "message2046", + "message2047", + "message2048", + "message2049", + "message2050", + "message2051", + "message2052", + "message2053", + "message2054", + "message2055", + "message2056", + "message2057", + "message2058", + "message2059", + "message2060", + "message2061", + "message2062", + "message2063", + "message2064", + "message2065", + "message2066", + "message2067", + "message2068", + "message2069", + "message2070", + "message2071", + "message2072", + "message2073", + "message2074", + "message2075", + "message2076", + "message2077", + "message2078", + "message2079", + "message2080", + "message2081", + "message2082", + "message2083", + "message2084", + "message2085", + "message2086", + "message2087", + "message2088", + "message2089", + "message2090", + "message2091", + "message2092", + "message2093", + "message2094", + "message2095", + "message2096", + "message2097", + "message2098", + "message2099", + "message2100", + "message2101", + "message2102", + "message2103", + "message2104", + "message2105", + "message2106", + "message2107", + "message2108", + "message2109", + "message2110", + "message2111", + "message2112", + "message2113", + "message2114", + "message2115", + "message2116", + "message2117", + "message2118", + "message2119", + "message2120", + "message2121", + "message2122", + "message2123", + "message2124", + "message2125", + "message2126", + "message2127", + "message2128", + "message2129", + "message2130", + "message2131", + "message2132", + "message2133", + "message2134", + "message2135", + "message2136", + "message2137", + "message2138", + "message2139", + "message2140", + "message2141", + "message2142", + "message2143", + "message2144", + "message2145", + "message2146", + "message2147", + "message2148", + "message2149", + "message2150", + "message2151", + "message2152", + "message2153", + "message2154", + "message2155", + "message2156", + "message2157", + "message2158", + "message2159", + "message2160", + "message2161", + "message2162", + "message2163", + "message2164", + "message2165", + "message2166", + "message2167", + "message2168", + "message2169", + "message2170", + "message2171", + "message2172", + "message2173", + "message2174", + "message2175", + "message2176", + "message2177", + "message2178", + "message2179", + "message2180", + "message2181", + "message2182", + "message2183", + "message2184", + "message2185", + "message2186", + "message2187", + "message2188", + "message2189", + "message2190", + "message2191", + "message2192", + "message2193", + "message2194", + "message2195", + "message2196", + "message2197", + "message2198", + "message2199", + "message2200", + "message2201", + "message2202", + "message2203", + "message2204", + "message2205", + "message2206", + "message2207", + "message2208", + "message2209", + "message2210", + "message2211", + "message2212", + "message2213", + "message2214", + "message2215", + "message2216", + "message2217", + "message2218", + "message2219", + "message2220", + "message2221", + "message2222", + "message2223", + "message2224", + "message2225", + "message2226", + "message2227", + "message2228", + "message2229", + "message2230", + "message2231", + "message2232", + "message2233", + "message2234", + "message2235", + "message2236", + "message2237", + "message2238", + "message2239", + "message2240", + "message2241", + "message2242", + "message2243", + "message2244", + "message2245", + "message2246", + "message2247", + "message2248", + "message2249", + "message2250", + "message2251", + "message2252", + "message2253", + "message2254", + "message2255", + "message2256", + "message2257", + "message2258", + "message2259", + "message2260", + "message2261", + "message2262", + "message2263", + "message2264", + "message2265", + "message2266", + "message2267", + "message2268", + "message2269", + "message2270", + "message2271", + "message2272", + "message2273", + "message2274", + "message2275", + "message2276", + "message2277", + "message2278", + "message2279", + "message2280", + "message2281", + "message2282", + "message2283", + "message2284", + "message2285", + "message2286", + "message2287", + "message2288", + "message2289", + "message2290", + "message2291", + "message2292", + "message2293", + "message2294", + "message2295", + "message2296", + "message2297", + "message2298", + "message2299", + "message2300", + "message2301", + "message2302", + "message2303", + "message2304", + "message2305", + "message2306", + "message2307", + "message2308", + "message2309", + "message2310", + "message2311", + "message2312", + "message2313", + "message2314", + "message2315", + "message2316", + "message2317", + "message2318", + "message2319", + "message2320", + "message2321", + "message2322", + "message2323", + "message2324", + "message2325", + "message2326", + "message2327", + "message2328", + "message2329", + "message2330", + "message2331", + "message2332", + "message2333", + "message2334", + "message2335", + "message2336", + "message2337", + "message2338", + "message2339", + "message2340", + "message2341", + "message2342", + "message2343", + "message2344", + "message2345", + "message2346", + "message2347", + "message2348", + "message2349", + "message2350", + "message2351", + "message2352", + "message2353", + "message2354", + "message2355", + "message2356", + "message2357", + "message2358", + "message2359", + "message2360", + "message2361", + "message2362", + "message2363", + "message2364", + "message2365", + "message2366", + "message2367", + "message2368", + "message2369", + "message2370", + "message2371", + "message2372", + "message2373", + "message2374", + "message2375", + "message2376", + "message2377", + "message2378", + "message2379", + "message2380", + "message2381", + "message2382", + "message2383", + "message2384", + "message2385", + "message2386", + "message2387", + "message2388", + "message2389", + "message2390", + "message2391", + "message2392", + "message2393", + "message2394", + "message2395", + "message2396", + "message2397", + "message2398", + "message2399", + "message2400", + "message4002", + "message4020", + "message4025", + "message4026", + "message4033", + "message4036", + "message4037", + "message4040", + "message4047", + "message4053", + "message4059", + "message4062", + "message4063", + "message4068", + "message4078", + "message4079", + "message4083", + "message4085", + "message4086", + "message4089", + "message4094", + "message4095", + "message4098", + "message4102", + "message4106", + "message4108", + "message4113", + "message4114", + "message4130", + "message4131", + "message4138", + "message4140", + "message4146", + "message4147", + "message4157", + "message4158", + "message4176", + "message4181", + "message4192", + "message4197", + "message4199", + "message4202", + "message4211", + "message4212", + "message4217", + "message4218", + "message4220", + "message4223", + "message4239", + "message4241", + "message4249", + "message4252", + "message4257", + "message4259", + "message4263", + "message4266", + "message4267", + "message4268", + "message4277", + "message4281", + "message4291", + "message4294", + "message4295", + "message4299", + "message4300", + "message4314", + "message4320", + "message4321", + "message4322", + "message4327", + "message4333", + "message4334", + "message4335", + "message4337", + "message4349", + "message4361", + "message4363", + "message4365", + "message4389", + "message4390", + "message4397", + "message4403", + "message4412", + "message4416", + "message4428", + "message4430", + "message4438", + "message4440", + "message4446", + "message4449", + "message4455", + "message4456", + "message4465", + "message4470", + "message4487", + "message4488", + "message4493", + "message4501", + "message4506", + "message4507", + "message4509", + "message4511", + "message4512", + "message4528", + "message4529", + "message4534", + "message4536", + "message4539", + "message4548", + "message4554", + "message4557", + "message4568", + "message4574", + "message4577", + "message4591", + "message4600", + "message4601", + "message4602", + "message4604", + "message4608", + "message4616", + "message4617", + "message4618", + "message4629", + "message4632", + "message4633", + "message4638", + "message4639", + "message4648", + "message4653", + "message4657", + "message4658", + "message4668", + "message4669", + "message4673", + "message4675", + "message4677", + "message4678", + "message4681", + "message4682", + "message4683", + "message4686", + "message4687", + "message4693", + "message4695", + "message4697", + "message4698", + "message4706", + "message4717", + "message4722", + "message4733", + "message4742", + "message4752", + "message4754", + "message4755", + "message4758", + "message4760", + "message4761", + "message4763", + "message4773", + "message4784", + "message4789", + "message4794", + "message4795", + "message4803", + "message4805", + "message4810", + "message4813", + "message4814", + "message4823", + "message4828", + "message4839", + "message4854", + "message4857", + "message4867", + "message4870", + "message4872", + "message4875", + "message4885", + "message4886", + "message4895", + "message4899", + "message4903", + "message4904", + "message4907", + "message4908", + "message4910", + "message4914", + "message4915", + "message4918", + "message4920", + "message4923", + "message4930", + "message4934", + "message4937", + "message4944", + "message4952", + "message4959", + "message4965", + "message4978", + "message4979", + "message4982", + "message4986", + "message4987", + "message4991", + "message5003", + "message5012", + "message5016", + "message5017", + "message5018", + "message5019", + "message5039", + "message5049", + "message5058", + "message5061", + "message5062", + "message5063", + "message5075", + "message5087", + "message5088", + "message5092", + "message5100", + "message5101", + "message5103", + "message5105", + "message5114", + "message5127", + "message5129", + "message5130", + "message5136", + "message5137", + "message5139", + "message5141", + "message5145", + "message5154", + "message5158", + "message5176", + "message5178", + "message5179", + "message5187", + "message5191", + "message5196", + "message5203", + "message5207", + "message5210", + "message5211", + "message5213", + "message5216", + "message5217", + "message5245", + "message5252", + "message5254", + "message5256", + "message5262", + "message5266", + "message5274", + "message5284", + "message5289", + "message5295", + "message5297", + "message5303", + "message5308", + "message5311", + "message5316", + "message5320", + "message5321", + "message5325", + "message5331", + "message5332", + "message5335", + "message5338", + "message5343", + "message5345", + "message5349", + "message5355", + "message5366", + "message5368", + "message5369", + "message5372", + "message5375", + "message5388", + "message5403", + "message5405", + "message5406", + "message5417", + "message5427", + "message5456", + "message5459", + "message5466", + "message5473", + "message5481", + "message5491", + "message5498", + "message5503", + "message5505", + "message5509", + "message5514", + "message5520", + "message5521", + "message5525", + "message5532", + "message5534", + "message5537", + "message5539", + "message5553", + "message5557", + "message5559", + "message5567", + "message5570", + "message5571", + "message5576", + "message5578", + "message5580", + "message5590", + "message5593", + "message5598", + "message5600", + "message5604", + "message5606", + "message5608", + "message5620", + "message5629", + "message5635", + "message5638", + "message5644", + "message5645", + "message5650", + "message5653", + "message5660", + "message5675", + "message5681", + "message5686", + "message5687", + "message5697", + "message5700", + "message5706", + "message5708", + "message5712", + "message5720", + "message5724", + "message5727", + "message5729", + "message5736", + "message5737", + "message5742", + "message5746", + "message5751", + "message5752", + "message5754", + "message5763", + "message5770", + "message5772", + "message5777", + "message5779", + "message5780", + "message5781", + "message5784", + "message5791", + "message5792", + "message5798", + "message5800", + "message5801", + "message5805", + "message5811", + "message5812", + "message5817", + "message5826", + "message5837", + "message5842", + "message5851", + "message5858", + "message5861", + "message5865", + "message5867", + "message5868", + "message5870", + "message5883", + "message5887", + "message5889", + "message5893", + "message5900", + "message5901", + "message5911", + "message5916", + "message5922", + "message5926", + "message5928", + "message5938", + "message5948", + "message5949", + "message5951", + "message5960", + "message5961", + "message5964", + "message5967", + "message5970", + "message5972", + "message5978", + "message5981", + "message5998", + "message8001", + "message8002", + "message8003", + "message8004", + "message8005", + "message8006_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8007", + "message8008", + "message8009", + "message8010", + "message8011", + "message8012", + "message8013", + "message8014", + "message8015", + "message8016_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8017", + "message8018", + "message8019", + "message8020", + "message8021", + "message8022", + "message8023", + "message8024", + "message8025", + "message8026_xxxxxxxxx", + "message8027", + "message8028", + "message8029", + "message8030", + "message8031", + "message8032", + "message8033", + "message8034", + "message8035", + "message8036_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8037", + "message8038", + "message8039", + "message8040", + "message8041", + "message8042", + "message8043", + "message8044", + "message8045", + "message8046_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8047", + "message8048", + "message8049", + "message8050", + "message8051", + "message8052", + "message8053", + "message8054", + "message8055", + "message8056_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8057", + "message8058", + "message8059", + "message8060", + "message8061", + "message8062", + "message8063", + "message8064", + "message8065", + "message8066_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8067", + "message8068", + "message8069", + "message8070", + "message8071", + "message8072", + "message8073", + "message8074", + "message8075", + "message8076_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8077", + "message8078", + "message8079", + "message8080", + "message8081", + "message8082", + "message8083", + "message8084", + "message8085", + "message8086_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8087", + "message8088", + "message8089", + "message8090", + "message8091", + "message8092", + "message8093", + "message8094", + "message8095", + "message8096_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8097", + "message8098", + "message8099", + "message8100_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8101", + "message8102", + "message8103", + "message8104", + "message8105", + "message8106_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8107", + "message8108", + "message8109", + "message8110", + "message8111", + "message8112", + "message8113", + "message8114", + "message8115", + "message8116_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8117", + "message8118", + "message8119", + "message8120", + "message8121", + "message8122", + "message8123", + "message8124", + "message8125", + "message8126_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8127", + "message8128", + "message8129", + "message8130", + "message8131", + "message8132", + "message8133", + "message8134", + "message8135", + "message8136_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8137", + "message8138", + "message8139", + "message8140", + "message8141", + "message8142", + "message8143", + "message8144", + "message8145", + "message8146_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8147", + "message8148", + "message8149", + "message8150", + "message8151", + "message8152", + "message8153", + "message8154", + "message8155", + "message8156_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8157", + "message8158", + "message8159", + "message8160", + "message8161", + "message8162", + "message8163", + "message8164", + "message8165", + "message8166_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8167", + "message8168", + "message8169", + "message8170", + "message8171", + "message8172", + "message8173", + "message8174", + "message8175", + "message8176_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8177", + "message8178", + "message8179", + "message8180", + "message8181", + "message8182", + "message8183", + "message8184", + "message8185", + "message8186_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8187", + "message8188", + "message8189", + "message8190", + "message8191", + "message8192", + "message8193", + "message8194", + "message8195", + "message8196_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8197", + "message8198", + "message8199", + "message8200_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8201", + "message8202", + "message8203", + "message8204", + "message8205", + "message8206_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8207", + "message8208", + "message8209", + "message8210", + "message8211", + "message8212", + "message8213", + "message8214", + "message8215", + "message8216_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8217", + "message8218", + "message8219", + "message8220", + "message8221", + "message8222", + "message8223", + "message8224", + "message8225", + "message8226_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8227", + "message8228", + "message8229", + "message8230", + "message8231", + "message8232", + "message8233", + "message8234", + "message8235", + "message8236_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8237", + "message8238", + "message8239", + "message8240", + "message8241", + "message8242", + "message8243", + "message8244", + "message8245", + "message8246_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8247", + "message8248", + "message8249", + "message8250", + "message8251", + "message8252", + "message8253", + "message8254", + "message8255", + "message8256_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8257", + "message8258", + "message8259", + "message8260", + "message8261", + "message8262", + "message8263", + "message8264", + "message8265", + "message8266_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8267", + "message8268", + "message8269", + "message8270", + "message8271", + "message8272", + "message8273", + "message8274", + "message8275", + "message8276_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8277", + "message8278", + "message8279", + "message8280", + "message8281", + "message8282", + "message8283", + "message8284", + "message8285", + "message8286_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8287", + "message8288", + "message8289", + "message8290", + "message8291", + "message8292", + "message8293", + "message8294", + "message8295", + "message8296_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8297", + "message8298", + "message8299", + "message8300_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8301", + "message8302", + "message8303", + "message8304", + "message8305", + "message8306_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8307", + "message8308", + "message8309", + "message8310", + "message8311", + "message8312", + "message8313", + "message8314", + "message8315", + "message8316_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8317", + "message8318", + "message8319", + "message8320", + "message8321", + "message8322", + "message8323", + "message8324", + "message8325", + "message8326_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8327", + "message8328", + "message8329", + "message8330", + "message8331", + "message8332", + "message8333", + "message8334", + "message8335", + "message8336_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8337", + "message8338", + "message8339", + "message8340", + "message8341", + "message8342", + "message8343", + "message8344", + "message8345", + "message8346_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8347", + "message8348", + "message8349", + "message8350", + "message8351", + "message8352", + "message8353", + "message8354", + "message8355", + "message8356_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8357", + "message8358", + "message8359", + "message8360", + "message8361", + "message8362", + "message8363", + "message8364", + "message8365", + "message8366_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8367", + "message8368", + "message8369", + "message8370", + "message8371", + "message8372", + "message8373", + "message8374", + "message8375", + "message8376_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8377", + "message8378", + "message8379", + "message8380", + "message8381", + "message8382", + "message8383", + "message8384", + "message8385", + "message8386_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8387", + "message8388", + "message8389", + "message8390", + "message8391", + "message8392", + "message8393", + "message8394", + "message8395", + "message8396_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8397", + "message8398", + "message8399", + "message8400_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ] + }, + { + "key": "AAA", + "messages": [ + "message2", + "message7", + "message12", + "message17", + "message22", + "message27", + "message32", + "message37", + "message42", + "message47", + "message52", + "message57", + "message62", + "message67", + "message72", + "message77", + "message82", + "message87", + "message92", + "message97", + "message102", + "message107", + "message112", + "message117", + "message122", + "message127", + "message132", + "message137", + "message142", + "message147", + "message152", + "message157", + "message162", + "message167", + "message172", + "message177", + "message182", + "message187", + "message192", + "message197", + "message202", + "message207", + "message212", + "message217", + "message222", + "message227", + "message232", + "message237", + "message242", + "message247", + "message252", + "message257", + "message262", + "message267", + "message272", + "message277", + "message282", + "message287", + "message292", + "message297", + "message302", + "message307", + "message312", + "message317", + "message322", + "message327", + "message332", + "message337", + "message342", + "message347", + "message352", + "message357", + "message362", + "message367", + "message372", + "message377", + "message382", + "message387", + "message392", + "message397", + "message402", + "message407", + "message412", + "message417", + "message422", + "message427", + "message432", + "message437", + "message442", + "message447", + "message452", + "message457", + "message462", + "message467", + "message472", + "message477", + "message482", + "message487", + "message492", + "message497", + "message502", + "message507", + "message512", + "message517", + "message522", + "message527", + "message532", + "message537", + "message542", + "message547", + "message552", + "message557", + "message562", + "message567", + "message572", + "message577", + "message582", + "message587", + "message592", + "message597", + "message602", + "message607", + "message612", + "message617", + "message622", + "message627", + "message632", + "message637", + "message642", + "message647", + "message652", + "message657", + "message662", + "message667", + "message672", + "message677", + "message682", + "message687", + "message692", + "message697", + "message702", + "message707", + "message712", + "message717", + "message722", + "message727", + "message732", + "message737", + "message742", + "message747", + "message752", + "message757", + "message762", + "message767", + "message772", + "message777", + "message782", + "message787", + "message792", + "message797", + "message802", + "message807", + "message812", + "message817", + "message822", + "message827", + "message832", + "message837", + "message842", + "message847", + "message852", + "message857", + "message862", + "message867", + "message872", + "message877", + "message882", + "message887", + "message892", + "message897", + "message902", + "message907", + "message912", + "message917", + "message922", + "message927", + "message932", + "message937", + "message942", + "message947", + "message952", + "message957", + "message962", + "message967", + "message972", + "message977", + "message982", + "message987", + "message992", + "message997", + "message1002", + "message1007", + "message1012", + "message1017", + "message1022", + "message1027", + "message1032", + "message1037", + "message1042", + "message1047", + "message1052", + "message1057", + "message1062", + "message1067", + "message1072", + "message1077", + "message1082", + "message1087", + "message1092", + "message1097", + "message1102", + "message1107", + "message1112", + "message1117", + "message1122", + "message1127", + "message1132", + "message1137", + "message1142", + "message1147", + "message1152", + "message1157", + "message1162", + "message1167", + "message1172", + "message1177", + "message1182", + "message1187", + "message1192", + "message1197", + "message1202", + "message1207", + "message1212", + "message1217", + "message1222", + "message1227", + "message1232", + "message1237", + "message1242", + "message1247", + "message1252", + "message1257", + "message1262", + "message1267", + "message1272", + "message1277", + "message1282", + "message1287", + "message1292", + "message1297", + "message1302", + "message1307", + "message1312", + "message1317", + "message1322", + "message1327", + "message1332", + "message1337", + "message1342", + "message1347", + "message1352", + "message1357", + "message1362", + "message1367", + "message1372", + "message1377", + "message1382", + "message1387", + "message1392", + "message1397", + "message1402", + "message1407", + "message1412", + "message1417", + "message1422", + "message1427", + "message1432", + "message1437", + "message1442", + "message1447", + "message1452", + "message1457", + "message1462", + "message1467", + "message1472", + "message1477", + "message1482", + "message1487", + "message1492", + "message1497", + "message1502", + "message1507", + "message1512", + "message1517", + "message1522", + "message1527", + "message1532", + "message1537", + "message1542", + "message1547", + "message1552", + "message1557", + "message1562", + "message1567", + "message1572", + "message1577", + "message1582", + "message1587", + "message1592", + "message1597", + "message1602", + "message1607", + "message1612", + "message1617", + "message1622", + "message1627", + "message1632", + "message1637", + "message1642", + "message1647", + "message1652", + "message1657", + "message1662", + "message1667", + "message1672", + "message1677", + "message1682", + "message1687", + "message1692", + "message1697", + "message1702", + "message1707", + "message1712", + "message1717", + "message1722", + "message1727", + "message1732", + "message1737", + "message1742", + "message1747", + "message1752", + "message1757", + "message1762", + "message1767", + "message1772", + "message1777", + "message1782", + "message1787", + "message1792", + "message1797", + "message1802", + "message1807", + "message1812", + "message1817", + "message1822", + "message1827", + "message1832", + "message1837", + "message1842", + "message1847", + "message1852", + "message1857", + "message1862", + "message1867", + "message1872", + "message1877", + "message1882", + "message1887", + "message1892", + "message1897", + "message1902", + "message1907", + "message1912", + "message1917", + "message1922", + "message1927", + "message1932", + "message1937", + "message1942", + "message1947", + "message1952", + "message1957", + "message1962", + "message1967", + "message1972", + "message1977", + "message1982", + "message1987", + "message1992", + "message1997", + "message2401", + "message2402", + "message2403", + "message2404", + "message2405", + "message2406", + "message2407", + "message2408", + "message2409", + "message2410", + "message2411", + "message2412", + "message2413", + "message2414", + "message2415", + "message2416", + "message2417", + "message2418", + "message2419", + "message2420", + "message2421", + "message2422", + "message2423", + "message2424", + "message2425", + "message2426", + "message2427", + "message2428", + "message2429", + "message2430", + "message2431", + "message2432", + "message2433", + "message2434", + "message2435", + "message2436", + "message2437", + "message2438", + "message2439", + "message2440", + "message2441", + "message2442", + "message2443", + "message2444", + "message2445", + "message2446", + "message2447", + "message2448", + "message2449", + "message2450", + "message2451", + "message2452", + "message2453", + "message2454", + "message2455", + "message2456", + "message2457", + "message2458", + "message2459", + "message2460", + "message2461", + "message2462", + "message2463", + "message2464", + "message2465", + "message2466", + "message2467", + "message2468", + "message2469", + "message2470", + "message2471", + "message2472", + "message2473", + "message2474", + "message2475", + "message2476", + "message2477", + "message2478", + "message2479", + "message2480", + "message2481", + "message2482", + "message2483", + "message2484", + "message2485", + "message2486", + "message2487", + "message2488", + "message2489", + "message2490", + "message2491", + "message2492", + "message2493", + "message2494", + "message2495", + "message2496", + "message2497", + "message2498", + "message2499", + "message2500", + "message2501", + "message2502", + "message2503", + "message2504", + "message2505", + "message2506", + "message2507", + "message2508", + "message2509", + "message2510", + "message2511", + "message2512", + "message2513", + "message2514", + "message2515", + "message2516", + "message2517", + "message2518", + "message2519", + "message2520", + "message2521", + "message2522", + "message2523", + "message2524", + "message2525", + "message2526", + "message2527", + "message2528", + "message2529", + "message2530", + "message2531", + "message2532", + "message2533", + "message2534", + "message2535", + "message2536", + "message2537", + "message2538", + "message2539", + "message2540", + "message2541", + "message2542", + "message2543", + "message2544", + "message2545", + "message2546", + "message2547", + "message2548", + "message2549", + "message2550", + "message2551", + "message2552", + "message2553", + "message2554", + "message2555", + "message2556", + "message2557", + "message2558", + "message2559", + "message2560", + "message2561", + "message2562", + "message2563", + "message2564", + "message2565", + "message2566", + "message2567", + "message2568", + "message2569", + "message2570", + "message2571", + "message2572", + "message2573", + "message2574", + "message2575", + "message2576", + "message2577", + "message2578", + "message2579", + "message2580", + "message2581", + "message2582", + "message2583", + "message2584", + "message2585", + "message2586", + "message2587", + "message2588", + "message2589", + "message2590", + "message2591", + "message2592", + "message2593", + "message2594", + "message2595", + "message2596", + "message2597", + "message2598", + "message2599", + "message2600", + "message2601", + "message2602", + "message2603", + "message2604", + "message2605", + "message2606", + "message2607", + "message2608", + "message2609", + "message2610", + "message2611", + "message2612", + "message2613", + "message2614", + "message2615", + "message2616", + "message2617", + "message2618", + "message2619", + "message2620", + "message2621", + "message2622", + "message2623", + "message2624", + "message2625", + "message2626", + "message2627", + "message2628", + "message2629", + "message2630", + "message2631", + "message2632", + "message2633", + "message2634", + "message2635", + "message2636", + "message2637", + "message2638", + "message2639", + "message2640", + "message2641", + "message2642", + "message2643", + "message2644", + "message2645", + "message2646", + "message2647", + "message2648", + "message2649", + "message2650", + "message2651", + "message2652", + "message2653", + "message2654", + "message2655", + "message2656", + "message2657", + "message2658", + "message2659", + "message2660", + "message2661", + "message2662", + "message2663", + "message2664", + "message2665", + "message2666", + "message2667", + "message2668", + "message2669", + "message2670", + "message2671", + "message2672", + "message2673", + "message2674", + "message2675", + "message2676", + "message2677", + "message2678", + "message2679", + "message2680", + "message2681", + "message2682", + "message2683", + "message2684", + "message2685", + "message2686", + "message2687", + "message2688", + "message2689", + "message2690", + "message2691", + "message2692", + "message2693", + "message2694", + "message2695", + "message2696", + "message2697", + "message2698", + "message2699", + "message2700", + "message2701", + "message2702", + "message2703", + "message2704", + "message2705", + "message2706", + "message2707", + "message2708", + "message2709", + "message2710", + "message2711", + "message2712", + "message2713", + "message2714", + "message2715", + "message2716", + "message2717", + "message2718", + "message2719", + "message2720", + "message2721", + "message2722", + "message2723", + "message2724", + "message2725", + "message2726", + "message2727", + "message2728", + "message2729", + "message2730", + "message2731", + "message2732", + "message2733", + "message2734", + "message2735", + "message2736", + "message2737", + "message2738", + "message2739", + "message2740", + "message2741", + "message2742", + "message2743", + "message2744", + "message2745", + "message2746", + "message2747", + "message2748", + "message2749", + "message2750", + "message2751", + "message2752", + "message2753", + "message2754", + "message2755", + "message2756", + "message2757", + "message2758", + "message2759", + "message2760", + "message2761", + "message2762", + "message2763", + "message2764", + "message2765", + "message2766", + "message2767", + "message2768", + "message2769", + "message2770", + "message2771", + "message2772", + "message2773", + "message2774", + "message2775", + "message2776", + "message2777", + "message2778", + "message2779", + "message2780", + "message2781", + "message2782", + "message2783", + "message2784", + "message2785", + "message2786", + "message2787", + "message2788", + "message2789", + "message2790", + "message2791", + "message2792", + "message2793", + "message2794", + "message2795", + "message2796", + "message2797", + "message2798", + "message2799", + "message2800", + "message4003", + "message4005", + "message4008", + "message4023", + "message4039", + "message4044", + "message4051", + "message4055", + "message4061", + "message4067", + "message4069", + "message4070", + "message4077", + "message4091", + "message4099", + "message4100", + "message4101", + "message4103", + "message4116", + "message4124", + "message4125", + "message4132", + "message4142", + "message4155", + "message4159", + "message4160", + "message4162", + "message4163", + "message4164", + "message4166", + "message4169", + "message4175", + "message4177", + "message4178", + "message4186", + "message4187", + "message4205", + "message4208", + "message4215", + "message4216", + "message4221", + "message4227", + "message4231", + "message4245", + "message4254", + "message4260", + "message4269", + "message4270", + "message4286", + "message4292", + "message4293", + "message4298", + "message4304", + "message4308", + "message4311", + "message4312", + "message4313", + "message4315", + "message4316", + "message4318", + "message4325", + "message4326", + "message4347", + "message4352", + "message4353", + "message4356", + "message4366", + "message4367", + "message4369", + "message4372", + "message4376", + "message4377", + "message4379", + "message4391", + "message4394", + "message4399", + "message4408", + "message4419", + "message4420", + "message4425", + "message4439", + "message4442", + "message4443", + "message4447", + "message4448", + "message4460", + "message4461", + "message4462", + "message4466", + "message4467", + "message4468", + "message4472", + "message4473", + "message4478", + "message4480", + "message4482", + "message4483", + "message4485", + "message4495", + "message4503", + "message4504", + "message4517", + "message4520", + "message4549", + "message4555", + "message4561", + "message4562", + "message4564", + "message4565", + "message4576", + "message4581", + "message4583", + "message4589", + "message4590", + "message4595", + "message4603", + "message4609", + "message4614", + "message4621", + "message4626", + "message4630", + "message4631", + "message4637", + "message4640", + "message4643", + "message4644", + "message4645", + "message4649", + "message4651", + "message4654", + "message4656", + "message4663", + "message4685", + "message4689", + "message4703", + "message4704", + "message4705", + "message4711", + "message4715", + "message4716", + "message4719", + "message4723", + "message4725", + "message4726", + "message4735", + "message4738", + "message4740", + "message4741", + "message4756", + "message4766", + "message4767", + "message4770", + "message4780", + "message4793", + "message4798", + "message4800", + "message4802", + "message4806", + "message4809", + "message4816", + "message4822", + "message4824", + "message4826", + "message4834", + "message4843", + "message4850", + "message4858", + "message4862", + "message4864", + "message4866", + "message4874", + "message4877", + "message4878", + "message4879", + "message4892", + "message4902", + "message4909", + "message4911", + "message4922", + "message4932", + "message4935", + "message4943", + "message4946", + "message4955", + "message4962", + "message4967", + "message4972", + "message4976", + "message4984", + "message4985", + "message4993", + "message4994", + "message4996", + "message4997", + "message5001", + "message5009", + "message5010", + "message5011", + "message5014", + "message5024", + "message5030", + "message5034", + "message5035", + "message5036", + "message5040", + "message5050", + "message5054", + "message5057", + "message5059", + "message5077", + "message5080", + "message5086", + "message5094", + "message5098", + "message5099", + "message5110", + "message5112", + "message5115", + "message5116", + "message5117", + "message5119", + "message5122", + "message5123", + "message5132", + "message5140", + "message5146", + "message5149", + "message5153", + "message5160", + "message5163", + "message5168", + "message5172", + "message5174", + "message5175", + "message5177", + "message5180", + "message5182", + "message5184", + "message5185", + "message5188", + "message5197", + "message5198", + "message5204", + "message5206", + "message5219", + "message5220", + "message5226", + "message5230", + "message5235", + "message5236", + "message5237", + "message5238", + "message5241", + "message5244", + "message5255", + "message5264", + "message5268", + "message5270", + "message5271", + "message5273", + "message5279", + "message5283", + "message5292", + "message5293", + "message5296", + "message5299", + "message5300", + "message5313", + "message5334", + "message5336", + "message5337", + "message5340", + "message5351", + "message5357", + "message5363", + "message5367", + "message5373", + "message5381", + "message5383", + "message5386", + "message5392", + "message5394", + "message5402", + "message5408", + "message5414", + "message5418", + "message5419", + "message5420", + "message5423", + "message5428", + "message5429", + "message5432", + "message5434", + "message5435", + "message5438", + "message5442", + "message5444", + "message5447", + "message5449", + "message5453", + "message5458", + "message5463", + "message5478", + "message5488", + "message5492", + "message5497", + "message5500", + "message5508", + "message5513", + "message5523", + "message5527", + "message5530", + "message5531", + "message5533", + "message5540", + "message5558", + "message5563", + "message5564", + "message5568", + "message5579", + "message5582", + "message5591", + "message5607", + "message5613", + "message5614", + "message5615", + "message5622", + "message5623", + "message5624", + "message5643", + "message5659", + "message5662", + "message5663", + "message5665", + "message5669", + "message5672", + "message5679", + "message5685", + "message5689", + "message5692", + "message5694", + "message5701", + "message5707", + "message5711", + "message5714", + "message5715", + "message5725", + "message5739", + "message5743", + "message5747", + "message5748", + "message5756", + "message5757", + "message5759", + "message5761", + "message5765", + "message5769", + "message5775", + "message5776", + "message5786", + "message5802", + "message5806", + "message5813", + "message5822", + "message5833", + "message5834", + "message5838", + "message5840", + "message5848", + "message5854", + "message5856", + "message5869", + "message5872", + "message5874", + "message5876", + "message5878", + "message5881", + "message5882", + "message5888", + "message5890", + "message5894", + "message5895", + "message5899", + "message5913", + "message5914", + "message5915", + "message5921", + "message5933", + "message5937", + "message5940", + "message5945", + "message5958", + "message5966", + "message5969", + "message5977", + "message5980", + "message5992", + "message5995", + "message5997", + "message5999", + "message8401", + "message8402", + "message8403", + "message8404", + "message8405", + "message8406_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8407", + "message8408", + "message8409", + "message8410", + "message8411", + "message8412", + "message8413", + "message8414", + "message8415", + "message8416_xxxxxxxxxxxxxxxxxxxx", + "message8417", + "message8418", + "message8419", + "message8420", + "message8421", + "message8422", + "message8423", + "message8424", + "message8425", + "message8426_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8427", + "message8428", + "message8429", + "message8430", + "message8431", + "message8432", + "message8433", + "message8434", + "message8435", + "message8436_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8437", + "message8438", + "message8439", + "message8440", + "message8441", + "message8442", + "message8443", + "message8444", + "message8445", + "message8446_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8447", + "message8448", + "message8449", + "message8450", + "message8451", + "message8452", + "message8453", + "message8454", + "message8455", + "message8456_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8457", + "message8458", + "message8459", + "message8460", + "message8461", + "message8462", + "message8463", + "message8464", + "message8465", + "message8466_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8467", + "message8468", + "message8469", + "message8470", + "message8471", + "message8472", + "message8473", + "message8474", + "message8475", + "message8476_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8477", + "message8478", + "message8479", + "message8480", + "message8481", + "message8482", + "message8483", + "message8484", + "message8485", + "message8486_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8487", + "message8488", + "message8489", + "message8490", + "message8491", + "message8492", + "message8493", + "message8494", + "message8495", + "message8496_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8497", + "message8498", + "message8499", + "message8500_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8501", + "message8502", + "message8503", + "message8504", + "message8505", + "message8506_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8507", + "message8508", + "message8509", + "message8510", + "message8511", + "message8512", + "message8513", + "message8514", + "message8515", + "message8516_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8517", + "message8518", + "message8519", + "message8520", + "message8521", + "message8522", + "message8523", + "message8524", + "message8525", + "message8526_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8527", + "message8528", + "message8529", + "message8530", + "message8531", + "message8532", + "message8533", + "message8534", + "message8535", + "message8536_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8537", + "message8538", + "message8539", + "message8540", + "message8541", + "message8542", + "message8543", + "message8544", + "message8545", + "message8546_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8547", + "message8548", + "message8549", + "message8550", + "message8551", + "message8552", + "message8553", + "message8554", + "message8555", + "message8556_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8557", + "message8558", + "message8559", + "message8560", + "message8561", + "message8562", + "message8563", + "message8564", + "message8565", + "message8566_xxxxxxxxxxxxxxxxxxxxxxxx", + "message8567", + "message8568", + "message8569", + "message8570", + "message8571", + "message8572", + "message8573", + "message8574", + "message8575", + "message8576_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8577", + "message8578", + "message8579", + "message8580", + "message8581", + "message8582", + "message8583", + "message8584", + "message8585", + "message8586_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8587", + "message8588", + "message8589", + "message8590", + "message8591", + "message8592", + "message8593", + "message8594", + "message8595", + "message8596_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8597", + "message8598", + "message8599", + "message8600_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8601", + "message8602", + "message8603", + "message8604", + "message8605", + "message8606_xxxxxxxxxxxxxxxxxx", + "message8607", + "message8608", + "message8609", + "message8610", + "message8611", + "message8612", + "message8613", + "message8614", + "message8615", + "message8616_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8617", + "message8618", + "message8619", + "message8620", + "message8621", + "message8622", + "message8623", + "message8624", + "message8625", + "message8626_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8627", + "message8628", + "message8629", + "message8630", + "message8631", + "message8632", + "message8633", + "message8634", + "message8635", + "message8636_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8637", + "message8638", + "message8639", + "message8640", + "message8641", + "message8642", + "message8643", + "message8644", + "message8645", + "message8646_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8647", + "message8648", + "message8649", + "message8650", + "message8651", + "message8652", + "message8653", + "message8654", + "message8655", + "message8656_xxxxxxxxxxxxx", + "message8657", + "message8658", + "message8659", + "message8660", + "message8661", + "message8662", + "message8663", + "message8664", + "message8665", + "message8666_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8667", + "message8668", + "message8669", + "message8670", + "message8671", + "message8672", + "message8673", + "message8674", + "message8675", + "message8676_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8677", + "message8678", + "message8679", + "message8680", + "message8681", + "message8682", + "message8683", + "message8684", + "message8685", + "message8686_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8687", + "message8688", + "message8689", + "message8690", + "message8691", + "message8692", + "message8693", + "message8694", + "message8695", + "message8696_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8697", + "message8698", + "message8699", + "message8700_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8701", + "message8702", + "message8703", + "message8704", + "message8705", + "message8706_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8707", + "message8708", + "message8709", + "message8710", + "message8711", + "message8712", + "message8713", + "message8714", + "message8715", + "message8716_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8717", + "message8718", + "message8719", + "message8720", + "message8721", + "message8722", + "message8723", + "message8724", + "message8725", + "message8726_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8727", + "message8728", + "message8729", + "message8730", + "message8731", + "message8732", + "message8733", + "message8734", + "message8735", + "message8736_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8737", + "message8738", + "message8739", + "message8740", + "message8741", + "message8742", + "message8743", + "message8744", + "message8745", + "message8746_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8747", + "message8748", + "message8749", + "message8750", + "message8751", + "message8752", + "message8753", + "message8754", + "message8755", + "message8756_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8757", + "message8758", + "message8759", + "message8760", + "message8761", + "message8762", + "message8763", + "message8764", + "message8765", + "message8766_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8767", + "message8768", + "message8769", + "message8770", + "message8771", + "message8772", + "message8773", + "message8774", + "message8775", + "message8776_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8777", + "message8778", + "message8779", + "message8780", + "message8781", + "message8782", + "message8783", + "message8784", + "message8785", + "message8786_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8787", + "message8788", + "message8789", + "message8790", + "message8791", + "message8792", + "message8793", + "message8794", + "message8795", + "message8796_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8797", + "message8798", + "message8799", + "message8800_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ] + }, + { + "key": "BBB", + "messages": [ + "message3", + "message8", + "message13", + "message18", + "message23", + "message28", + "message33", + "message38", + "message43", + "message48", + "message53", + "message58", + "message63", + "message68", + "message73", + "message78", + "message83", + "message88", + "message93", + "message98", + "message103", + "message108", + "message113", + "message118", + "message123", + "message128", + "message133", + "message138", + "message143", + "message148", + "message153", + "message158", + "message163", + "message168", + "message173", + "message178", + "message183", + "message188", + "message193", + "message198", + "message203", + "message208", + "message213", + "message218", + "message223", + "message228", + "message233", + "message238", + "message243", + "message248", + "message253", + "message258", + "message263", + "message268", + "message273", + "message278", + "message283", + "message288", + "message293", + "message298", + "message303", + "message308", + "message313", + "message318", + "message323", + "message328", + "message333", + "message338", + "message343", + "message348", + "message353", + "message358", + "message363", + "message368", + "message373", + "message378", + "message383", + "message388", + "message393", + "message398", + "message403", + "message408", + "message413", + "message418", + "message423", + "message428", + "message433", + "message438", + "message443", + "message448", + "message453", + "message458", + "message463", + "message468", + "message473", + "message478", + "message483", + "message488", + "message493", + "message498", + "message503", + "message508", + "message513", + "message518", + "message523", + "message528", + "message533", + "message538", + "message543", + "message548", + "message553", + "message558", + "message563", + "message568", + "message573", + "message578", + "message583", + "message588", + "message593", + "message598", + "message603", + "message608", + "message613", + "message618", + "message623", + "message628", + "message633", + "message638", + "message643", + "message648", + "message653", + "message658", + "message663", + "message668", + "message673", + "message678", + "message683", + "message688", + "message693", + "message698", + "message703", + "message708", + "message713", + "message718", + "message723", + "message728", + "message733", + "message738", + "message743", + "message748", + "message753", + "message758", + "message763", + "message768", + "message773", + "message778", + "message783", + "message788", + "message793", + "message798", + "message803", + "message808", + "message813", + "message818", + "message823", + "message828", + "message833", + "message838", + "message843", + "message848", + "message853", + "message858", + "message863", + "message868", + "message873", + "message878", + "message883", + "message888", + "message893", + "message898", + "message903", + "message908", + "message913", + "message918", + "message923", + "message928", + "message933", + "message938", + "message943", + "message948", + "message953", + "message958", + "message963", + "message968", + "message973", + "message978", + "message983", + "message988", + "message993", + "message998", + "message1003", + "message1008", + "message1013", + "message1018", + "message1023", + "message1028", + "message1033", + "message1038", + "message1043", + "message1048", + "message1053", + "message1058", + "message1063", + "message1068", + "message1073", + "message1078", + "message1083", + "message1088", + "message1093", + "message1098", + "message1103", + "message1108", + "message1113", + "message1118", + "message1123", + "message1128", + "message1133", + "message1138", + "message1143", + "message1148", + "message1153", + "message1158", + "message1163", + "message1168", + "message1173", + "message1178", + "message1183", + "message1188", + "message1193", + "message1198", + "message1203", + "message1208", + "message1213", + "message1218", + "message1223", + "message1228", + "message1233", + "message1238", + "message1243", + "message1248", + "message1253", + "message1258", + "message1263", + "message1268", + "message1273", + "message1278", + "message1283", + "message1288", + "message1293", + "message1298", + "message1303", + "message1308", + "message1313", + "message1318", + "message1323", + "message1328", + "message1333", + "message1338", + "message1343", + "message1348", + "message1353", + "message1358", + "message1363", + "message1368", + "message1373", + "message1378", + "message1383", + "message1388", + "message1393", + "message1398", + "message1403", + "message1408", + "message1413", + "message1418", + "message1423", + "message1428", + "message1433", + "message1438", + "message1443", + "message1448", + "message1453", + "message1458", + "message1463", + "message1468", + "message1473", + "message1478", + "message1483", + "message1488", + "message1493", + "message1498", + "message1503", + "message1508", + "message1513", + "message1518", + "message1523", + "message1528", + "message1533", + "message1538", + "message1543", + "message1548", + "message1553", + "message1558", + "message1563", + "message1568", + "message1573", + "message1578", + "message1583", + "message1588", + "message1593", + "message1598", + "message1603", + "message1608", + "message1613", + "message1618", + "message1623", + "message1628", + "message1633", + "message1638", + "message1643", + "message1648", + "message1653", + "message1658", + "message1663", + "message1668", + "message1673", + "message1678", + "message1683", + "message1688", + "message1693", + "message1698", + "message1703", + "message1708", + "message1713", + "message1718", + "message1723", + "message1728", + "message1733", + "message1738", + "message1743", + "message1748", + "message1753", + "message1758", + "message1763", + "message1768", + "message1773", + "message1778", + "message1783", + "message1788", + "message1793", + "message1798", + "message1803", + "message1808", + "message1813", + "message1818", + "message1823", + "message1828", + "message1833", + "message1838", + "message1843", + "message1848", + "message1853", + "message1858", + "message1863", + "message1868", + "message1873", + "message1878", + "message1883", + "message1888", + "message1893", + "message1898", + "message1903", + "message1908", + "message1913", + "message1918", + "message1923", + "message1928", + "message1933", + "message1938", + "message1943", + "message1948", + "message1953", + "message1958", + "message1963", + "message1968", + "message1973", + "message1978", + "message1983", + "message1988", + "message1993", + "message1998", + "message2801", + "message2802", + "message2803", + "message2804", + "message2805", + "message2806", + "message2807", + "message2808", + "message2809", + "message2810", + "message2811", + "message2812", + "message2813", + "message2814", + "message2815", + "message2816", + "message2817", + "message2818", + "message2819", + "message2820", + "message2821", + "message2822", + "message2823", + "message2824", + "message2825", + "message2826", + "message2827", + "message2828", + "message2829", + "message2830", + "message2831", + "message2832", + "message2833", + "message2834", + "message2835", + "message2836", + "message2837", + "message2838", + "message2839", + "message2840", + "message2841", + "message2842", + "message2843", + "message2844", + "message2845", + "message2846", + "message2847", + "message2848", + "message2849", + "message2850", + "message2851", + "message2852", + "message2853", + "message2854", + "message2855", + "message2856", + "message2857", + "message2858", + "message2859", + "message2860", + "message2861", + "message2862", + "message2863", + "message2864", + "message2865", + "message2866", + "message2867", + "message2868", + "message2869", + "message2870", + "message2871", + "message2872", + "message2873", + "message2874", + "message2875", + "message2876", + "message2877", + "message2878", + "message2879", + "message2880", + "message2881", + "message2882", + "message2883", + "message2884", + "message2885", + "message2886", + "message2887", + "message2888", + "message2889", + "message2890", + "message2891", + "message2892", + "message2893", + "message2894", + "message2895", + "message2896", + "message2897", + "message2898", + "message2899", + "message2900", + "message2901", + "message2902", + "message2903", + "message2904", + "message2905", + "message2906", + "message2907", + "message2908", + "message2909", + "message2910", + "message2911", + "message2912", + "message2913", + "message2914", + "message2915", + "message2916", + "message2917", + "message2918", + "message2919", + "message2920", + "message2921", + "message2922", + "message2923", + "message2924", + "message2925", + "message2926", + "message2927", + "message2928", + "message2929", + "message2930", + "message2931", + "message2932", + "message2933", + "message2934", + "message2935", + "message2936", + "message2937", + "message2938", + "message2939", + "message2940", + "message2941", + "message2942", + "message2943", + "message2944", + "message2945", + "message2946", + "message2947", + "message2948", + "message2949", + "message2950", + "message2951", + "message2952", + "message2953", + "message2954", + "message2955", + "message2956", + "message2957", + "message2958", + "message2959", + "message2960", + "message2961", + "message2962", + "message2963", + "message2964", + "message2965", + "message2966", + "message2967", + "message2968", + "message2969", + "message2970", + "message2971", + "message2972", + "message2973", + "message2974", + "message2975", + "message2976", + "message2977", + "message2978", + "message2979", + "message2980", + "message2981", + "message2982", + "message2983", + "message2984", + "message2985", + "message2986", + "message2987", + "message2988", + "message2989", + "message2990", + "message2991", + "message2992", + "message2993", + "message2994", + "message2995", + "message2996", + "message2997", + "message2998", + "message2999", + "message3000", + "message3001", + "message3002", + "message3003", + "message3004", + "message3005", + "message3006", + "message3007", + "message3008", + "message3009", + "message3010", + "message3011", + "message3012", + "message3013", + "message3014", + "message3015", + "message3016", + "message3017", + "message3018", + "message3019", + "message3020", + "message3021", + "message3022", + "message3023", + "message3024", + "message3025", + "message3026", + "message3027", + "message3028", + "message3029", + "message3030", + "message3031", + "message3032", + "message3033", + "message3034", + "message3035", + "message3036", + "message3037", + "message3038", + "message3039", + "message3040", + "message3041", + "message3042", + "message3043", + "message3044", + "message3045", + "message3046", + "message3047", + "message3048", + "message3049", + "message3050", + "message3051", + "message3052", + "message3053", + "message3054", + "message3055", + "message3056", + "message3057", + "message3058", + "message3059", + "message3060", + "message3061", + "message3062", + "message3063", + "message3064", + "message3065", + "message3066", + "message3067", + "message3068", + "message3069", + "message3070", + "message3071", + "message3072", + "message3073", + "message3074", + "message3075", + "message3076", + "message3077", + "message3078", + "message3079", + "message3080", + "message3081", + "message3082", + "message3083", + "message3084", + "message3085", + "message3086", + "message3087", + "message3088", + "message3089", + "message3090", + "message3091", + "message3092", + "message3093", + "message3094", + "message3095", + "message3096", + "message3097", + "message3098", + "message3099", + "message3100", + "message3101", + "message3102", + "message3103", + "message3104", + "message3105", + "message3106", + "message3107", + "message3108", + "message3109", + "message3110", + "message3111", + "message3112", + "message3113", + "message3114", + "message3115", + "message3116", + "message3117", + "message3118", + "message3119", + "message3120", + "message3121", + "message3122", + "message3123", + "message3124", + "message3125", + "message3126", + "message3127", + "message3128", + "message3129", + "message3130", + "message3131", + "message3132", + "message3133", + "message3134", + "message3135", + "message3136", + "message3137", + "message3138", + "message3139", + "message3140", + "message3141", + "message3142", + "message3143", + "message3144", + "message3145", + "message3146", + "message3147", + "message3148", + "message3149", + "message3150", + "message3151", + "message3152", + "message3153", + "message3154", + "message3155", + "message3156", + "message3157", + "message3158", + "message3159", + "message3160", + "message3161", + "message3162", + "message3163", + "message3164", + "message3165", + "message3166", + "message3167", + "message3168", + "message3169", + "message3170", + "message3171", + "message3172", + "message3173", + "message3174", + "message3175", + "message3176", + "message3177", + "message3178", + "message3179", + "message3180", + "message3181", + "message3182", + "message3183", + "message3184", + "message3185", + "message3186", + "message3187", + "message3188", + "message3189", + "message3190", + "message3191", + "message3192", + "message3193", + "message3194", + "message3195", + "message3196", + "message3197", + "message3198", + "message3199", + "message3200", + "message4007", + "message4009", + "message4010", + "message4011", + "message4012", + "message4013", + "message4042", + "message4057", + "message4081", + "message4104", + "message4109", + "message4110", + "message4115", + "message4117", + "message4118", + "message4119", + "message4122", + "message4136", + "message4137", + "message4144", + "message4151", + "message4152", + "message4153", + "message4154", + "message4170", + "message4171", + "message4172", + "message4173", + "message4183", + "message4184", + "message4190", + "message4193", + "message4195", + "message4201", + "message4204", + "message4207", + "message4209", + "message4210", + "message4214", + "message4225", + "message4230", + "message4232", + "message4235", + "message4240", + "message4247", + "message4248", + "message4250", + "message4256", + "message4261", + "message4264", + "message4265", + "message4273", + "message4276", + "message4279", + "message4280", + "message4288", + "message4309", + "message4323", + "message4331", + "message4339", + "message4341", + "message4344", + "message4354", + "message4355", + "message4358", + "message4359", + "message4360", + "message4371", + "message4373", + "message4374", + "message4380", + "message4387", + "message4388", + "message4392", + "message4393", + "message4400", + "message4401", + "message4402", + "message4404", + "message4414", + "message4417", + "message4426", + "message4432", + "message4433", + "message4434", + "message4435", + "message4441", + "message4444", + "message4450", + "message4451", + "message4459", + "message4463", + "message4464", + "message4475", + "message4477", + "message4479", + "message4486", + "message4489", + "message4491", + "message4499", + "message4502", + "message4505", + "message4510", + "message4513", + "message4515", + "message4516", + "message4525", + "message4527", + "message4530", + "message4535", + "message4543", + "message4545", + "message4550", + "message4552", + "message4559", + "message4570", + "message4579", + "message4580", + "message4586", + "message4610", + "message4615", + "message4623", + "message4625", + "message4627", + "message4642", + "message4646", + "message4647", + "message4662", + "message4666", + "message4679", + "message4684", + "message4690", + "message4696", + "message4700", + "message4708", + "message4709", + "message4712", + "message4718", + "message4720", + "message4732", + "message4734", + "message4737", + "message4739", + "message4747", + "message4749", + "message4764", + "message4769", + "message4774", + "message4775", + "message4777", + "message4778", + "message4782", + "message4783", + "message4804", + "message4815", + "message4817", + "message4819", + "message4821", + "message4825", + "message4829", + "message4830", + "message4835", + "message4836", + "message4837", + "message4841", + "message4844", + "message4852", + "message4856", + "message4865", + "message4869", + "message4871", + "message4887", + "message4896", + "message4900", + "message4916", + "message4917", + "message4919", + "message4921", + "message4924", + "message4926", + "message4928", + "message4931", + "message4936", + "message4938", + "message4939", + "message4942", + "message4951", + "message4956", + "message4957", + "message4958", + "message4961", + "message4964", + "message4966", + "message4971", + "message4974", + "message4980", + "message4983", + "message4990", + "message4995", + "message4998", + "message5000", + "message5007", + "message5013", + "message5021", + "message5026", + "message5028", + "message5041", + "message5047", + "message5053", + "message5055", + "message5064", + "message5065", + "message5069", + "message5078", + "message5079", + "message5085", + "message5093", + "message5095", + "message5106", + "message5107", + "message5109", + "message5111", + "message5120", + "message5125", + "message5126", + "message5133", + "message5135", + "message5143", + "message5147", + "message5148", + "message5150", + "message5152", + "message5164", + "message5166", + "message5171", + "message5183", + "message5190", + "message5193", + "message5195", + "message5200", + "message5201", + "message5212", + "message5222", + "message5231", + "message5232", + "message5233", + "message5234", + "message5242", + "message5243", + "message5248", + "message5249", + "message5251", + "message5257", + "message5259", + "message5261", + "message5277", + "message5280", + "message5286", + "message5287", + "message5290", + "message5302", + "message5305", + "message5307", + "message5309", + "message5314", + "message5322", + "message5324", + "message5329", + "message5330", + "message5333", + "message5341", + "message5350", + "message5374", + "message5378", + "message5380", + "message5384", + "message5387", + "message5393", + "message5400", + "message5410", + "message5411", + "message5413", + "message5424", + "message5430", + "message5431", + "message5433", + "message5436", + "message5445", + "message5448", + "message5450", + "message5451", + "message5454", + "message5467", + "message5468", + "message5470", + "message5472", + "message5487", + "message5489", + "message5493", + "message5496", + "message5502", + "message5507", + "message5517", + "message5522", + "message5524", + "message5542", + "message5552", + "message5562", + "message5566", + "message5572", + "message5573", + "message5574", + "message5581", + "message5585", + "message5586", + "message5589", + "message5594", + "message5595", + "message5597", + "message5599", + "message5601", + "message5602", + "message5603", + "message5605", + "message5610", + "message5617", + "message5619", + "message5626", + "message5632", + "message5636", + "message5639", + "message5641", + "message5647", + "message5648", + "message5652", + "message5664", + "message5668", + "message5704", + "message5705", + "message5709", + "message5710", + "message5713", + "message5716", + "message5731", + "message5732", + "message5744", + "message5745", + "message5750", + "message5755", + "message5766", + "message5768", + "message5771", + "message5774", + "message5782", + "message5794", + "message5795", + "message5804", + "message5807", + "message5809", + "message5816", + "message5820", + "message5824", + "message5825", + "message5827", + "message5831", + "message5835", + "message5836", + "message5844", + "message5845", + "message5849", + "message5857", + "message5862", + "message5864", + "message5871", + "message5879", + "message5884", + "message5892", + "message5896", + "message5905", + "message5907", + "message5908", + "message5919", + "message5920", + "message5925", + "message5927", + "message5929", + "message5932", + "message5935", + "message5942", + "message5944", + "message5947", + "message5952", + "message5954", + "message5956", + "message5962", + "message5963", + "message5968", + "message5984", + "message5993", + "message5994", + "message8801", + "message8802", + "message8803", + "message8804", + "message8805", + "message8806_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8807", + "message8808", + "message8809", + "message8810", + "message8811", + "message8812", + "message8813", + "message8814", + "message8815", + "message8816_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8817", + "message8818", + "message8819", + "message8820", + "message8821", + "message8822", + "message8823", + "message8824", + "message8825", + "message8826_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8827", + "message8828", + "message8829", + "message8830", + "message8831", + "message8832", + "message8833", + "message8834", + "message8835", + "message8836_xxxxxxxxxxxxxxxxxxxxxxxxx", + "message8837", + "message8838", + "message8839", + "message8840", + "message8841", + "message8842", + "message8843", + "message8844", + "message8845", + "message8846_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8847", + "message8848", + "message8849", + "message8850", + "message8851", + "message8852", + "message8853", + "message8854", + "message8855", + "message8856_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8857", + "message8858", + "message8859", + "message8860", + "message8861", + "message8862", + "message8863", + "message8864", + "message8865", + "message8866_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8867", + "message8868", + "message8869", + "message8870", + "message8871", + "message8872", + "message8873", + "message8874", + "message8875", + "message8876_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8877", + "message8878", + "message8879", + "message8880", + "message8881", + "message8882", + "message8883", + "message8884", + "message8885", + "message8886_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8887", + "message8888", + "message8889", + "message8890", + "message8891", + "message8892", + "message8893", + "message8894", + "message8895", + "message8896_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8897", + "message8898", + "message8899", + "message8900_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8901", + "message8902", + "message8903", + "message8904", + "message8905", + "message8906_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8907", + "message8908", + "message8909", + "message8910", + "message8911", + "message8912", + "message8913", + "message8914", + "message8915", + "message8916_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8917", + "message8918", + "message8919", + "message8920", + "message8921", + "message8922", + "message8923", + "message8924", + "message8925", + "message8926_xxxxxxxxx", + "message8927", + "message8928", + "message8929", + "message8930", + "message8931", + "message8932", + "message8933", + "message8934", + "message8935", + "message8936_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8937", + "message8938", + "message8939", + "message8940", + "message8941", + "message8942", + "message8943", + "message8944", + "message8945", + "message8946_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8947", + "message8948", + "message8949", + "message8950", + "message8951", + "message8952", + "message8953", + "message8954", + "message8955", + "message8956_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8957", + "message8958", + "message8959", + "message8960", + "message8961", + "message8962", + "message8963", + "message8964", + "message8965", + "message8966_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8967", + "message8968", + "message8969", + "message8970", + "message8971", + "message8972", + "message8973", + "message8974", + "message8975", + "message8976_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8977", + "message8978", + "message8979", + "message8980", + "message8981", + "message8982", + "message8983", + "message8984", + "message8985", + "message8986_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8987", + "message8988", + "message8989", + "message8990", + "message8991", + "message8992", + "message8993", + "message8994", + "message8995", + "message8996_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message8997", + "message8998", + "message8999", + "message9000_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9001", + "message9002", + "message9003", + "message9004", + "message9005", + "message9006_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9007", + "message9008", + "message9009", + "message9010", + "message9011", + "message9012", + "message9013", + "message9014", + "message9015", + "message9016_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9017", + "message9018", + "message9019", + "message9020", + "message9021", + "message9022", + "message9023", + "message9024", + "message9025", + "message9026_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9027", + "message9028", + "message9029", + "message9030", + "message9031", + "message9032", + "message9033", + "message9034", + "message9035", + "message9036_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9037", + "message9038", + "message9039", + "message9040", + "message9041", + "message9042", + "message9043", + "message9044", + "message9045", + "message9046_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9047", + "message9048", + "message9049", + "message9050", + "message9051", + "message9052", + "message9053", + "message9054", + "message9055", + "message9056_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9057", + "message9058", + "message9059", + "message9060", + "message9061", + "message9062", + "message9063", + "message9064", + "message9065", + "message9066_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9067", + "message9068", + "message9069", + "message9070", + "message9071", + "message9072", + "message9073", + "message9074", + "message9075", + "message9076_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9077", + "message9078", + "message9079", + "message9080", + "message9081", + "message9082", + "message9083", + "message9084", + "message9085", + "message9086_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9087", + "message9088", + "message9089", + "message9090", + "message9091", + "message9092", + "message9093", + "message9094", + "message9095", + "message9096_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9097", + "message9098", + "message9099", + "message9100_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9101", + "message9102", + "message9103", + "message9104", + "message9105", + "message9106_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9107", + "message9108", + "message9109", + "message9110", + "message9111", + "message9112", + "message9113", + "message9114", + "message9115", + "message9116_xxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9117", + "message9118", + "message9119", + "message9120", + "message9121", + "message9122", + "message9123", + "message9124", + "message9125", + "message9126_xxxxxxxxxxxxxxx", + "message9127", + "message9128", + "message9129", + "message9130", + "message9131", + "message9132", + "message9133", + "message9134", + "message9135", + "message9136_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9137", + "message9138", + "message9139", + "message9140", + "message9141", + "message9142", + "message9143", + "message9144", + "message9145", + "message9146_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9147", + "message9148", + "message9149", + "message9150", + "message9151", + "message9152", + "message9153", + "message9154", + "message9155", + "message9156_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9157", + "message9158", + "message9159", + "message9160", + "message9161", + "message9162", + "message9163", + "message9164", + "message9165", + "message9166_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9167", + "message9168", + "message9169", + "message9170", + "message9171", + "message9172", + "message9173", + "message9174", + "message9175", + "message9176_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9177", + "message9178", + "message9179", + "message9180", + "message9181", + "message9182", + "message9183", + "message9184", + "message9185", + "message9186_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9187", + "message9188", + "message9189", + "message9190", + "message9191", + "message9192", + "message9193", + "message9194", + "message9195", + "message9196_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9197", + "message9198", + "message9199", + "message9200_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ] + }, + { + "key": "CCC", + "messages": [ + "message4", + "message9", + "message14", + "message19", + "message24", + "message29", + "message34", + "message39", + "message44", + "message49", + "message54", + "message59", + "message64", + "message69", + "message74", + "message79", + "message84", + "message89", + "message94", + "message99", + "message104", + "message109", + "message114", + "message119", + "message124", + "message129", + "message134", + "message139", + "message144", + "message149", + "message154", + "message159", + "message164", + "message169", + "message174", + "message179", + "message184", + "message189", + "message194", + "message199", + "message204", + "message209", + "message214", + "message219", + "message224", + "message229", + "message234", + "message239", + "message244", + "message249", + "message254", + "message259", + "message264", + "message269", + "message274", + "message279", + "message284", + "message289", + "message294", + "message299", + "message304", + "message309", + "message314", + "message319", + "message324", + "message329", + "message334", + "message339", + "message344", + "message349", + "message354", + "message359", + "message364", + "message369", + "message374", + "message379", + "message384", + "message389", + "message394", + "message399", + "message404", + "message409", + "message414", + "message419", + "message424", + "message429", + "message434", + "message439", + "message444", + "message449", + "message454", + "message459", + "message464", + "message469", + "message474", + "message479", + "message484", + "message489", + "message494", + "message499", + "message504", + "message509", + "message514", + "message519", + "message524", + "message529", + "message534", + "message539", + "message544", + "message549", + "message554", + "message559", + "message564", + "message569", + "message574", + "message579", + "message584", + "message589", + "message594", + "message599", + "message604", + "message609", + "message614", + "message619", + "message624", + "message629", + "message634", + "message639", + "message644", + "message649", + "message654", + "message659", + "message664", + "message669", + "message674", + "message679", + "message684", + "message689", + "message694", + "message699", + "message704", + "message709", + "message714", + "message719", + "message724", + "message729", + "message734", + "message739", + "message744", + "message749", + "message754", + "message759", + "message764", + "message769", + "message774", + "message779", + "message784", + "message789", + "message794", + "message799", + "message804", + "message809", + "message814", + "message819", + "message824", + "message829", + "message834", + "message839", + "message844", + "message849", + "message854", + "message859", + "message864", + "message869", + "message874", + "message879", + "message884", + "message889", + "message894", + "message899", + "message904", + "message909", + "message914", + "message919", + "message924", + "message929", + "message934", + "message939", + "message944", + "message949", + "message954", + "message959", + "message964", + "message969", + "message974", + "message979", + "message984", + "message989", + "message994", + "message999", + "message1004", + "message1009", + "message1014", + "message1019", + "message1024", + "message1029", + "message1034", + "message1039", + "message1044", + "message1049", + "message1054", + "message1059", + "message1064", + "message1069", + "message1074", + "message1079", + "message1084", + "message1089", + "message1094", + "message1099", + "message1104", + "message1109", + "message1114", + "message1119", + "message1124", + "message1129", + "message1134", + "message1139", + "message1144", + "message1149", + "message1154", + "message1159", + "message1164", + "message1169", + "message1174", + "message1179", + "message1184", + "message1189", + "message1194", + "message1199", + "message1204", + "message1209", + "message1214", + "message1219", + "message1224", + "message1229", + "message1234", + "message1239", + "message1244", + "message1249", + "message1254", + "message1259", + "message1264", + "message1269", + "message1274", + "message1279", + "message1284", + "message1289", + "message1294", + "message1299", + "message1304", + "message1309", + "message1314", + "message1319", + "message1324", + "message1329", + "message1334", + "message1339", + "message1344", + "message1349", + "message1354", + "message1359", + "message1364", + "message1369", + "message1374", + "message1379", + "message1384", + "message1389", + "message1394", + "message1399", + "message1404", + "message1409", + "message1414", + "message1419", + "message1424", + "message1429", + "message1434", + "message1439", + "message1444", + "message1449", + "message1454", + "message1459", + "message1464", + "message1469", + "message1474", + "message1479", + "message1484", + "message1489", + "message1494", + "message1499", + "message1504", + "message1509", + "message1514", + "message1519", + "message1524", + "message1529", + "message1534", + "message1539", + "message1544", + "message1549", + "message1554", + "message1559", + "message1564", + "message1569", + "message1574", + "message1579", + "message1584", + "message1589", + "message1594", + "message1599", + "message1604", + "message1609", + "message1614", + "message1619", + "message1624", + "message1629", + "message1634", + "message1639", + "message1644", + "message1649", + "message1654", + "message1659", + "message1664", + "message1669", + "message1674", + "message1679", + "message1684", + "message1689", + "message1694", + "message1699", + "message1704", + "message1709", + "message1714", + "message1719", + "message1724", + "message1729", + "message1734", + "message1739", + "message1744", + "message1749", + "message1754", + "message1759", + "message1764", + "message1769", + "message1774", + "message1779", + "message1784", + "message1789", + "message1794", + "message1799", + "message1804", + "message1809", + "message1814", + "message1819", + "message1824", + "message1829", + "message1834", + "message1839", + "message1844", + "message1849", + "message1854", + "message1859", + "message1864", + "message1869", + "message1874", + "message1879", + "message1884", + "message1889", + "message1894", + "message1899", + "message1904", + "message1909", + "message1914", + "message1919", + "message1924", + "message1929", + "message1934", + "message1939", + "message1944", + "message1949", + "message1954", + "message1959", + "message1964", + "message1969", + "message1974", + "message1979", + "message1984", + "message1989", + "message1994", + "message1999", + "message3201", + "message3202", + "message3203", + "message3204", + "message3205", + "message3206", + "message3207", + "message3208", + "message3209", + "message3210", + "message3211", + "message3212", + "message3213", + "message3214", + "message3215", + "message3216", + "message3217", + "message3218", + "message3219", + "message3220", + "message3221", + "message3222", + "message3223", + "message3224", + "message3225", + "message3226", + "message3227", + "message3228", + "message3229", + "message3230", + "message3231", + "message3232", + "message3233", + "message3234", + "message3235", + "message3236", + "message3237", + "message3238", + "message3239", + "message3240", + "message3241", + "message3242", + "message3243", + "message3244", + "message3245", + "message3246", + "message3247", + "message3248", + "message3249", + "message3250", + "message3251", + "message3252", + "message3253", + "message3254", + "message3255", + "message3256", + "message3257", + "message3258", + "message3259", + "message3260", + "message3261", + "message3262", + "message3263", + "message3264", + "message3265", + "message3266", + "message3267", + "message3268", + "message3269", + "message3270", + "message3271", + "message3272", + "message3273", + "message3274", + "message3275", + "message3276", + "message3277", + "message3278", + "message3279", + "message3280", + "message3281", + "message3282", + "message3283", + "message3284", + "message3285", + "message3286", + "message3287", + "message3288", + "message3289", + "message3290", + "message3291", + "message3292", + "message3293", + "message3294", + "message3295", + "message3296", + "message3297", + "message3298", + "message3299", + "message3300", + "message3301", + "message3302", + "message3303", + "message3304", + "message3305", + "message3306", + "message3307", + "message3308", + "message3309", + "message3310", + "message3311", + "message3312", + "message3313", + "message3314", + "message3315", + "message3316", + "message3317", + "message3318", + "message3319", + "message3320", + "message3321", + "message3322", + "message3323", + "message3324", + "message3325", + "message3326", + "message3327", + "message3328", + "message3329", + "message3330", + "message3331", + "message3332", + "message3333", + "message3334", + "message3335", + "message3336", + "message3337", + "message3338", + "message3339", + "message3340", + "message3341", + "message3342", + "message3343", + "message3344", + "message3345", + "message3346", + "message3347", + "message3348", + "message3349", + "message3350", + "message3351", + "message3352", + "message3353", + "message3354", + "message3355", + "message3356", + "message3357", + "message3358", + "message3359", + "message3360", + "message3361", + "message3362", + "message3363", + "message3364", + "message3365", + "message3366", + "message3367", + "message3368", + "message3369", + "message3370", + "message3371", + "message3372", + "message3373", + "message3374", + "message3375", + "message3376", + "message3377", + "message3378", + "message3379", + "message3380", + "message3381", + "message3382", + "message3383", + "message3384", + "message3385", + "message3386", + "message3387", + "message3388", + "message3389", + "message3390", + "message3391", + "message3392", + "message3393", + "message3394", + "message3395", + "message3396", + "message3397", + "message3398", + "message3399", + "message3400", + "message3401", + "message3402", + "message3403", + "message3404", + "message3405", + "message3406", + "message3407", + "message3408", + "message3409", + "message3410", + "message3411", + "message3412", + "message3413", + "message3414", + "message3415", + "message3416", + "message3417", + "message3418", + "message3419", + "message3420", + "message3421", + "message3422", + "message3423", + "message3424", + "message3425", + "message3426", + "message3427", + "message3428", + "message3429", + "message3430", + "message3431", + "message3432", + "message3433", + "message3434", + "message3435", + "message3436", + "message3437", + "message3438", + "message3439", + "message3440", + "message3441", + "message3442", + "message3443", + "message3444", + "message3445", + "message3446", + "message3447", + "message3448", + "message3449", + "message3450", + "message3451", + "message3452", + "message3453", + "message3454", + "message3455", + "message3456", + "message3457", + "message3458", + "message3459", + "message3460", + "message3461", + "message3462", + "message3463", + "message3464", + "message3465", + "message3466", + "message3467", + "message3468", + "message3469", + "message3470", + "message3471", + "message3472", + "message3473", + "message3474", + "message3475", + "message3476", + "message3477", + "message3478", + "message3479", + "message3480", + "message3481", + "message3482", + "message3483", + "message3484", + "message3485", + "message3486", + "message3487", + "message3488", + "message3489", + "message3490", + "message3491", + "message3492", + "message3493", + "message3494", + "message3495", + "message3496", + "message3497", + "message3498", + "message3499", + "message3500", + "message3501", + "message3502", + "message3503", + "message3504", + "message3505", + "message3506", + "message3507", + "message3508", + "message3509", + "message3510", + "message3511", + "message3512", + "message3513", + "message3514", + "message3515", + "message3516", + "message3517", + "message3518", + "message3519", + "message3520", + "message3521", + "message3522", + "message3523", + "message3524", + "message3525", + "message3526", + "message3527", + "message3528", + "message3529", + "message3530", + "message3531", + "message3532", + "message3533", + "message3534", + "message3535", + "message3536", + "message3537", + "message3538", + "message3539", + "message3540", + "message3541", + "message3542", + "message3543", + "message3544", + "message3545", + "message3546", + "message3547", + "message3548", + "message3549", + "message3550", + "message3551", + "message3552", + "message3553", + "message3554", + "message3555", + "message3556", + "message3557", + "message3558", + "message3559", + "message3560", + "message3561", + "message3562", + "message3563", + "message3564", + "message3565", + "message3566", + "message3567", + "message3568", + "message3569", + "message3570", + "message3571", + "message3572", + "message3573", + "message3574", + "message3575", + "message3576", + "message3577", + "message3578", + "message3579", + "message3580", + "message3581", + "message3582", + "message3583", + "message3584", + "message3585", + "message3586", + "message3587", + "message3588", + "message3589", + "message3590", + "message3591", + "message3592", + "message3593", + "message3594", + "message3595", + "message3596", + "message3597", + "message3598", + "message3599", + "message3600", + "message4001", + "message4004", + "message4006", + "message4017", + "message4018", + "message4019", + "message4021", + "message4029", + "message4030", + "message4032", + "message4034", + "message4038", + "message4046", + "message4048", + "message4049", + "message4056", + "message4060", + "message4065", + "message4071", + "message4072", + "message4073", + "message4075", + "message4076", + "message4080", + "message4082", + "message4084", + "message4092", + "message4096", + "message4097", + "message4105", + "message4107", + "message4111", + "message4112", + "message4120", + "message4121", + "message4123", + "message4128", + "message4134", + "message4141", + "message4143", + "message4149", + "message4150", + "message4156", + "message4161", + "message4174", + "message4180", + "message4182", + "message4188", + "message4196", + "message4200", + "message4213", + "message4222", + "message4224", + "message4228", + "message4233", + "message4236", + "message4237", + "message4238", + "message4242", + "message4244", + "message4258", + "message4262", + "message4282", + "message4283", + "message4285", + "message4290", + "message4297", + "message4302", + "message4303", + "message4305", + "message4306", + "message4307", + "message4319", + "message4324", + "message4328", + "message4332", + "message4336", + "message4340", + "message4342", + "message4343", + "message4345", + "message4357", + "message4370", + "message4375", + "message4382", + "message4383", + "message4385", + "message4395", + "message4396", + "message4406", + "message4409", + "message4410", + "message4415", + "message4418", + "message4421", + "message4422", + "message4436", + "message4437", + "message4452", + "message4453", + "message4454", + "message4457", + "message4458", + "message4469", + "message4481", + "message4484", + "message4490", + "message4496", + "message4498", + "message4500", + "message4522", + "message4523", + "message4526", + "message4537", + "message4540", + "message4541", + "message4546", + "message4547", + "message4558", + "message4569", + "message4571", + "message4572", + "message4573", + "message4578", + "message4582", + "message4587", + "message4588", + "message4592", + "message4594", + "message4599", + "message4605", + "message4611", + "message4612", + "message4613", + "message4619", + "message4622", + "message4628", + "message4636", + "message4641", + "message4661", + "message4667", + "message4670", + "message4674", + "message4688", + "message4692", + "message4701", + "message4702", + "message4707", + "message4713", + "message4727", + "message4744", + "message4745", + "message4748", + "message4750", + "message4753", + "message4765", + "message4768", + "message4771", + "message4772", + "message4776", + "message4779", + "message4781", + "message4788", + "message4790", + "message4791", + "message4796", + "message4797", + "message4799", + "message4807", + "message4811", + "message4812", + "message4818", + "message4820", + "message4827", + "message4831", + "message4832", + "message4833", + "message4838", + "message4840", + "message4847", + "message4848", + "message4849", + "message4855", + "message4860", + "message4868", + "message4873", + "message4880", + "message4881", + "message4883", + "message4884", + "message4891", + "message4897", + "message4898", + "message4901", + "message4905", + "message4912", + "message4913", + "message4925", + "message4927", + "message4940", + "message4941", + "message4945", + "message4950", + "message4953", + "message4960", + "message4970", + "message4973", + "message4975", + "message4977", + "message4981", + "message4989", + "message4992", + "message4999", + "message5002", + "message5006", + "message5008", + "message5020", + "message5023", + "message5025", + "message5029", + "message5031", + "message5033", + "message5038", + "message5042", + "message5043", + "message5044", + "message5045", + "message5046", + "message5068", + "message5070", + "message5072", + "message5082", + "message5089", + "message5091", + "message5097", + "message5102", + "message5113", + "message5128", + "message5131", + "message5138", + "message5151", + "message5162", + "message5165", + "message5181", + "message5186", + "message5189", + "message5192", + "message5194", + "message5199", + "message5202", + "message5205", + "message5209", + "message5214", + "message5221", + "message5225", + "message5240", + "message5247", + "message5253", + "message5258", + "message5260", + "message5267", + "message5269", + "message5272", + "message5291", + "message5294", + "message5298", + "message5301", + "message5306", + "message5310", + "message5312", + "message5318", + "message5326", + "message5327", + "message5339", + "message5344", + "message5346", + "message5347", + "message5348", + "message5352", + "message5353", + "message5354", + "message5358", + "message5360", + "message5361", + "message5371", + "message5376", + "message5377", + "message5385", + "message5390", + "message5391", + "message5396", + "message5397", + "message5399", + "message5401", + "message5404", + "message5407", + "message5409", + "message5415", + "message5416", + "message5437", + "message5455", + "message5457", + "message5460", + "message5462", + "message5465", + "message5471", + "message5475", + "message5476", + "message5485", + "message5495", + "message5501", + "message5506", + "message5510", + "message5512", + "message5515", + "message5516", + "message5535", + "message5546", + "message5547", + "message5561", + "message5565", + "message5583", + "message5584", + "message5587", + "message5596", + "message5611", + "message5621", + "message5627", + "message5631", + "message5640", + "message5642", + "message5649", + "message5655", + "message5657", + "message5658", + "message5666", + "message5667", + "message5670", + "message5676", + "message5678", + "message5682", + "message5684", + "message5691", + "message5693", + "message5717", + "message5718", + "message5719", + "message5722", + "message5730", + "message5733", + "message5735", + "message5738", + "message5740", + "message5741", + "message5749", + "message5758", + "message5762", + "message5764", + "message5773", + "message5787", + "message5790", + "message5796", + "message5797", + "message5803", + "message5808", + "message5810", + "message5814", + "message5823", + "message5828", + "message5829", + "message5832", + "message5843", + "message5846", + "message5847", + "message5852", + "message5853", + "message5855", + "message5866", + "message5873", + "message5875", + "message5880", + "message5891", + "message5897", + "message5898", + "message5902", + "message5904", + "message5923", + "message5930", + "message5931", + "message5934", + "message5939", + "message5943", + "message5946", + "message5959", + "message5974", + "message5976", + "message5987", + "message5988", + "message5989", + "message6000", + "message9201", + "message9202", + "message9203", + "message9204", + "message9205", + "message9206_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9207", + "message9208", + "message9209", + "message9210", + "message9211", + "message9212", + "message9213", + "message9214", + "message9215", + "message9216_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9217", + "message9218", + "message9219", + "message9220", + "message9221", + "message9222", + "message9223", + "message9224", + "message9225", + "message9226_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9227", + "message9228", + "message9229", + "message9230", + "message9231", + "message9232", + "message9233", + "message9234", + "message9235", + "message9236_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9237", + "message9238", + "message9239", + "message9240", + "message9241", + "message9242", + "message9243", + "message9244", + "message9245", + "message9246_xxxxxxxxxxxxx", + "message9247", + "message9248", + "message9249", + "message9250", + "message9251", + "message9252", + "message9253", + "message9254", + "message9255", + "message9256_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9257", + "message9258", + "message9259", + "message9260", + "message9261", + "message9262", + "message9263", + "message9264", + "message9265", + "message9266_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9267", + "message9268", + "message9269", + "message9270", + "message9271", + "message9272", + "message9273", + "message9274", + "message9275", + "message9276_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9277", + "message9278", + "message9279", + "message9280", + "message9281", + "message9282", + "message9283", + "message9284", + "message9285", + "message9286_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9287", + "message9288", + "message9289", + "message9290", + "message9291", + "message9292", + "message9293", + "message9294", + "message9295", + "message9296_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9297", + "message9298", + "message9299", + "message9300_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9301", + "message9302", + "message9303", + "message9304", + "message9305", + "message9306_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9307", + "message9308", + "message9309", + "message9310", + "message9311", + "message9312", + "message9313", + "message9314", + "message9315", + "message9316_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9317", + "message9318", + "message9319", + "message9320", + "message9321", + "message9322", + "message9323", + "message9324", + "message9325", + "message9326_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9327", + "message9328", + "message9329", + "message9330", + "message9331", + "message9332", + "message9333", + "message9334", + "message9335", + "message9336_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9337", + "message9338", + "message9339", + "message9340", + "message9341", + "message9342", + "message9343", + "message9344", + "message9345", + "message9346_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9347", + "message9348", + "message9349", + "message9350", + "message9351", + "message9352", + "message9353", + "message9354", + "message9355", + "message9356_xxxxxxxxxxxxxxxx", + "message9357", + "message9358", + "message9359", + "message9360", + "message9361", + "message9362", + "message9363", + "message9364", + "message9365", + "message9366_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9367", + "message9368", + "message9369", + "message9370", + "message9371", + "message9372", + "message9373", + "message9374", + "message9375", + "message9376_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9377", + "message9378", + "message9379", + "message9380", + "message9381", + "message9382", + "message9383", + "message9384", + "message9385", + "message9386_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9387", + "message9388", + "message9389", + "message9390", + "message9391", + "message9392", + "message9393", + "message9394", + "message9395", + "message9396_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9397", + "message9398", + "message9399", + "message9400_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9401", + "message9402", + "message9403", + "message9404", + "message9405", + "message9406_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9407", + "message9408", + "message9409", + "message9410", + "message9411", + "message9412", + "message9413", + "message9414", + "message9415", + "message9416_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9417", + "message9418", + "message9419", + "message9420", + "message9421", + "message9422", + "message9423", + "message9424", + "message9425", + "message9426_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9427", + "message9428", + "message9429", + "message9430", + "message9431", + "message9432", + "message9433", + "message9434", + "message9435", + "message9436_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9437", + "message9438", + "message9439", + "message9440", + "message9441", + "message9442", + "message9443", + "message9444", + "message9445", + "message9446_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9447", + "message9448", + "message9449", + "message9450", + "message9451", + "message9452", + "message9453", + "message9454", + "message9455", + "message9456_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9457", + "message9458", + "message9459", + "message9460", + "message9461", + "message9462", + "message9463", + "message9464", + "message9465", + "message9466_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9467", + "message9468", + "message9469", + "message9470", + "message9471", + "message9472", + "message9473", + "message9474", + "message9475", + "message9476_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9477", + "message9478", + "message9479", + "message9480", + "message9481", + "message9482", + "message9483", + "message9484", + "message9485", + "message9486_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9487", + "message9488", + "message9489", + "message9490", + "message9491", + "message9492", + "message9493", + "message9494", + "message9495", + "message9496_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9497", + "message9498", + "message9499", + "message9500_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9501", + "message9502", + "message9503", + "message9504", + "message9505", + "message9506_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9507", + "message9508", + "message9509", + "message9510", + "message9511", + "message9512", + "message9513", + "message9514", + "message9515", + "message9516_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9517", + "message9518", + "message9519", + "message9520", + "message9521", + "message9522", + "message9523", + "message9524", + "message9525", + "message9526_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9527", + "message9528", + "message9529", + "message9530", + "message9531", + "message9532", + "message9533", + "message9534", + "message9535", + "message9536_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9537", + "message9538", + "message9539", + "message9540", + "message9541", + "message9542", + "message9543", + "message9544", + "message9545", + "message9546_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9547", + "message9548", + "message9549", + "message9550", + "message9551", + "message9552", + "message9553", + "message9554", + "message9555", + "message9556_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9557", + "message9558", + "message9559", + "message9560", + "message9561", + "message9562", + "message9563", + "message9564", + "message9565", + "message9566_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9567", + "message9568", + "message9569", + "message9570", + "message9571", + "message9572", + "message9573", + "message9574", + "message9575", + "message9576_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9577", + "message9578", + "message9579", + "message9580", + "message9581", + "message9582", + "message9583", + "message9584", + "message9585", + "message9586_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9587", + "message9588", + "message9589", + "message9590", + "message9591", + "message9592", + "message9593", + "message9594", + "message9595", + "message9596_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9597", + "message9598", + "message9599", + "message9600_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ] + }, + { + "key": "DDD", + "messages": [ + "message5", + "message10", + "message15", + "message20", + "message25", + "message30", + "message35", + "message40", + "message45", + "message50", + "message55", + "message60", + "message65", + "message70", + "message75", + "message80", + "message85", + "message90", + "message95", + "message100", + "message105", + "message110", + "message115", + "message120", + "message125", + "message130", + "message135", + "message140", + "message145", + "message150", + "message155", + "message160", + "message165", + "message170", + "message175", + "message180", + "message185", + "message190", + "message195", + "message200", + "message205", + "message210", + "message215", + "message220", + "message225", + "message230", + "message235", + "message240", + "message245", + "message250", + "message255", + "message260", + "message265", + "message270", + "message275", + "message280", + "message285", + "message290", + "message295", + "message300", + "message305", + "message310", + "message315", + "message320", + "message325", + "message330", + "message335", + "message340", + "message345", + "message350", + "message355", + "message360", + "message365", + "message370", + "message375", + "message380", + "message385", + "message390", + "message395", + "message400", + "message405", + "message410", + "message415", + "message420", + "message425", + "message430", + "message435", + "message440", + "message445", + "message450", + "message455", + "message460", + "message465", + "message470", + "message475", + "message480", + "message485", + "message490", + "message495", + "message500", + "message505", + "message510", + "message515", + "message520", + "message525", + "message530", + "message535", + "message540", + "message545", + "message550", + "message555", + "message560", + "message565", + "message570", + "message575", + "message580", + "message585", + "message590", + "message595", + "message600", + "message605", + "message610", + "message615", + "message620", + "message625", + "message630", + "message635", + "message640", + "message645", + "message650", + "message655", + "message660", + "message665", + "message670", + "message675", + "message680", + "message685", + "message690", + "message695", + "message700", + "message705", + "message710", + "message715", + "message720", + "message725", + "message730", + "message735", + "message740", + "message745", + "message750", + "message755", + "message760", + "message765", + "message770", + "message775", + "message780", + "message785", + "message790", + "message795", + "message800", + "message805", + "message810", + "message815", + "message820", + "message825", + "message830", + "message835", + "message840", + "message845", + "message850", + "message855", + "message860", + "message865", + "message870", + "message875", + "message880", + "message885", + "message890", + "message895", + "message900", + "message905", + "message910", + "message915", + "message920", + "message925", + "message930", + "message935", + "message940", + "message945", + "message950", + "message955", + "message960", + "message965", + "message970", + "message975", + "message980", + "message985", + "message990", + "message995", + "message1000", + "message1005", + "message1010", + "message1015", + "message1020", + "message1025", + "message1030", + "message1035", + "message1040", + "message1045", + "message1050", + "message1055", + "message1060", + "message1065", + "message1070", + "message1075", + "message1080", + "message1085", + "message1090", + "message1095", + "message1100", + "message1105", + "message1110", + "message1115", + "message1120", + "message1125", + "message1130", + "message1135", + "message1140", + "message1145", + "message1150", + "message1155", + "message1160", + "message1165", + "message1170", + "message1175", + "message1180", + "message1185", + "message1190", + "message1195", + "message1200", + "message1205", + "message1210", + "message1215", + "message1220", + "message1225", + "message1230", + "message1235", + "message1240", + "message1245", + "message1250", + "message1255", + "message1260", + "message1265", + "message1270", + "message1275", + "message1280", + "message1285", + "message1290", + "message1295", + "message1300", + "message1305", + "message1310", + "message1315", + "message1320", + "message1325", + "message1330", + "message1335", + "message1340", + "message1345", + "message1350", + "message1355", + "message1360", + "message1365", + "message1370", + "message1375", + "message1380", + "message1385", + "message1390", + "message1395", + "message1400", + "message1405", + "message1410", + "message1415", + "message1420", + "message1425", + "message1430", + "message1435", + "message1440", + "message1445", + "message1450", + "message1455", + "message1460", + "message1465", + "message1470", + "message1475", + "message1480", + "message1485", + "message1490", + "message1495", + "message1500", + "message1505", + "message1510", + "message1515", + "message1520", + "message1525", + "message1530", + "message1535", + "message1540", + "message1545", + "message1550", + "message1555", + "message1560", + "message1565", + "message1570", + "message1575", + "message1580", + "message1585", + "message1590", + "message1595", + "message1600", + "message1605", + "message1610", + "message1615", + "message1620", + "message1625", + "message1630", + "message1635", + "message1640", + "message1645", + "message1650", + "message1655", + "message1660", + "message1665", + "message1670", + "message1675", + "message1680", + "message1685", + "message1690", + "message1695", + "message1700", + "message1705", + "message1710", + "message1715", + "message1720", + "message1725", + "message1730", + "message1735", + "message1740", + "message1745", + "message1750", + "message1755", + "message1760", + "message1765", + "message1770", + "message1775", + "message1780", + "message1785", + "message1790", + "message1795", + "message1800", + "message1805", + "message1810", + "message1815", + "message1820", + "message1825", + "message1830", + "message1835", + "message1840", + "message1845", + "message1850", + "message1855", + "message1860", + "message1865", + "message1870", + "message1875", + "message1880", + "message1885", + "message1890", + "message1895", + "message1900", + "message1905", + "message1910", + "message1915", + "message1920", + "message1925", + "message1930", + "message1935", + "message1940", + "message1945", + "message1950", + "message1955", + "message1960", + "message1965", + "message1970", + "message1975", + "message1980", + "message1985", + "message1990", + "message1995", + "message2000", + "message3601", + "message3602", + "message3603", + "message3604", + "message3605", + "message3606", + "message3607", + "message3608", + "message3609", + "message3610", + "message3611", + "message3612", + "message3613", + "message3614", + "message3615", + "message3616", + "message3617", + "message3618", + "message3619", + "message3620", + "message3621", + "message3622", + "message3623", + "message3624", + "message3625", + "message3626", + "message3627", + "message3628", + "message3629", + "message3630", + "message3631", + "message3632", + "message3633", + "message3634", + "message3635", + "message3636", + "message3637", + "message3638", + "message3639", + "message3640", + "message3641", + "message3642", + "message3643", + "message3644", + "message3645", + "message3646", + "message3647", + "message3648", + "message3649", + "message3650", + "message3651", + "message3652", + "message3653", + "message3654", + "message3655", + "message3656", + "message3657", + "message3658", + "message3659", + "message3660", + "message3661", + "message3662", + "message3663", + "message3664", + "message3665", + "message3666", + "message3667", + "message3668", + "message3669", + "message3670", + "message3671", + "message3672", + "message3673", + "message3674", + "message3675", + "message3676", + "message3677", + "message3678", + "message3679", + "message3680", + "message3681", + "message3682", + "message3683", + "message3684", + "message3685", + "message3686", + "message3687", + "message3688", + "message3689", + "message3690", + "message3691", + "message3692", + "message3693", + "message3694", + "message3695", + "message3696", + "message3697", + "message3698", + "message3699", + "message3700", + "message3701", + "message3702", + "message3703", + "message3704", + "message3705", + "message3706", + "message3707", + "message3708", + "message3709", + "message3710", + "message3711", + "message3712", + "message3713", + "message3714", + "message3715", + "message3716", + "message3717", + "message3718", + "message3719", + "message3720", + "message3721", + "message3722", + "message3723", + "message3724", + "message3725", + "message3726", + "message3727", + "message3728", + "message3729", + "message3730", + "message3731", + "message3732", + "message3733", + "message3734", + "message3735", + "message3736", + "message3737", + "message3738", + "message3739", + "message3740", + "message3741", + "message3742", + "message3743", + "message3744", + "message3745", + "message3746", + "message3747", + "message3748", + "message3749", + "message3750", + "message3751", + "message3752", + "message3753", + "message3754", + "message3755", + "message3756", + "message3757", + "message3758", + "message3759", + "message3760", + "message3761", + "message3762", + "message3763", + "message3764", + "message3765", + "message3766", + "message3767", + "message3768", + "message3769", + "message3770", + "message3771", + "message3772", + "message3773", + "message3774", + "message3775", + "message3776", + "message3777", + "message3778", + "message3779", + "message3780", + "message3781", + "message3782", + "message3783", + "message3784", + "message3785", + "message3786", + "message3787", + "message3788", + "message3789", + "message3790", + "message3791", + "message3792", + "message3793", + "message3794", + "message3795", + "message3796", + "message3797", + "message3798", + "message3799", + "message3800", + "message3801", + "message3802", + "message3803", + "message3804", + "message3805", + "message3806", + "message3807", + "message3808", + "message3809", + "message3810", + "message3811", + "message3812", + "message3813", + "message3814", + "message3815", + "message3816", + "message3817", + "message3818", + "message3819", + "message3820", + "message3821", + "message3822", + "message3823", + "message3824", + "message3825", + "message3826", + "message3827", + "message3828", + "message3829", + "message3830", + "message3831", + "message3832", + "message3833", + "message3834", + "message3835", + "message3836", + "message3837", + "message3838", + "message3839", + "message3840", + "message3841", + "message3842", + "message3843", + "message3844", + "message3845", + "message3846", + "message3847", + "message3848", + "message3849", + "message3850", + "message3851", + "message3852", + "message3853", + "message3854", + "message3855", + "message3856", + "message3857", + "message3858", + "message3859", + "message3860", + "message3861", + "message3862", + "message3863", + "message3864", + "message3865", + "message3866", + "message3867", + "message3868", + "message3869", + "message3870", + "message3871", + "message3872", + "message3873", + "message3874", + "message3875", + "message3876", + "message3877", + "message3878", + "message3879", + "message3880", + "message3881", + "message3882", + "message3883", + "message3884", + "message3885", + "message3886", + "message3887", + "message3888", + "message3889", + "message3890", + "message3891", + "message3892", + "message3893", + "message3894", + "message3895", + "message3896", + "message3897", + "message3898", + "message3899", + "message3900", + "message3901", + "message3902", + "message3903", + "message3904", + "message3905", + "message3906", + "message3907", + "message3908", + "message3909", + "message3910", + "message3911", + "message3912", + "message3913", + "message3914", + "message3915", + "message3916", + "message3917", + "message3918", + "message3919", + "message3920", + "message3921", + "message3922", + "message3923", + "message3924", + "message3925", + "message3926", + "message3927", + "message3928", + "message3929", + "message3930", + "message3931", + "message3932", + "message3933", + "message3934", + "message3935", + "message3936", + "message3937", + "message3938", + "message3939", + "message3940", + "message3941", + "message3942", + "message3943", + "message3944", + "message3945", + "message3946", + "message3947", + "message3948", + "message3949", + "message3950", + "message3951", + "message3952", + "message3953", + "message3954", + "message3955", + "message3956", + "message3957", + "message3958", + "message3959", + "message3960", + "message3961", + "message3962", + "message3963", + "message3964", + "message3965", + "message3966", + "message3967", + "message3968", + "message3969", + "message3970", + "message3971", + "message3972", + "message3973", + "message3974", + "message3975", + "message3976", + "message3977", + "message3978", + "message3979", + "message3980", + "message3981", + "message3982", + "message3983", + "message3984", + "message3985", + "message3986", + "message3987", + "message3988", + "message3989", + "message3990", + "message3991", + "message3992", + "message3993", + "message3994", + "message3995", + "message3996", + "message3997", + "message3998", + "message3999", + "message4000", + "message4014", + "message4015", + "message4016", + "message4022", + "message4024", + "message4027", + "message4028", + "message4031", + "message4035", + "message4041", + "message4043", + "message4045", + "message4050", + "message4052", + "message4054", + "message4058", + "message4064", + "message4066", + "message4074", + "message4087", + "message4088", + "message4090", + "message4093", + "message4126", + "message4127", + "message4129", + "message4133", + "message4135", + "message4139", + "message4145", + "message4148", + "message4165", + "message4167", + "message4168", + "message4179", + "message4185", + "message4189", + "message4191", + "message4194", + "message4198", + "message4203", + "message4206", + "message4219", + "message4226", + "message4229", + "message4234", + "message4243", + "message4246", + "message4251", + "message4253", + "message4255", + "message4271", + "message4272", + "message4274", + "message4275", + "message4278", + "message4284", + "message4287", + "message4289", + "message4296", + "message4301", + "message4310", + "message4317", + "message4329", + "message4330", + "message4338", + "message4346", + "message4348", + "message4350", + "message4351", + "message4362", + "message4364", + "message4368", + "message4378", + "message4381", + "message4384", + "message4386", + "message4398", + "message4405", + "message4407", + "message4411", + "message4413", + "message4423", + "message4424", + "message4427", + "message4429", + "message4431", + "message4445", + "message4471", + "message4474", + "message4476", + "message4492", + "message4494", + "message4497", + "message4508", + "message4514", + "message4518", + "message4519", + "message4521", + "message4524", + "message4531", + "message4532", + "message4533", + "message4538", + "message4542", + "message4544", + "message4551", + "message4553", + "message4556", + "message4560", + "message4563", + "message4566", + "message4567", + "message4575", + "message4584", + "message4585", + "message4593", + "message4596", + "message4597", + "message4598", + "message4606", + "message4607", + "message4620", + "message4624", + "message4634", + "message4635", + "message4650", + "message4652", + "message4655", + "message4659", + "message4660", + "message4664", + "message4665", + "message4671", + "message4672", + "message4676", + "message4680", + "message4691", + "message4694", + "message4699", + "message4710", + "message4714", + "message4721", + "message4724", + "message4728", + "message4729", + "message4730", + "message4731", + "message4736", + "message4743", + "message4746", + "message4751", + "message4757", + "message4759", + "message4762", + "message4785", + "message4786", + "message4787", + "message4792", + "message4801", + "message4808", + "message4842", + "message4845", + "message4846", + "message4851", + "message4853", + "message4859", + "message4861", + "message4863", + "message4876", + "message4882", + "message4888", + "message4889", + "message4890", + "message4893", + "message4894", + "message4906", + "message4929", + "message4933", + "message4947", + "message4948", + "message4949", + "message4954", + "message4963", + "message4968", + "message4969", + "message4988", + "message5004", + "message5005", + "message5015", + "message5022", + "message5027", + "message5032", + "message5037", + "message5048", + "message5051", + "message5052", + "message5056", + "message5060", + "message5066", + "message5067", + "message5071", + "message5073", + "message5074", + "message5076", + "message5081", + "message5083", + "message5084", + "message5090", + "message5096", + "message5104", + "message5108", + "message5118", + "message5121", + "message5124", + "message5134", + "message5142", + "message5144", + "message5155", + "message5156", + "message5157", + "message5159", + "message5161", + "message5167", + "message5169", + "message5170", + "message5173", + "message5208", + "message5215", + "message5218", + "message5223", + "message5224", + "message5227", + "message5228", + "message5229", + "message5239", + "message5246", + "message5250", + "message5263", + "message5265", + "message5275", + "message5276", + "message5278", + "message5281", + "message5282", + "message5285", + "message5288", + "message5304", + "message5315", + "message5317", + "message5319", + "message5323", + "message5328", + "message5342", + "message5356", + "message5359", + "message5362", + "message5364", + "message5365", + "message5370", + "message5379", + "message5382", + "message5389", + "message5395", + "message5398", + "message5412", + "message5421", + "message5422", + "message5425", + "message5426", + "message5439", + "message5440", + "message5441", + "message5443", + "message5446", + "message5452", + "message5461", + "message5464", + "message5469", + "message5474", + "message5477", + "message5479", + "message5480", + "message5482", + "message5483", + "message5484", + "message5486", + "message5490", + "message5494", + "message5499", + "message5504", + "message5511", + "message5518", + "message5519", + "message5526", + "message5528", + "message5529", + "message5536", + "message5538", + "message5541", + "message5543", + "message5544", + "message5545", + "message5548", + "message5549", + "message5550", + "message5551", + "message5554", + "message5555", + "message5556", + "message5560", + "message5569", + "message5575", + "message5577", + "message5588", + "message5592", + "message5609", + "message5612", + "message5616", + "message5618", + "message5625", + "message5628", + "message5630", + "message5633", + "message5634", + "message5637", + "message5646", + "message5651", + "message5654", + "message5656", + "message5661", + "message5671", + "message5673", + "message5674", + "message5677", + "message5680", + "message5683", + "message5688", + "message5690", + "message5695", + "message5696", + "message5698", + "message5699", + "message5702", + "message5703", + "message5721", + "message5723", + "message5726", + "message5728", + "message5734", + "message5753", + "message5760", + "message5767", + "message5778", + "message5783", + "message5785", + "message5788", + "message5789", + "message5793", + "message5799", + "message5815", + "message5818", + "message5819", + "message5821", + "message5830", + "message5839", + "message5841", + "message5850", + "message5859", + "message5860", + "message5863", + "message5877", + "message5885", + "message5886", + "message5903", + "message5906", + "message5909", + "message5910", + "message5912", + "message5917", + "message5918", + "message5924", + "message5936", + "message5941", + "message5950", + "message5953", + "message5955", + "message5957", + "message5965", + "message5971", + "message5973", + "message5975", + "message5979", + "message5982", + "message5983", + "message5985", + "message5986", + "message5990", + "message5991", + "message5996", + "message9601", + "message9602", + "message9603", + "message9604", + "message9605", + "message9606_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9607", + "message9608", + "message9609", + "message9610", + "message9611", + "message9612", + "message9613", + "message9614", + "message9615", + "message9616_xxxxxxxx", + "message9617", + "message9618", + "message9619", + "message9620", + "message9621", + "message9622", + "message9623", + "message9624", + "message9625", + "message9626_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9627", + "message9628", + "message9629", + "message9630", + "message9631", + "message9632", + "message9633", + "message9634", + "message9635", + "message9636_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9637", + "message9638", + "message9639", + "message9640", + "message9641", + "message9642", + "message9643", + "message9644", + "message9645", + "message9646_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9647", + "message9648", + "message9649", + "message9650", + "message9651", + "message9652", + "message9653", + "message9654", + "message9655", + "message9656_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9657", + "message9658", + "message9659", + "message9660", + "message9661", + "message9662", + "message9663", + "message9664", + "message9665", + "message9666_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9667", + "message9668", + "message9669", + "message9670", + "message9671", + "message9672", + "message9673", + "message9674", + "message9675", + "message9676_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9677", + "message9678", + "message9679", + "message9680", + "message9681", + "message9682", + "message9683", + "message9684", + "message9685", + "message9686_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9687", + "message9688", + "message9689", + "message9690", + "message9691", + "message9692", + "message9693", + "message9694", + "message9695", + "message9696_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9697", + "message9698", + "message9699", + "message9700_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9701", + "message9702", + "message9703", + "message9704", + "message9705", + "message9706_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9707", + "message9708", + "message9709", + "message9710", + "message9711", + "message9712", + "message9713", + "message9714", + "message9715", + "message9716_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9717", + "message9718", + "message9719", + "message9720", + "message9721", + "message9722", + "message9723", + "message9724", + "message9725", + "message9726_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9727", + "message9728", + "message9729", + "message9730", + "message9731", + "message9732", + "message9733", + "message9734", + "message9735", + "message9736_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9737", + "message9738", + "message9739", + "message9740", + "message9741", + "message9742", + "message9743", + "message9744", + "message9745", + "message9746_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9747", + "message9748", + "message9749", + "message9750", + "message9751", + "message9752", + "message9753", + "message9754", + "message9755", + "message9756_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9757", + "message9758", + "message9759", + "message9760", + "message9761", + "message9762", + "message9763", + "message9764", + "message9765", + "message9766_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9767", + "message9768", + "message9769", + "message9770", + "message9771", + "message9772", + "message9773", + "message9774", + "message9775", + "message9776_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9777", + "message9778", + "message9779", + "message9780", + "message9781", + "message9782", + "message9783", + "message9784", + "message9785", + "message9786_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9787", + "message9788", + "message9789", + "message9790", + "message9791", + "message9792", + "message9793", + "message9794", + "message9795", + "message9796_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9797", + "message9798", + "message9799", + "message9800_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9801", + "message9802", + "message9803", + "message9804", + "message9805", + "message9806_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9807", + "message9808", + "message9809", + "message9810", + "message9811", + "message9812", + "message9813", + "message9814", + "message9815", + "message9816_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9817", + "message9818", + "message9819", + "message9820", + "message9821", + "message9822", + "message9823", + "message9824", + "message9825", + "message9826_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9827", + "message9828", + "message9829", + "message9830", + "message9831", + "message9832", + "message9833", + "message9834", + "message9835", + "message9836_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9837", + "message9838", + "message9839", + "message9840", + "message9841", + "message9842", + "message9843", + "message9844", + "message9845", + "message9846_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9847", + "message9848", + "message9849", + "message9850", + "message9851", + "message9852", + "message9853", + "message9854", + "message9855", + "message9856_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9857", + "message9858", + "message9859", + "message9860", + "message9861", + "message9862", + "message9863", + "message9864", + "message9865", + "message9866_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9867", + "message9868", + "message9869", + "message9870", + "message9871", + "message9872", + "message9873", + "message9874", + "message9875", + "message9876_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9877", + "message9878", + "message9879", + "message9880", + "message9881", + "message9882", + "message9883", + "message9884", + "message9885", + "message9886_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9887", + "message9888", + "message9889", + "message9890", + "message9891", + "message9892", + "message9893", + "message9894", + "message9895", + "message9896_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9897", + "message9898", + "message9899", + "message9900_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9901", + "message9902", + "message9903", + "message9904", + "message9905", + "message9906_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9907", + "message9908", + "message9909", + "message9910", + "message9911", + "message9912", + "message9913", + "message9914", + "message9915", + "message9916_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9917", + "message9918", + "message9919", + "message9920", + "message9921", + "message9922", + "message9923", + "message9924", + "message9925", + "message9926_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9927", + "message9928", + "message9929", + "message9930", + "message9931", + "message9932", + "message9933", + "message9934", + "message9935", + "message9936_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9937", + "message9938", + "message9939", + "message9940", + "message9941", + "message9942", + "message9943", + "message9944", + "message9945", + "message9946_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9947", + "message9948", + "message9949", + "message9950", + "message9951", + "message9952", + "message9953", + "message9954", + "message9955", + "message9956_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9957", + "message9958", + "message9959", + "message9960", + "message9961", + "message9962", + "message9963", + "message9964", + "message9965", + "message9966_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9967", + "message9968", + "message9969", + "message9970", + "message9971", + "message9972", + "message9973", + "message9974", + "message9975", + "message9976_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9977", + "message9978", + "message9979", + "message9980", + "message9981", + "message9982", + "message9983", + "message9984", + "message9985", + "message9986_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9987", + "message9988", + "message9989", + "message9990", + "message9991", + "message9992", + "message9993", + "message9994", + "message9995", + "message9996_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "message9997", + "message9998", + "message9999", + "message10000_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ] + }, + { + "key": "key0", + "messages": [ + "message6001" + ] + }, + { + "key": "key1", + "messages": [ + "message6002" + ] + }, + { + "key": "key2", + "messages": [ + "message6003" + ] + }, + { + "key": "key3", + "messages": [ + "message6004" + ] + }, + { + "key": "key4", + "messages": [ + "message6005" + ] + }, + { + "key": "key5", + "messages": [ + "message6006" + ] + }, + { + "key": "key6", + "messages": [ + "message6007" + ] + }, + { + "key": "key7", + "messages": [ + "message6008" + ] + }, + { + "key": "key8", + "messages": [ + "message6009" + ] + }, + { + "key": "key9", + "messages": [ + "message6010" + ] + }, + { + "key": "key10", + "messages": [ + "message6011" + ] + }, + { + "key": "key11", + "messages": [ + "message6012" + ] + }, + { + "key": "key12", + "messages": [ + "message6013" + ] + }, + { + "key": "key13", + "messages": [ + "message6014" + ] + }, + { + "key": "key14", + "messages": [ + "message6015" + ] + }, + { + "key": "key15", + "messages": [ + "message6016" + ] + }, + { + "key": "key16", + "messages": [ + "message6017" + ] + }, + { + "key": "key17", + "messages": [ + "message6018" + ] + }, + { + "key": "key18", + "messages": [ + "message6019" + ] + }, + { + "key": "key19", + "messages": [ + "message6020" + ] + }, + { + "key": "key20", + "messages": [ + "message6021" + ] + }, + { + "key": "key21", + "messages": [ + "message6022" + ] + }, + { + "key": "key22", + "messages": [ + "message6023" + ] + }, + { + "key": "key23", + "messages": [ + "message6024" + ] + }, + { + "key": "key24", + "messages": [ + "message6025" + ] + }, + { + "key": "key25", + "messages": [ + "message6026" + ] + }, + { + "key": "key26", + "messages": [ + "message6027" + ] + }, + { + "key": "key27", + "messages": [ + "message6028" + ] + }, + { + "key": "key28", + "messages": [ + "message6029" + ] + }, + { + "key": "key29", + "messages": [ + "message6030" + ] + }, + { + "key": "key30", + "messages": [ + "message6031" + ] + }, + { + "key": "key31", + "messages": [ + "message6032" + ] + }, + { + "key": "key32", + "messages": [ + "message6033" + ] + }, + { + "key": "key33", + "messages": [ + "message6034" + ] + }, + { + "key": "key34", + "messages": [ + "message6035" + ] + }, + { + "key": "key35", + "messages": [ + "message6036" + ] + }, + { + "key": "key36", + "messages": [ + "message6037" + ] + }, + { + "key": "key37", + "messages": [ + "message6038" + ] + }, + { + "key": "key38", + "messages": [ + "message6039" + ] + }, + { + "key": "key39", + "messages": [ + "message6040" + ] + }, + { + "key": "key40", + "messages": [ + "message6041" + ] + }, + { + "key": "key41", + "messages": [ + "message6042" + ] + }, + { + "key": "key42", + "messages": [ + "message6043" + ] + }, + { + "key": "key43", + "messages": [ + "message6044" + ] + }, + { + "key": "key44", + "messages": [ + "message6045" + ] + }, + { + "key": "key45", + "messages": [ + "message6046" + ] + }, + { + "key": "key46", + "messages": [ + "message6047" + ] + }, + { + "key": "key47", + "messages": [ + "message6048" + ] + }, + { + "key": "key48", + "messages": [ + "message6049" + ] + }, + { + "key": "key49", + "messages": [ + "message6050" + ] + }, + { + "key": "key50", + "messages": [ + "message6051" + ] + }, + { + "key": "key51", + "messages": [ + "message6052" + ] + }, + { + "key": "key52", + "messages": [ + "message6053" + ] + }, + { + "key": "key53", + "messages": [ + "message6054" + ] + }, + { + "key": "key54", + "messages": [ + "message6055" + ] + }, + { + "key": "key55", + "messages": [ + "message6056" + ] + }, + { + "key": "key56", + "messages": [ + "message6057" + ] + }, + { + "key": "key57", + "messages": [ + "message6058" + ] + }, + { + "key": "key58", + "messages": [ + "message6059" + ] + }, + { + "key": "key59", + "messages": [ + "message6060" + ] + }, + { + "key": "key60", + "messages": [ + "message6061" + ] + }, + { + "key": "key61", + "messages": [ + "message6062" + ] + }, + { + "key": "key62", + "messages": [ + "message6063" + ] + }, + { + "key": "key63", + "messages": [ + "message6064" + ] + }, + { + "key": "key64", + "messages": [ + "message6065" + ] + }, + { + "key": "key65", + "messages": [ + "message6066" + ] + }, + { + "key": "key66", + "messages": [ + "message6067" + ] + }, + { + "key": "key67", + "messages": [ + "message6068" + ] + }, + { + "key": "key68", + "messages": [ + "message6069" + ] + }, + { + "key": "key69", + "messages": [ + "message6070" + ] + }, + { + "key": "key70", + "messages": [ + "message6071" + ] + }, + { + "key": "key71", + "messages": [ + "message6072" + ] + }, + { + "key": "key72", + "messages": [ + "message6073" + ] + }, + { + "key": "key73", + "messages": [ + "message6074" + ] + }, + { + "key": "key74", + "messages": [ + "message6075" + ] + }, + { + "key": "key75", + "messages": [ + "message6076" + ] + }, + { + "key": "key76", + "messages": [ + "message6077" + ] + }, + { + "key": "key77", + "messages": [ + "message6078" + ] + }, + { + "key": "key78", + "messages": [ + "message6079" + ] + }, + { + "key": "key79", + "messages": [ + "message6080" + ] + }, + { + "key": "key80", + "messages": [ + "message6081" + ] + }, + { + "key": "key81", + "messages": [ + "message6082" + ] + }, + { + "key": "key82", + "messages": [ + "message6083" + ] + }, + { + "key": "key83", + "messages": [ + "message6084" + ] + }, + { + "key": "key84", + "messages": [ + "message6085" + ] + }, + { + "key": "key85", + "messages": [ + "message6086" + ] + }, + { + "key": "key86", + "messages": [ + "message6087" + ] + }, + { + "key": "key87", + "messages": [ + "message6088" + ] + }, + { + "key": "key88", + "messages": [ + "message6089" + ] + }, + { + "key": "key89", + "messages": [ + "message6090" + ] + }, + { + "key": "key90", + "messages": [ + "message6091" + ] + }, + { + "key": "key91", + "messages": [ + "message6092" + ] + }, + { + "key": "key92", + "messages": [ + "message6093" + ] + }, + { + "key": "key93", + "messages": [ + "message6094" + ] + }, + { + "key": "key94", + "messages": [ + "message6095" + ] + }, + { + "key": "key95", + "messages": [ + "message6096" + ] + }, + { + "key": "key96", + "messages": [ + "message6097" + ] + }, + { + "key": "key97", + "messages": [ + "message6098" + ] + }, + { + "key": "key98", + "messages": [ + "message6099" + ] + }, + { + "key": "key99", + "messages": [ + "message6100" + ] + }, + { + "key": "key100", + "messages": [ + "message6101" + ] + }, + { + "key": "key101", + "messages": [ + "message6102" + ] + }, + { + "key": "key102", + "messages": [ + "message6103" + ] + }, + { + "key": "key103", + "messages": [ + "message6104" + ] + }, + { + "key": "key104", + "messages": [ + "message6105" + ] + }, + { + "key": "key105", + "messages": [ + "message6106" + ] + }, + { + "key": "key106", + "messages": [ + "message6107" + ] + }, + { + "key": "key107", + "messages": [ + "message6108" + ] + }, + { + "key": "key108", + "messages": [ + "message6109" + ] + }, + { + "key": "key109", + "messages": [ + "message6110" + ] + }, + { + "key": "key110", + "messages": [ + "message6111" + ] + }, + { + "key": "key111", + "messages": [ + "message6112" + ] + }, + { + "key": "key112", + "messages": [ + "message6113" + ] + }, + { + "key": "key113", + "messages": [ + "message6114" + ] + }, + { + "key": "key114", + "messages": [ + "message6115" + ] + }, + { + "key": "key115", + "messages": [ + "message6116" + ] + }, + { + "key": "key116", + "messages": [ + "message6117" + ] + }, + { + "key": "key117", + "messages": [ + "message6118" + ] + }, + { + "key": "key118", + "messages": [ + "message6119" + ] + }, + { + "key": "key119", + "messages": [ + "message6120" + ] + }, + { + "key": "key120", + "messages": [ + "message6121" + ] + }, + { + "key": "key121", + "messages": [ + "message6122" + ] + }, + { + "key": "key122", + "messages": [ + "message6123" + ] + }, + { + "key": "key123", + "messages": [ + "message6124" + ] + }, + { + "key": "key124", + "messages": [ + "message6125" + ] + }, + { + "key": "key125", + "messages": [ + "message6126" + ] + }, + { + "key": "key126", + "messages": [ + "message6127" + ] + }, + { + "key": "key127", + "messages": [ + "message6128" + ] + }, + { + "key": "key128", + "messages": [ + "message6129" + ] + }, + { + "key": "key129", + "messages": [ + "message6130" + ] + }, + { + "key": "key130", + "messages": [ + "message6131" + ] + }, + { + "key": "key131", + "messages": [ + "message6132" + ] + }, + { + "key": "key132", + "messages": [ + "message6133" + ] + }, + { + "key": "key133", + "messages": [ + "message6134" + ] + }, + { + "key": "key134", + "messages": [ + "message6135" + ] + }, + { + "key": "key135", + "messages": [ + "message6136" + ] + }, + { + "key": "key136", + "messages": [ + "message6137" + ] + }, + { + "key": "key137", + "messages": [ + "message6138" + ] + }, + { + "key": "key138", + "messages": [ + "message6139" + ] + }, + { + "key": "key139", + "messages": [ + "message6140" + ] + }, + { + "key": "key140", + "messages": [ + "message6141" + ] + }, + { + "key": "key141", + "messages": [ + "message6142" + ] + }, + { + "key": "key142", + "messages": [ + "message6143" + ] + }, + { + "key": "key143", + "messages": [ + "message6144" + ] + }, + { + "key": "key144", + "messages": [ + "message6145" + ] + }, + { + "key": "key145", + "messages": [ + "message6146" + ] + }, + { + "key": "key146", + "messages": [ + "message6147" + ] + }, + { + "key": "key147", + "messages": [ + "message6148" + ] + }, + { + "key": "key148", + "messages": [ + "message6149" + ] + }, + { + "key": "key149", + "messages": [ + "message6150" + ] + }, + { + "key": "key150", + "messages": [ + "message6151" + ] + }, + { + "key": "key151", + "messages": [ + "message6152" + ] + }, + { + "key": "key152", + "messages": [ + "message6153" + ] + }, + { + "key": "key153", + "messages": [ + "message6154" + ] + }, + { + "key": "key154", + "messages": [ + "message6155" + ] + }, + { + "key": "key155", + "messages": [ + "message6156" + ] + }, + { + "key": "key156", + "messages": [ + "message6157" + ] + }, + { + "key": "key157", + "messages": [ + "message6158" + ] + }, + { + "key": "key158", + "messages": [ + "message6159" + ] + }, + { + "key": "key159", + "messages": [ + "message6160" + ] + }, + { + "key": "key160", + "messages": [ + "message6161" + ] + }, + { + "key": "key161", + "messages": [ + "message6162" + ] + }, + { + "key": "key162", + "messages": [ + "message6163" + ] + }, + { + "key": "key163", + "messages": [ + "message6164" + ] + }, + { + "key": "key164", + "messages": [ + "message6165" + ] + }, + { + "key": "key165", + "messages": [ + "message6166" + ] + }, + { + "key": "key166", + "messages": [ + "message6167" + ] + }, + { + "key": "key167", + "messages": [ + "message6168" + ] + }, + { + "key": "key168", + "messages": [ + "message6169" + ] + }, + { + "key": "key169", + "messages": [ + "message6170" + ] + }, + { + "key": "key170", + "messages": [ + "message6171" + ] + }, + { + "key": "key171", + "messages": [ + "message6172" + ] + }, + { + "key": "key172", + "messages": [ + "message6173" + ] + }, + { + "key": "key173", + "messages": [ + "message6174" + ] + }, + { + "key": "key174", + "messages": [ + "message6175" + ] + }, + { + "key": "key175", + "messages": [ + "message6176" + ] + }, + { + "key": "key176", + "messages": [ + "message6177" + ] + }, + { + "key": "key177", + "messages": [ + "message6178" + ] + }, + { + "key": "key178", + "messages": [ + "message6179" + ] + }, + { + "key": "key179", + "messages": [ + "message6180" + ] + }, + { + "key": "key180", + "messages": [ + "message6181" + ] + }, + { + "key": "key181", + "messages": [ + "message6182" + ] + }, + { + "key": "key182", + "messages": [ + "message6183" + ] + }, + { + "key": "key183", + "messages": [ + "message6184" + ] + }, + { + "key": "key184", + "messages": [ + "message6185" + ] + }, + { + "key": "key185", + "messages": [ + "message6186" + ] + }, + { + "key": "key186", + "messages": [ + "message6187" + ] + }, + { + "key": "key187", + "messages": [ + "message6188" + ] + }, + { + "key": "key188", + "messages": [ + "message6189" + ] + }, + { + "key": "key189", + "messages": [ + "message6190" + ] + }, + { + "key": "key190", + "messages": [ + "message6191" + ] + }, + { + "key": "key191", + "messages": [ + "message6192" + ] + }, + { + "key": "key192", + "messages": [ + "message6193" + ] + }, + { + "key": "key193", + "messages": [ + "message6194" + ] + }, + { + "key": "key194", + "messages": [ + "message6195" + ] + }, + { + "key": "key195", + "messages": [ + "message6196" + ] + }, + { + "key": "key196", + "messages": [ + "message6197" + ] + }, + { + "key": "key197", + "messages": [ + "message6198" + ] + }, + { + "key": "key198", + "messages": [ + "message6199" + ] + }, + { + "key": "key199", + "messages": [ + "message6200" + ] + }, + { + "key": "key200", + "messages": [ + "message6201" + ] + }, + { + "key": "key201", + "messages": [ + "message6202" + ] + }, + { + "key": "key202", + "messages": [ + "message6203" + ] + }, + { + "key": "key203", + "messages": [ + "message6204" + ] + }, + { + "key": "key204", + "messages": [ + "message6205" + ] + }, + { + "key": "key205", + "messages": [ + "message6206" + ] + }, + { + "key": "key206", + "messages": [ + "message6207" + ] + }, + { + "key": "key207", + "messages": [ + "message6208" + ] + }, + { + "key": "key208", + "messages": [ + "message6209" + ] + }, + { + "key": "key209", + "messages": [ + "message6210" + ] + }, + { + "key": "key210", + "messages": [ + "message6211" + ] + }, + { + "key": "key211", + "messages": [ + "message6212" + ] + }, + { + "key": "key212", + "messages": [ + "message6213" + ] + }, + { + "key": "key213", + "messages": [ + "message6214" + ] + }, + { + "key": "key214", + "messages": [ + "message6215" + ] + }, + { + "key": "key215", + "messages": [ + "message6216" + ] + }, + { + "key": "key216", + "messages": [ + "message6217" + ] + }, + { + "key": "key217", + "messages": [ + "message6218" + ] + }, + { + "key": "key218", + "messages": [ + "message6219" + ] + }, + { + "key": "key219", + "messages": [ + "message6220" + ] + }, + { + "key": "key220", + "messages": [ + "message6221" + ] + }, + { + "key": "key221", + "messages": [ + "message6222" + ] + }, + { + "key": "key222", + "messages": [ + "message6223" + ] + }, + { + "key": "key223", + "messages": [ + "message6224" + ] + }, + { + "key": "key224", + "messages": [ + "message6225" + ] + }, + { + "key": "key225", + "messages": [ + "message6226" + ] + }, + { + "key": "key226", + "messages": [ + "message6227" + ] + }, + { + "key": "key227", + "messages": [ + "message6228" + ] + }, + { + "key": "key228", + "messages": [ + "message6229" + ] + }, + { + "key": "key229", + "messages": [ + "message6230" + ] + }, + { + "key": "key230", + "messages": [ + "message6231" + ] + }, + { + "key": "key231", + "messages": [ + "message6232" + ] + }, + { + "key": "key232", + "messages": [ + "message6233" + ] + }, + { + "key": "key233", + "messages": [ + "message6234" + ] + }, + { + "key": "key234", + "messages": [ + "message6235" + ] + }, + { + "key": "key235", + "messages": [ + "message6236" + ] + }, + { + "key": "key236", + "messages": [ + "message6237" + ] + }, + { + "key": "key237", + "messages": [ + "message6238" + ] + }, + { + "key": "key238", + "messages": [ + "message6239" + ] + }, + { + "key": "key239", + "messages": [ + "message6240" + ] + }, + { + "key": "key240", + "messages": [ + "message6241" + ] + }, + { + "key": "key241", + "messages": [ + "message6242" + ] + }, + { + "key": "key242", + "messages": [ + "message6243" + ] + }, + { + "key": "key243", + "messages": [ + "message6244" + ] + }, + { + "key": "key244", + "messages": [ + "message6245" + ] + }, + { + "key": "key245", + "messages": [ + "message6246" + ] + }, + { + "key": "key246", + "messages": [ + "message6247" + ] + }, + { + "key": "key247", + "messages": [ + "message6248" + ] + }, + { + "key": "key248", + "messages": [ + "message6249" + ] + }, + { + "key": "key249", + "messages": [ + "message6250" + ] + }, + { + "key": "key250", + "messages": [ + "message6251" + ] + }, + { + "key": "key251", + "messages": [ + "message6252" + ] + }, + { + "key": "key252", + "messages": [ + "message6253" + ] + }, + { + "key": "key253", + "messages": [ + "message6254" + ] + }, + { + "key": "key254", + "messages": [ + "message6255" + ] + }, + { + "key": "key255", + "messages": [ + "message6256" + ] + }, + { + "key": "key256", + "messages": [ + "message6257" + ] + }, + { + "key": "key257", + "messages": [ + "message6258" + ] + }, + { + "key": "key258", + "messages": [ + "message6259" + ] + }, + { + "key": "key259", + "messages": [ + "message6260" + ] + }, + { + "key": "key260", + "messages": [ + "message6261" + ] + }, + { + "key": "key261", + "messages": [ + "message6262" + ] + }, + { + "key": "key262", + "messages": [ + "message6263" + ] + }, + { + "key": "key263", + "messages": [ + "message6264" + ] + }, + { + "key": "key264", + "messages": [ + "message6265" + ] + }, + { + "key": "key265", + "messages": [ + "message6266" + ] + }, + { + "key": "key266", + "messages": [ + "message6267" + ] + }, + { + "key": "key267", + "messages": [ + "message6268" + ] + }, + { + "key": "key268", + "messages": [ + "message6269" + ] + }, + { + "key": "key269", + "messages": [ + "message6270" + ] + }, + { + "key": "key270", + "messages": [ + "message6271" + ] + }, + { + "key": "key271", + "messages": [ + "message6272" + ] + }, + { + "key": "key272", + "messages": [ + "message6273" + ] + }, + { + "key": "key273", + "messages": [ + "message6274" + ] + }, + { + "key": "key274", + "messages": [ + "message6275" + ] + }, + { + "key": "key275", + "messages": [ + "message6276" + ] + }, + { + "key": "key276", + "messages": [ + "message6277" + ] + }, + { + "key": "key277", + "messages": [ + "message6278" + ] + }, + { + "key": "key278", + "messages": [ + "message6279" + ] + }, + { + "key": "key279", + "messages": [ + "message6280" + ] + }, + { + "key": "key280", + "messages": [ + "message6281" + ] + }, + { + "key": "key281", + "messages": [ + "message6282" + ] + }, + { + "key": "key282", + "messages": [ + "message6283" + ] + }, + { + "key": "key283", + "messages": [ + "message6284" + ] + }, + { + "key": "key284", + "messages": [ + "message6285" + ] + }, + { + "key": "key285", + "messages": [ + "message6286" + ] + }, + { + "key": "key286", + "messages": [ + "message6287" + ] + }, + { + "key": "key287", + "messages": [ + "message6288" + ] + }, + { + "key": "key288", + "messages": [ + "message6289" + ] + }, + { + "key": "key289", + "messages": [ + "message6290" + ] + }, + { + "key": "key290", + "messages": [ + "message6291" + ] + }, + { + "key": "key291", + "messages": [ + "message6292" + ] + }, + { + "key": "key292", + "messages": [ + "message6293" + ] + }, + { + "key": "key293", + "messages": [ + "message6294" + ] + }, + { + "key": "key294", + "messages": [ + "message6295" + ] + }, + { + "key": "key295", + "messages": [ + "message6296" + ] + }, + { + "key": "key296", + "messages": [ + "message6297" + ] + }, + { + "key": "key297", + "messages": [ + "message6298" + ] + }, + { + "key": "key298", + "messages": [ + "message6299" + ] + }, + { + "key": "key299", + "messages": [ + "message6300" + ] + }, + { + "key": "key300", + "messages": [ + "message6301" + ] + }, + { + "key": "key301", + "messages": [ + "message6302" + ] + }, + { + "key": "key302", + "messages": [ + "message6303" + ] + }, + { + "key": "key303", + "messages": [ + "message6304" + ] + }, + { + "key": "key304", + "messages": [ + "message6305" + ] + }, + { + "key": "key305", + "messages": [ + "message6306" + ] + }, + { + "key": "key306", + "messages": [ + "message6307" + ] + }, + { + "key": "key307", + "messages": [ + "message6308" + ] + }, + { + "key": "key308", + "messages": [ + "message6309" + ] + }, + { + "key": "key309", + "messages": [ + "message6310" + ] + }, + { + "key": "key310", + "messages": [ + "message6311" + ] + }, + { + "key": "key311", + "messages": [ + "message6312" + ] + }, + { + "key": "key312", + "messages": [ + "message6313" + ] + }, + { + "key": "key313", + "messages": [ + "message6314" + ] + }, + { + "key": "key314", + "messages": [ + "message6315" + ] + }, + { + "key": "key315", + "messages": [ + "message6316" + ] + }, + { + "key": "key316", + "messages": [ + "message6317" + ] + }, + { + "key": "key317", + "messages": [ + "message6318" + ] + }, + { + "key": "key318", + "messages": [ + "message6319" + ] + }, + { + "key": "key319", + "messages": [ + "message6320" + ] + }, + { + "key": "key320", + "messages": [ + "message6321" + ] + }, + { + "key": "key321", + "messages": [ + "message6322" + ] + }, + { + "key": "key322", + "messages": [ + "message6323" + ] + }, + { + "key": "key323", + "messages": [ + "message6324" + ] + }, + { + "key": "key324", + "messages": [ + "message6325" + ] + }, + { + "key": "key325", + "messages": [ + "message6326" + ] + }, + { + "key": "key326", + "messages": [ + "message6327" + ] + }, + { + "key": "key327", + "messages": [ + "message6328" + ] + }, + { + "key": "key328", + "messages": [ + "message6329" + ] + }, + { + "key": "key329", + "messages": [ + "message6330" + ] + }, + { + "key": "key330", + "messages": [ + "message6331" + ] + }, + { + "key": "key331", + "messages": [ + "message6332" + ] + }, + { + "key": "key332", + "messages": [ + "message6333" + ] + }, + { + "key": "key333", + "messages": [ + "message6334" + ] + }, + { + "key": "key334", + "messages": [ + "message6335" + ] + }, + { + "key": "key335", + "messages": [ + "message6336" + ] + }, + { + "key": "key336", + "messages": [ + "message6337" + ] + }, + { + "key": "key337", + "messages": [ + "message6338" + ] + }, + { + "key": "key338", + "messages": [ + "message6339" + ] + }, + { + "key": "key339", + "messages": [ + "message6340" + ] + }, + { + "key": "key340", + "messages": [ + "message6341" + ] + }, + { + "key": "key341", + "messages": [ + "message6342" + ] + }, + { + "key": "key342", + "messages": [ + "message6343" + ] + }, + { + "key": "key343", + "messages": [ + "message6344" + ] + }, + { + "key": "key344", + "messages": [ + "message6345" + ] + }, + { + "key": "key345", + "messages": [ + "message6346" + ] + }, + { + "key": "key346", + "messages": [ + "message6347" + ] + }, + { + "key": "key347", + "messages": [ + "message6348" + ] + }, + { + "key": "key348", + "messages": [ + "message6349" + ] + }, + { + "key": "key349", + "messages": [ + "message6350" + ] + }, + { + "key": "key350", + "messages": [ + "message6351" + ] + }, + { + "key": "key351", + "messages": [ + "message6352" + ] + }, + { + "key": "key352", + "messages": [ + "message6353" + ] + }, + { + "key": "key353", + "messages": [ + "message6354" + ] + }, + { + "key": "key354", + "messages": [ + "message6355" + ] + }, + { + "key": "key355", + "messages": [ + "message6356" + ] + }, + { + "key": "key356", + "messages": [ + "message6357" + ] + }, + { + "key": "key357", + "messages": [ + "message6358" + ] + }, + { + "key": "key358", + "messages": [ + "message6359" + ] + }, + { + "key": "key359", + "messages": [ + "message6360" + ] + }, + { + "key": "key360", + "messages": [ + "message6361" + ] + }, + { + "key": "key361", + "messages": [ + "message6362" + ] + }, + { + "key": "key362", + "messages": [ + "message6363" + ] + }, + { + "key": "key363", + "messages": [ + "message6364" + ] + }, + { + "key": "key364", + "messages": [ + "message6365" + ] + }, + { + "key": "key365", + "messages": [ + "message6366" + ] + }, + { + "key": "key366", + "messages": [ + "message6367" + ] + }, + { + "key": "key367", + "messages": [ + "message6368" + ] + }, + { + "key": "key368", + "messages": [ + "message6369" + ] + }, + { + "key": "key369", + "messages": [ + "message6370" + ] + }, + { + "key": "key370", + "messages": [ + "message6371" + ] + }, + { + "key": "key371", + "messages": [ + "message6372" + ] + }, + { + "key": "key372", + "messages": [ + "message6373" + ] + }, + { + "key": "key373", + "messages": [ + "message6374" + ] + }, + { + "key": "key374", + "messages": [ + "message6375" + ] + }, + { + "key": "key375", + "messages": [ + "message6376" + ] + }, + { + "key": "key376", + "messages": [ + "message6377" + ] + }, + { + "key": "key377", + "messages": [ + "message6378" + ] + }, + { + "key": "key378", + "messages": [ + "message6379" + ] + }, + { + "key": "key379", + "messages": [ + "message6380" + ] + }, + { + "key": "key380", + "messages": [ + "message6381" + ] + }, + { + "key": "key381", + "messages": [ + "message6382" + ] + }, + { + "key": "key382", + "messages": [ + "message6383" + ] + }, + { + "key": "key383", + "messages": [ + "message6384" + ] + }, + { + "key": "key384", + "messages": [ + "message6385" + ] + }, + { + "key": "key385", + "messages": [ + "message6386" + ] + }, + { + "key": "key386", + "messages": [ + "message6387" + ] + }, + { + "key": "key387", + "messages": [ + "message6388" + ] + }, + { + "key": "key388", + "messages": [ + "message6389" + ] + }, + { + "key": "key389", + "messages": [ + "message6390" + ] + }, + { + "key": "key390", + "messages": [ + "message6391" + ] + }, + { + "key": "key391", + "messages": [ + "message6392" + ] + }, + { + "key": "key392", + "messages": [ + "message6393" + ] + }, + { + "key": "key393", + "messages": [ + "message6394" + ] + }, + { + "key": "key394", + "messages": [ + "message6395" + ] + }, + { + "key": "key395", + "messages": [ + "message6396" + ] + }, + { + "key": "key396", + "messages": [ + "message6397" + ] + }, + { + "key": "key397", + "messages": [ + "message6398" + ] + }, + { + "key": "key398", + "messages": [ + "message6399" + ] + }, + { + "key": "key399", + "messages": [ + "message6400" + ] + }, + { + "key": "key400", + "messages": [ + "message6401" + ] + }, + { + "key": "key401", + "messages": [ + "message6402" + ] + }, + { + "key": "key402", + "messages": [ + "message6403" + ] + }, + { + "key": "key403", + "messages": [ + "message6404" + ] + }, + { + "key": "key404", + "messages": [ + "message6405" + ] + }, + { + "key": "key405", + "messages": [ + "message6406" + ] + }, + { + "key": "key406", + "messages": [ + "message6407" + ] + }, + { + "key": "key407", + "messages": [ + "message6408" + ] + }, + { + "key": "key408", + "messages": [ + "message6409" + ] + }, + { + "key": "key409", + "messages": [ + "message6410" + ] + }, + { + "key": "key410", + "messages": [ + "message6411" + ] + }, + { + "key": "key411", + "messages": [ + "message6412" + ] + }, + { + "key": "key412", + "messages": [ + "message6413" + ] + }, + { + "key": "key413", + "messages": [ + "message6414" + ] + }, + { + "key": "key414", + "messages": [ + "message6415" + ] + }, + { + "key": "key415", + "messages": [ + "message6416" + ] + }, + { + "key": "key416", + "messages": [ + "message6417" + ] + }, + { + "key": "key417", + "messages": [ + "message6418" + ] + }, + { + "key": "key418", + "messages": [ + "message6419" + ] + }, + { + "key": "key419", + "messages": [ + "message6420" + ] + }, + { + "key": "key420", + "messages": [ + "message6421" + ] + }, + { + "key": "key421", + "messages": [ + "message6422" + ] + }, + { + "key": "key422", + "messages": [ + "message6423" + ] + }, + { + "key": "key423", + "messages": [ + "message6424" + ] + }, + { + "key": "key424", + "messages": [ + "message6425" + ] + }, + { + "key": "key425", + "messages": [ + "message6426" + ] + }, + { + "key": "key426", + "messages": [ + "message6427" + ] + }, + { + "key": "key427", + "messages": [ + "message6428" + ] + }, + { + "key": "key428", + "messages": [ + "message6429" + ] + }, + { + "key": "key429", + "messages": [ + "message6430" + ] + }, + { + "key": "key430", + "messages": [ + "message6431" + ] + }, + { + "key": "key431", + "messages": [ + "message6432" + ] + }, + { + "key": "key432", + "messages": [ + "message6433" + ] + }, + { + "key": "key433", + "messages": [ + "message6434" + ] + }, + { + "key": "key434", + "messages": [ + "message6435" + ] + }, + { + "key": "key435", + "messages": [ + "message6436" + ] + }, + { + "key": "key436", + "messages": [ + "message6437" + ] + }, + { + "key": "key437", + "messages": [ + "message6438" + ] + }, + { + "key": "key438", + "messages": [ + "message6439" + ] + }, + { + "key": "key439", + "messages": [ + "message6440" + ] + }, + { + "key": "key440", + "messages": [ + "message6441" + ] + }, + { + "key": "key441", + "messages": [ + "message6442" + ] + }, + { + "key": "key442", + "messages": [ + "message6443" + ] + }, + { + "key": "key443", + "messages": [ + "message6444" + ] + }, + { + "key": "key444", + "messages": [ + "message6445" + ] + }, + { + "key": "key445", + "messages": [ + "message6446" + ] + }, + { + "key": "key446", + "messages": [ + "message6447" + ] + }, + { + "key": "key447", + "messages": [ + "message6448" + ] + }, + { + "key": "key448", + "messages": [ + "message6449" + ] + }, + { + "key": "key449", + "messages": [ + "message6450" + ] + }, + { + "key": "key450", + "messages": [ + "message6451" + ] + }, + { + "key": "key451", + "messages": [ + "message6452" + ] + }, + { + "key": "key452", + "messages": [ + "message6453" + ] + }, + { + "key": "key453", + "messages": [ + "message6454" + ] + }, + { + "key": "key454", + "messages": [ + "message6455" + ] + }, + { + "key": "key455", + "messages": [ + "message6456" + ] + }, + { + "key": "key456", + "messages": [ + "message6457" + ] + }, + { + "key": "key457", + "messages": [ + "message6458" + ] + }, + { + "key": "key458", + "messages": [ + "message6459" + ] + }, + { + "key": "key459", + "messages": [ + "message6460" + ] + }, + { + "key": "key460", + "messages": [ + "message6461" + ] + }, + { + "key": "key461", + "messages": [ + "message6462" + ] + }, + { + "key": "key462", + "messages": [ + "message6463" + ] + }, + { + "key": "key463", + "messages": [ + "message6464" + ] + }, + { + "key": "key464", + "messages": [ + "message6465" + ] + }, + { + "key": "key465", + "messages": [ + "message6466" + ] + }, + { + "key": "key466", + "messages": [ + "message6467" + ] + }, + { + "key": "key467", + "messages": [ + "message6468" + ] + }, + { + "key": "key468", + "messages": [ + "message6469" + ] + }, + { + "key": "key469", + "messages": [ + "message6470" + ] + }, + { + "key": "key470", + "messages": [ + "message6471" + ] + }, + { + "key": "key471", + "messages": [ + "message6472" + ] + }, + { + "key": "key472", + "messages": [ + "message6473" + ] + }, + { + "key": "key473", + "messages": [ + "message6474" + ] + }, + { + "key": "key474", + "messages": [ + "message6475" + ] + }, + { + "key": "key475", + "messages": [ + "message6476" + ] + }, + { + "key": "key476", + "messages": [ + "message6477" + ] + }, + { + "key": "key477", + "messages": [ + "message6478" + ] + }, + { + "key": "key478", + "messages": [ + "message6479" + ] + }, + { + "key": "key479", + "messages": [ + "message6480" + ] + }, + { + "key": "key480", + "messages": [ + "message6481" + ] + }, + { + "key": "key481", + "messages": [ + "message6482" + ] + }, + { + "key": "key482", + "messages": [ + "message6483" + ] + }, + { + "key": "key483", + "messages": [ + "message6484" + ] + }, + { + "key": "key484", + "messages": [ + "message6485" + ] + }, + { + "key": "key485", + "messages": [ + "message6486" + ] + }, + { + "key": "key486", + "messages": [ + "message6487" + ] + }, + { + "key": "key487", + "messages": [ + "message6488" + ] + }, + { + "key": "key488", + "messages": [ + "message6489" + ] + }, + { + "key": "key489", + "messages": [ + "message6490" + ] + }, + { + "key": "key490", + "messages": [ + "message6491" + ] + }, + { + "key": "key491", + "messages": [ + "message6492" + ] + }, + { + "key": "key492", + "messages": [ + "message6493" + ] + }, + { + "key": "key493", + "messages": [ + "message6494" + ] + }, + { + "key": "key494", + "messages": [ + "message6495" + ] + }, + { + "key": "key495", + "messages": [ + "message6496" + ] + }, + { + "key": "key496", + "messages": [ + "message6497" + ] + }, + { + "key": "key497", + "messages": [ + "message6498" + ] + }, + { + "key": "key498", + "messages": [ + "message6499" + ] + }, + { + "key": "key499", + "messages": [ + "message6500" + ] + }, + { + "key": "key500", + "messages": [ + "message6501" + ] + }, + { + "key": "key501", + "messages": [ + "message6502" + ] + }, + { + "key": "key502", + "messages": [ + "message6503" + ] + }, + { + "key": "key503", + "messages": [ + "message6504" + ] + }, + { + "key": "key504", + "messages": [ + "message6505" + ] + }, + { + "key": "key505", + "messages": [ + "message6506" + ] + }, + { + "key": "key506", + "messages": [ + "message6507" + ] + }, + { + "key": "key507", + "messages": [ + "message6508" + ] + }, + { + "key": "key508", + "messages": [ + "message6509" + ] + }, + { + "key": "key509", + "messages": [ + "message6510" + ] + }, + { + "key": "key510", + "messages": [ + "message6511" + ] + }, + { + "key": "key511", + "messages": [ + "message6512" + ] + }, + { + "key": "key512", + "messages": [ + "message6513" + ] + }, + { + "key": "key513", + "messages": [ + "message6514" + ] + }, + { + "key": "key514", + "messages": [ + "message6515" + ] + }, + { + "key": "key515", + "messages": [ + "message6516" + ] + }, + { + "key": "key516", + "messages": [ + "message6517" + ] + }, + { + "key": "key517", + "messages": [ + "message6518" + ] + }, + { + "key": "key518", + "messages": [ + "message6519" + ] + }, + { + "key": "key519", + "messages": [ + "message6520" + ] + }, + { + "key": "key520", + "messages": [ + "message6521" + ] + }, + { + "key": "key521", + "messages": [ + "message6522" + ] + }, + { + "key": "key522", + "messages": [ + "message6523" + ] + }, + { + "key": "key523", + "messages": [ + "message6524" + ] + }, + { + "key": "key524", + "messages": [ + "message6525" + ] + }, + { + "key": "key525", + "messages": [ + "message6526" + ] + }, + { + "key": "key526", + "messages": [ + "message6527" + ] + }, + { + "key": "key527", + "messages": [ + "message6528" + ] + }, + { + "key": "key528", + "messages": [ + "message6529" + ] + }, + { + "key": "key529", + "messages": [ + "message6530" + ] + }, + { + "key": "key530", + "messages": [ + "message6531" + ] + }, + { + "key": "key531", + "messages": [ + "message6532" + ] + }, + { + "key": "key532", + "messages": [ + "message6533" + ] + }, + { + "key": "key533", + "messages": [ + "message6534" + ] + }, + { + "key": "key534", + "messages": [ + "message6535" + ] + }, + { + "key": "key535", + "messages": [ + "message6536" + ] + }, + { + "key": "key536", + "messages": [ + "message6537" + ] + }, + { + "key": "key537", + "messages": [ + "message6538" + ] + }, + { + "key": "key538", + "messages": [ + "message6539" + ] + }, + { + "key": "key539", + "messages": [ + "message6540" + ] + }, + { + "key": "key540", + "messages": [ + "message6541" + ] + }, + { + "key": "key541", + "messages": [ + "message6542" + ] + }, + { + "key": "key542", + "messages": [ + "message6543" + ] + }, + { + "key": "key543", + "messages": [ + "message6544" + ] + }, + { + "key": "key544", + "messages": [ + "message6545" + ] + }, + { + "key": "key545", + "messages": [ + "message6546" + ] + }, + { + "key": "key546", + "messages": [ + "message6547" + ] + }, + { + "key": "key547", + "messages": [ + "message6548" + ] + }, + { + "key": "key548", + "messages": [ + "message6549" + ] + }, + { + "key": "key549", + "messages": [ + "message6550" + ] + }, + { + "key": "key550", + "messages": [ + "message6551" + ] + }, + { + "key": "key551", + "messages": [ + "message6552" + ] + }, + { + "key": "key552", + "messages": [ + "message6553" + ] + }, + { + "key": "key553", + "messages": [ + "message6554" + ] + }, + { + "key": "key554", + "messages": [ + "message6555" + ] + }, + { + "key": "key555", + "messages": [ + "message6556" + ] + }, + { + "key": "key556", + "messages": [ + "message6557" + ] + }, + { + "key": "key557", + "messages": [ + "message6558" + ] + }, + { + "key": "key558", + "messages": [ + "message6559" + ] + }, + { + "key": "key559", + "messages": [ + "message6560" + ] + }, + { + "key": "key560", + "messages": [ + "message6561" + ] + }, + { + "key": "key561", + "messages": [ + "message6562" + ] + }, + { + "key": "key562", + "messages": [ + "message6563" + ] + }, + { + "key": "key563", + "messages": [ + "message6564" + ] + }, + { + "key": "key564", + "messages": [ + "message6565" + ] + }, + { + "key": "key565", + "messages": [ + "message6566" + ] + }, + { + "key": "key566", + "messages": [ + "message6567" + ] + }, + { + "key": "key567", + "messages": [ + "message6568" + ] + }, + { + "key": "key568", + "messages": [ + "message6569" + ] + }, + { + "key": "key569", + "messages": [ + "message6570" + ] + }, + { + "key": "key570", + "messages": [ + "message6571" + ] + }, + { + "key": "key571", + "messages": [ + "message6572" + ] + }, + { + "key": "key572", + "messages": [ + "message6573" + ] + }, + { + "key": "key573", + "messages": [ + "message6574" + ] + }, + { + "key": "key574", + "messages": [ + "message6575" + ] + }, + { + "key": "key575", + "messages": [ + "message6576" + ] + }, + { + "key": "key576", + "messages": [ + "message6577" + ] + }, + { + "key": "key577", + "messages": [ + "message6578" + ] + }, + { + "key": "key578", + "messages": [ + "message6579" + ] + }, + { + "key": "key579", + "messages": [ + "message6580" + ] + }, + { + "key": "key580", + "messages": [ + "message6581" + ] + }, + { + "key": "key581", + "messages": [ + "message6582" + ] + }, + { + "key": "key582", + "messages": [ + "message6583" + ] + }, + { + "key": "key583", + "messages": [ + "message6584" + ] + }, + { + "key": "key584", + "messages": [ + "message6585" + ] + }, + { + "key": "key585", + "messages": [ + "message6586" + ] + }, + { + "key": "key586", + "messages": [ + "message6587" + ] + }, + { + "key": "key587", + "messages": [ + "message6588" + ] + }, + { + "key": "key588", + "messages": [ + "message6589" + ] + }, + { + "key": "key589", + "messages": [ + "message6590" + ] + }, + { + "key": "key590", + "messages": [ + "message6591" + ] + }, + { + "key": "key591", + "messages": [ + "message6592" + ] + }, + { + "key": "key592", + "messages": [ + "message6593" + ] + }, + { + "key": "key593", + "messages": [ + "message6594" + ] + }, + { + "key": "key594", + "messages": [ + "message6595" + ] + }, + { + "key": "key595", + "messages": [ + "message6596" + ] + }, + { + "key": "key596", + "messages": [ + "message6597" + ] + }, + { + "key": "key597", + "messages": [ + "message6598" + ] + }, + { + "key": "key598", + "messages": [ + "message6599" + ] + }, + { + "key": "key599", + "messages": [ + "message6600" + ] + }, + { + "key": "key600", + "messages": [ + "message6601" + ] + }, + { + "key": "key601", + "messages": [ + "message6602" + ] + }, + { + "key": "key602", + "messages": [ + "message6603" + ] + }, + { + "key": "key603", + "messages": [ + "message6604" + ] + }, + { + "key": "key604", + "messages": [ + "message6605" + ] + }, + { + "key": "key605", + "messages": [ + "message6606" + ] + }, + { + "key": "key606", + "messages": [ + "message6607" + ] + }, + { + "key": "key607", + "messages": [ + "message6608" + ] + }, + { + "key": "key608", + "messages": [ + "message6609" + ] + }, + { + "key": "key609", + "messages": [ + "message6610" + ] + }, + { + "key": "key610", + "messages": [ + "message6611" + ] + }, + { + "key": "key611", + "messages": [ + "message6612" + ] + }, + { + "key": "key612", + "messages": [ + "message6613" + ] + }, + { + "key": "key613", + "messages": [ + "message6614" + ] + }, + { + "key": "key614", + "messages": [ + "message6615" + ] + }, + { + "key": "key615", + "messages": [ + "message6616" + ] + }, + { + "key": "key616", + "messages": [ + "message6617" + ] + }, + { + "key": "key617", + "messages": [ + "message6618" + ] + }, + { + "key": "key618", + "messages": [ + "message6619" + ] + }, + { + "key": "key619", + "messages": [ + "message6620" + ] + }, + { + "key": "key620", + "messages": [ + "message6621" + ] + }, + { + "key": "key621", + "messages": [ + "message6622" + ] + }, + { + "key": "key622", + "messages": [ + "message6623" + ] + }, + { + "key": "key623", + "messages": [ + "message6624" + ] + }, + { + "key": "key624", + "messages": [ + "message6625" + ] + }, + { + "key": "key625", + "messages": [ + "message6626" + ] + }, + { + "key": "key626", + "messages": [ + "message6627" + ] + }, + { + "key": "key627", + "messages": [ + "message6628" + ] + }, + { + "key": "key628", + "messages": [ + "message6629" + ] + }, + { + "key": "key629", + "messages": [ + "message6630" + ] + }, + { + "key": "key630", + "messages": [ + "message6631" + ] + }, + { + "key": "key631", + "messages": [ + "message6632" + ] + }, + { + "key": "key632", + "messages": [ + "message6633" + ] + }, + { + "key": "key633", + "messages": [ + "message6634" + ] + }, + { + "key": "key634", + "messages": [ + "message6635" + ] + }, + { + "key": "key635", + "messages": [ + "message6636" + ] + }, + { + "key": "key636", + "messages": [ + "message6637" + ] + }, + { + "key": "key637", + "messages": [ + "message6638" + ] + }, + { + "key": "key638", + "messages": [ + "message6639" + ] + }, + { + "key": "key639", + "messages": [ + "message6640" + ] + }, + { + "key": "key640", + "messages": [ + "message6641" + ] + }, + { + "key": "key641", + "messages": [ + "message6642" + ] + }, + { + "key": "key642", + "messages": [ + "message6643" + ] + }, + { + "key": "key643", + "messages": [ + "message6644" + ] + }, + { + "key": "key644", + "messages": [ + "message6645" + ] + }, + { + "key": "key645", + "messages": [ + "message6646" + ] + }, + { + "key": "key646", + "messages": [ + "message6647" + ] + }, + { + "key": "key647", + "messages": [ + "message6648" + ] + }, + { + "key": "key648", + "messages": [ + "message6649" + ] + }, + { + "key": "key649", + "messages": [ + "message6650" + ] + }, + { + "key": "key650", + "messages": [ + "message6651" + ] + }, + { + "key": "key651", + "messages": [ + "message6652" + ] + }, + { + "key": "key652", + "messages": [ + "message6653" + ] + }, + { + "key": "key653", + "messages": [ + "message6654" + ] + }, + { + "key": "key654", + "messages": [ + "message6655" + ] + }, + { + "key": "key655", + "messages": [ + "message6656" + ] + }, + { + "key": "key656", + "messages": [ + "message6657" + ] + }, + { + "key": "key657", + "messages": [ + "message6658" + ] + }, + { + "key": "key658", + "messages": [ + "message6659" + ] + }, + { + "key": "key659", + "messages": [ + "message6660" + ] + }, + { + "key": "key660", + "messages": [ + "message6661" + ] + }, + { + "key": "key661", + "messages": [ + "message6662" + ] + }, + { + "key": "key662", + "messages": [ + "message6663" + ] + }, + { + "key": "key663", + "messages": [ + "message6664" + ] + }, + { + "key": "key664", + "messages": [ + "message6665" + ] + }, + { + "key": "key665", + "messages": [ + "message6666" + ] + }, + { + "key": "key666", + "messages": [ + "message6667" + ] + }, + { + "key": "key667", + "messages": [ + "message6668" + ] + }, + { + "key": "key668", + "messages": [ + "message6669" + ] + }, + { + "key": "key669", + "messages": [ + "message6670" + ] + }, + { + "key": "key670", + "messages": [ + "message6671" + ] + }, + { + "key": "key671", + "messages": [ + "message6672" + ] + }, + { + "key": "key672", + "messages": [ + "message6673" + ] + }, + { + "key": "key673", + "messages": [ + "message6674" + ] + }, + { + "key": "key674", + "messages": [ + "message6675" + ] + }, + { + "key": "key675", + "messages": [ + "message6676" + ] + }, + { + "key": "key676", + "messages": [ + "message6677" + ] + }, + { + "key": "key677", + "messages": [ + "message6678" + ] + }, + { + "key": "key678", + "messages": [ + "message6679" + ] + }, + { + "key": "key679", + "messages": [ + "message6680" + ] + }, + { + "key": "key680", + "messages": [ + "message6681" + ] + }, + { + "key": "key681", + "messages": [ + "message6682" + ] + }, + { + "key": "key682", + "messages": [ + "message6683" + ] + }, + { + "key": "key683", + "messages": [ + "message6684" + ] + }, + { + "key": "key684", + "messages": [ + "message6685" + ] + }, + { + "key": "key685", + "messages": [ + "message6686" + ] + }, + { + "key": "key686", + "messages": [ + "message6687" + ] + }, + { + "key": "key687", + "messages": [ + "message6688" + ] + }, + { + "key": "key688", + "messages": [ + "message6689" + ] + }, + { + "key": "key689", + "messages": [ + "message6690" + ] + }, + { + "key": "key690", + "messages": [ + "message6691" + ] + }, + { + "key": "key691", + "messages": [ + "message6692" + ] + }, + { + "key": "key692", + "messages": [ + "message6693" + ] + }, + { + "key": "key693", + "messages": [ + "message6694" + ] + }, + { + "key": "key694", + "messages": [ + "message6695" + ] + }, + { + "key": "key695", + "messages": [ + "message6696" + ] + }, + { + "key": "key696", + "messages": [ + "message6697" + ] + }, + { + "key": "key697", + "messages": [ + "message6698" + ] + }, + { + "key": "key698", + "messages": [ + "message6699" + ] + }, + { + "key": "key699", + "messages": [ + "message6700" + ] + }, + { + "key": "key700", + "messages": [ + "message6701" + ] + }, + { + "key": "key701", + "messages": [ + "message6702" + ] + }, + { + "key": "key702", + "messages": [ + "message6703" + ] + }, + { + "key": "key703", + "messages": [ + "message6704" + ] + }, + { + "key": "key704", + "messages": [ + "message6705" + ] + }, + { + "key": "key705", + "messages": [ + "message6706" + ] + }, + { + "key": "key706", + "messages": [ + "message6707" + ] + }, + { + "key": "key707", + "messages": [ + "message6708" + ] + }, + { + "key": "key708", + "messages": [ + "message6709" + ] + }, + { + "key": "key709", + "messages": [ + "message6710" + ] + }, + { + "key": "key710", + "messages": [ + "message6711" + ] + }, + { + "key": "key711", + "messages": [ + "message6712" + ] + }, + { + "key": "key712", + "messages": [ + "message6713" + ] + }, + { + "key": "key713", + "messages": [ + "message6714" + ] + }, + { + "key": "key714", + "messages": [ + "message6715" + ] + }, + { + "key": "key715", + "messages": [ + "message6716" + ] + }, + { + "key": "key716", + "messages": [ + "message6717" + ] + }, + { + "key": "key717", + "messages": [ + "message6718" + ] + }, + { + "key": "key718", + "messages": [ + "message6719" + ] + }, + { + "key": "key719", + "messages": [ + "message6720" + ] + }, + { + "key": "key720", + "messages": [ + "message6721" + ] + }, + { + "key": "key721", + "messages": [ + "message6722" + ] + }, + { + "key": "key722", + "messages": [ + "message6723" + ] + }, + { + "key": "key723", + "messages": [ + "message6724" + ] + }, + { + "key": "key724", + "messages": [ + "message6725" + ] + }, + { + "key": "key725", + "messages": [ + "message6726" + ] + }, + { + "key": "key726", + "messages": [ + "message6727" + ] + }, + { + "key": "key727", + "messages": [ + "message6728" + ] + }, + { + "key": "key728", + "messages": [ + "message6729" + ] + }, + { + "key": "key729", + "messages": [ + "message6730" + ] + }, + { + "key": "key730", + "messages": [ + "message6731" + ] + }, + { + "key": "key731", + "messages": [ + "message6732" + ] + }, + { + "key": "key732", + "messages": [ + "message6733" + ] + }, + { + "key": "key733", + "messages": [ + "message6734" + ] + }, + { + "key": "key734", + "messages": [ + "message6735" + ] + }, + { + "key": "key735", + "messages": [ + "message6736" + ] + }, + { + "key": "key736", + "messages": [ + "message6737" + ] + }, + { + "key": "key737", + "messages": [ + "message6738" + ] + }, + { + "key": "key738", + "messages": [ + "message6739" + ] + }, + { + "key": "key739", + "messages": [ + "message6740" + ] + }, + { + "key": "key740", + "messages": [ + "message6741" + ] + }, + { + "key": "key741", + "messages": [ + "message6742" + ] + }, + { + "key": "key742", + "messages": [ + "message6743" + ] + }, + { + "key": "key743", + "messages": [ + "message6744" + ] + }, + { + "key": "key744", + "messages": [ + "message6745" + ] + }, + { + "key": "key745", + "messages": [ + "message6746" + ] + }, + { + "key": "key746", + "messages": [ + "message6747" + ] + }, + { + "key": "key747", + "messages": [ + "message6748" + ] + }, + { + "key": "key748", + "messages": [ + "message6749" + ] + }, + { + "key": "key749", + "messages": [ + "message6750" + ] + }, + { + "key": "key750", + "messages": [ + "message6751" + ] + }, + { + "key": "key751", + "messages": [ + "message6752" + ] + }, + { + "key": "key752", + "messages": [ + "message6753" + ] + }, + { + "key": "key753", + "messages": [ + "message6754" + ] + }, + { + "key": "key754", + "messages": [ + "message6755" + ] + }, + { + "key": "key755", + "messages": [ + "message6756" + ] + }, + { + "key": "key756", + "messages": [ + "message6757" + ] + }, + { + "key": "key757", + "messages": [ + "message6758" + ] + }, + { + "key": "key758", + "messages": [ + "message6759" + ] + }, + { + "key": "key759", + "messages": [ + "message6760" + ] + }, + { + "key": "key760", + "messages": [ + "message6761" + ] + }, + { + "key": "key761", + "messages": [ + "message6762" + ] + }, + { + "key": "key762", + "messages": [ + "message6763" + ] + }, + { + "key": "key763", + "messages": [ + "message6764" + ] + }, + { + "key": "key764", + "messages": [ + "message6765" + ] + }, + { + "key": "key765", + "messages": [ + "message6766" + ] + }, + { + "key": "key766", + "messages": [ + "message6767" + ] + }, + { + "key": "key767", + "messages": [ + "message6768" + ] + }, + { + "key": "key768", + "messages": [ + "message6769" + ] + }, + { + "key": "key769", + "messages": [ + "message6770" + ] + }, + { + "key": "key770", + "messages": [ + "message6771" + ] + }, + { + "key": "key771", + "messages": [ + "message6772" + ] + }, + { + "key": "key772", + "messages": [ + "message6773" + ] + }, + { + "key": "key773", + "messages": [ + "message6774" + ] + }, + { + "key": "key774", + "messages": [ + "message6775" + ] + }, + { + "key": "key775", + "messages": [ + "message6776" + ] + }, + { + "key": "key776", + "messages": [ + "message6777" + ] + }, + { + "key": "key777", + "messages": [ + "message6778" + ] + }, + { + "key": "key778", + "messages": [ + "message6779" + ] + }, + { + "key": "key779", + "messages": [ + "message6780" + ] + }, + { + "key": "key780", + "messages": [ + "message6781" + ] + }, + { + "key": "key781", + "messages": [ + "message6782" + ] + }, + { + "key": "key782", + "messages": [ + "message6783" + ] + }, + { + "key": "key783", + "messages": [ + "message6784" + ] + }, + { + "key": "key784", + "messages": [ + "message6785" + ] + }, + { + "key": "key785", + "messages": [ + "message6786" + ] + }, + { + "key": "key786", + "messages": [ + "message6787" + ] + }, + { + "key": "key787", + "messages": [ + "message6788" + ] + }, + { + "key": "key788", + "messages": [ + "message6789" + ] + }, + { + "key": "key789", + "messages": [ + "message6790" + ] + }, + { + "key": "key790", + "messages": [ + "message6791" + ] + }, + { + "key": "key791", + "messages": [ + "message6792" + ] + }, + { + "key": "key792", + "messages": [ + "message6793" + ] + }, + { + "key": "key793", + "messages": [ + "message6794" + ] + }, + { + "key": "key794", + "messages": [ + "message6795" + ] + }, + { + "key": "key795", + "messages": [ + "message6796" + ] + }, + { + "key": "key796", + "messages": [ + "message6797" + ] + }, + { + "key": "key797", + "messages": [ + "message6798" + ] + }, + { + "key": "key798", + "messages": [ + "message6799" + ] + }, + { + "key": "key799", + "messages": [ + "message6800" + ] + }, + { + "key": "key800", + "messages": [ + "message6801" + ] + }, + { + "key": "key801", + "messages": [ + "message6802" + ] + }, + { + "key": "key802", + "messages": [ + "message6803" + ] + }, + { + "key": "key803", + "messages": [ + "message6804" + ] + }, + { + "key": "key804", + "messages": [ + "message6805" + ] + }, + { + "key": "key805", + "messages": [ + "message6806" + ] + }, + { + "key": "key806", + "messages": [ + "message6807" + ] + }, + { + "key": "key807", + "messages": [ + "message6808" + ] + }, + { + "key": "key808", + "messages": [ + "message6809" + ] + }, + { + "key": "key809", + "messages": [ + "message6810" + ] + }, + { + "key": "key810", + "messages": [ + "message6811" + ] + }, + { + "key": "key811", + "messages": [ + "message6812" + ] + }, + { + "key": "key812", + "messages": [ + "message6813" + ] + }, + { + "key": "key813", + "messages": [ + "message6814" + ] + }, + { + "key": "key814", + "messages": [ + "message6815" + ] + }, + { + "key": "key815", + "messages": [ + "message6816" + ] + }, + { + "key": "key816", + "messages": [ + "message6817" + ] + }, + { + "key": "key817", + "messages": [ + "message6818" + ] + }, + { + "key": "key818", + "messages": [ + "message6819" + ] + }, + { + "key": "key819", + "messages": [ + "message6820" + ] + }, + { + "key": "key820", + "messages": [ + "message6821" + ] + }, + { + "key": "key821", + "messages": [ + "message6822" + ] + }, + { + "key": "key822", + "messages": [ + "message6823" + ] + }, + { + "key": "key823", + "messages": [ + "message6824" + ] + }, + { + "key": "key824", + "messages": [ + "message6825" + ] + }, + { + "key": "key825", + "messages": [ + "message6826" + ] + }, + { + "key": "key826", + "messages": [ + "message6827" + ] + }, + { + "key": "key827", + "messages": [ + "message6828" + ] + }, + { + "key": "key828", + "messages": [ + "message6829" + ] + }, + { + "key": "key829", + "messages": [ + "message6830" + ] + }, + { + "key": "key830", + "messages": [ + "message6831" + ] + }, + { + "key": "key831", + "messages": [ + "message6832" + ] + }, + { + "key": "key832", + "messages": [ + "message6833" + ] + }, + { + "key": "key833", + "messages": [ + "message6834" + ] + }, + { + "key": "key834", + "messages": [ + "message6835" + ] + }, + { + "key": "key835", + "messages": [ + "message6836" + ] + }, + { + "key": "key836", + "messages": [ + "message6837" + ] + }, + { + "key": "key837", + "messages": [ + "message6838" + ] + }, + { + "key": "key838", + "messages": [ + "message6839" + ] + }, + { + "key": "key839", + "messages": [ + "message6840" + ] + }, + { + "key": "key840", + "messages": [ + "message6841" + ] + }, + { + "key": "key841", + "messages": [ + "message6842" + ] + }, + { + "key": "key842", + "messages": [ + "message6843" + ] + }, + { + "key": "key843", + "messages": [ + "message6844" + ] + }, + { + "key": "key844", + "messages": [ + "message6845" + ] + }, + { + "key": "key845", + "messages": [ + "message6846" + ] + }, + { + "key": "key846", + "messages": [ + "message6847" + ] + }, + { + "key": "key847", + "messages": [ + "message6848" + ] + }, + { + "key": "key848", + "messages": [ + "message6849" + ] + }, + { + "key": "key849", + "messages": [ + "message6850" + ] + }, + { + "key": "key850", + "messages": [ + "message6851" + ] + }, + { + "key": "key851", + "messages": [ + "message6852" + ] + }, + { + "key": "key852", + "messages": [ + "message6853" + ] + }, + { + "key": "key853", + "messages": [ + "message6854" + ] + }, + { + "key": "key854", + "messages": [ + "message6855" + ] + }, + { + "key": "key855", + "messages": [ + "message6856" + ] + }, + { + "key": "key856", + "messages": [ + "message6857" + ] + }, + { + "key": "key857", + "messages": [ + "message6858" + ] + }, + { + "key": "key858", + "messages": [ + "message6859" + ] + }, + { + "key": "key859", + "messages": [ + "message6860" + ] + }, + { + "key": "key860", + "messages": [ + "message6861" + ] + }, + { + "key": "key861", + "messages": [ + "message6862" + ] + }, + { + "key": "key862", + "messages": [ + "message6863" + ] + }, + { + "key": "key863", + "messages": [ + "message6864" + ] + }, + { + "key": "key864", + "messages": [ + "message6865" + ] + }, + { + "key": "key865", + "messages": [ + "message6866" + ] + }, + { + "key": "key866", + "messages": [ + "message6867" + ] + }, + { + "key": "key867", + "messages": [ + "message6868" + ] + }, + { + "key": "key868", + "messages": [ + "message6869" + ] + }, + { + "key": "key869", + "messages": [ + "message6870" + ] + }, + { + "key": "key870", + "messages": [ + "message6871" + ] + }, + { + "key": "key871", + "messages": [ + "message6872" + ] + }, + { + "key": "key872", + "messages": [ + "message6873" + ] + }, + { + "key": "key873", + "messages": [ + "message6874" + ] + }, + { + "key": "key874", + "messages": [ + "message6875" + ] + }, + { + "key": "key875", + "messages": [ + "message6876" + ] + }, + { + "key": "key876", + "messages": [ + "message6877" + ] + }, + { + "key": "key877", + "messages": [ + "message6878" + ] + }, + { + "key": "key878", + "messages": [ + "message6879" + ] + }, + { + "key": "key879", + "messages": [ + "message6880" + ] + }, + { + "key": "key880", + "messages": [ + "message6881" + ] + }, + { + "key": "key881", + "messages": [ + "message6882" + ] + }, + { + "key": "key882", + "messages": [ + "message6883" + ] + }, + { + "key": "key883", + "messages": [ + "message6884" + ] + }, + { + "key": "key884", + "messages": [ + "message6885" + ] + }, + { + "key": "key885", + "messages": [ + "message6886" + ] + }, + { + "key": "key886", + "messages": [ + "message6887" + ] + }, + { + "key": "key887", + "messages": [ + "message6888" + ] + }, + { + "key": "key888", + "messages": [ + "message6889" + ] + }, + { + "key": "key889", + "messages": [ + "message6890" + ] + }, + { + "key": "key890", + "messages": [ + "message6891" + ] + }, + { + "key": "key891", + "messages": [ + "message6892" + ] + }, + { + "key": "key892", + "messages": [ + "message6893" + ] + }, + { + "key": "key893", + "messages": [ + "message6894" + ] + }, + { + "key": "key894", + "messages": [ + "message6895" + ] + }, + { + "key": "key895", + "messages": [ + "message6896" + ] + }, + { + "key": "key896", + "messages": [ + "message6897" + ] + }, + { + "key": "key897", + "messages": [ + "message6898" + ] + }, + { + "key": "key898", + "messages": [ + "message6899" + ] + }, + { + "key": "key899", + "messages": [ + "message6900" + ] + }, + { + "key": "key900", + "messages": [ + "message6901" + ] + }, + { + "key": "key901", + "messages": [ + "message6902" + ] + }, + { + "key": "key902", + "messages": [ + "message6903" + ] + }, + { + "key": "key903", + "messages": [ + "message6904" + ] + }, + { + "key": "key904", + "messages": [ + "message6905" + ] + }, + { + "key": "key905", + "messages": [ + "message6906" + ] + }, + { + "key": "key906", + "messages": [ + "message6907" + ] + }, + { + "key": "key907", + "messages": [ + "message6908" + ] + }, + { + "key": "key908", + "messages": [ + "message6909" + ] + }, + { + "key": "key909", + "messages": [ + "message6910" + ] + }, + { + "key": "key910", + "messages": [ + "message6911" + ] + }, + { + "key": "key911", + "messages": [ + "message6912" + ] + }, + { + "key": "key912", + "messages": [ + "message6913" + ] + }, + { + "key": "key913", + "messages": [ + "message6914" + ] + }, + { + "key": "key914", + "messages": [ + "message6915" + ] + }, + { + "key": "key915", + "messages": [ + "message6916" + ] + }, + { + "key": "key916", + "messages": [ + "message6917" + ] + }, + { + "key": "key917", + "messages": [ + "message6918" + ] + }, + { + "key": "key918", + "messages": [ + "message6919" + ] + }, + { + "key": "key919", + "messages": [ + "message6920" + ] + }, + { + "key": "key920", + "messages": [ + "message6921" + ] + }, + { + "key": "key921", + "messages": [ + "message6922" + ] + }, + { + "key": "key922", + "messages": [ + "message6923" + ] + }, + { + "key": "key923", + "messages": [ + "message6924" + ] + }, + { + "key": "key924", + "messages": [ + "message6925" + ] + }, + { + "key": "key925", + "messages": [ + "message6926" + ] + }, + { + "key": "key926", + "messages": [ + "message6927" + ] + }, + { + "key": "key927", + "messages": [ + "message6928" + ] + }, + { + "key": "key928", + "messages": [ + "message6929" + ] + }, + { + "key": "key929", + "messages": [ + "message6930" + ] + }, + { + "key": "key930", + "messages": [ + "message6931" + ] + }, + { + "key": "key931", + "messages": [ + "message6932" + ] + }, + { + "key": "key932", + "messages": [ + "message6933" + ] + }, + { + "key": "key933", + "messages": [ + "message6934" + ] + }, + { + "key": "key934", + "messages": [ + "message6935" + ] + }, + { + "key": "key935", + "messages": [ + "message6936" + ] + }, + { + "key": "key936", + "messages": [ + "message6937" + ] + }, + { + "key": "key937", + "messages": [ + "message6938" + ] + }, + { + "key": "key938", + "messages": [ + "message6939" + ] + }, + { + "key": "key939", + "messages": [ + "message6940" + ] + }, + { + "key": "key940", + "messages": [ + "message6941" + ] + }, + { + "key": "key941", + "messages": [ + "message6942" + ] + }, + { + "key": "key942", + "messages": [ + "message6943" + ] + }, + { + "key": "key943", + "messages": [ + "message6944" + ] + }, + { + "key": "key944", + "messages": [ + "message6945" + ] + }, + { + "key": "key945", + "messages": [ + "message6946" + ] + }, + { + "key": "key946", + "messages": [ + "message6947" + ] + }, + { + "key": "key947", + "messages": [ + "message6948" + ] + }, + { + "key": "key948", + "messages": [ + "message6949" + ] + }, + { + "key": "key949", + "messages": [ + "message6950" + ] + }, + { + "key": "key950", + "messages": [ + "message6951" + ] + }, + { + "key": "key951", + "messages": [ + "message6952" + ] + }, + { + "key": "key952", + "messages": [ + "message6953" + ] + }, + { + "key": "key953", + "messages": [ + "message6954" + ] + }, + { + "key": "key954", + "messages": [ + "message6955" + ] + }, + { + "key": "key955", + "messages": [ + "message6956" + ] + }, + { + "key": "key956", + "messages": [ + "message6957" + ] + }, + { + "key": "key957", + "messages": [ + "message6958" + ] + }, + { + "key": "key958", + "messages": [ + "message6959" + ] + }, + { + "key": "key959", + "messages": [ + "message6960" + ] + }, + { + "key": "key960", + "messages": [ + "message6961" + ] + }, + { + "key": "key961", + "messages": [ + "message6962" + ] + }, + { + "key": "key962", + "messages": [ + "message6963" + ] + }, + { + "key": "key963", + "messages": [ + "message6964" + ] + }, + { + "key": "key964", + "messages": [ + "message6965" + ] + }, + { + "key": "key965", + "messages": [ + "message6966" + ] + }, + { + "key": "key966", + "messages": [ + "message6967" + ] + }, + { + "key": "key967", + "messages": [ + "message6968" + ] + }, + { + "key": "key968", + "messages": [ + "message6969" + ] + }, + { + "key": "key969", + "messages": [ + "message6970" + ] + }, + { + "key": "key970", + "messages": [ + "message6971" + ] + }, + { + "key": "key971", + "messages": [ + "message6972" + ] + }, + { + "key": "key972", + "messages": [ + "message6973" + ] + }, + { + "key": "key973", + "messages": [ + "message6974" + ] + }, + { + "key": "key974", + "messages": [ + "message6975" + ] + }, + { + "key": "key975", + "messages": [ + "message6976" + ] + }, + { + "key": "key976", + "messages": [ + "message6977" + ] + }, + { + "key": "key977", + "messages": [ + "message6978" + ] + }, + { + "key": "key978", + "messages": [ + "message6979" + ] + }, + { + "key": "key979", + "messages": [ + "message6980" + ] + }, + { + "key": "key980", + "messages": [ + "message6981" + ] + }, + { + "key": "key981", + "messages": [ + "message6982" + ] + }, + { + "key": "key982", + "messages": [ + "message6983" + ] + }, + { + "key": "key983", + "messages": [ + "message6984" + ] + }, + { + "key": "key984", + "messages": [ + "message6985" + ] + }, + { + "key": "key985", + "messages": [ + "message6986" + ] + }, + { + "key": "key986", + "messages": [ + "message6987" + ] + }, + { + "key": "key987", + "messages": [ + "message6988" + ] + }, + { + "key": "key988", + "messages": [ + "message6989" + ] + }, + { + "key": "key989", + "messages": [ + "message6990" + ] + }, + { + "key": "key990", + "messages": [ + "message6991" + ] + }, + { + "key": "key991", + "messages": [ + "message6992" + ] + }, + { + "key": "key992", + "messages": [ + "message6993" + ] + }, + { + "key": "key993", + "messages": [ + "message6994" + ] + }, + { + "key": "key994", + "messages": [ + "message6995" + ] + }, + { + "key": "key995", + "messages": [ + "message6996" + ] + }, + { + "key": "key996", + "messages": [ + "message6997" + ] + }, + { + "key": "key997", + "messages": [ + "message6998" + ] + }, + { + "key": "key998", + "messages": [ + "message6999" + ] + }, + { + "key": "key999", + "messages": [ + "message7000" + ] + }, + { + "key": "key1000", + "messages": [ + "message7001" + ] + }, + { + "key": "key1001", + "messages": [ + "message7002" + ] + }, + { + "key": "key1002", + "messages": [ + "message7003" + ] + }, + { + "key": "key1003", + "messages": [ + "message7004" + ] + }, + { + "key": "key1004", + "messages": [ + "message7005" + ] + }, + { + "key": "key1005", + "messages": [ + "message7006" + ] + }, + { + "key": "key1006", + "messages": [ + "message7007" + ] + }, + { + "key": "key1007", + "messages": [ + "message7008" + ] + }, + { + "key": "key1008", + "messages": [ + "message7009" + ] + }, + { + "key": "key1009", + "messages": [ + "message7010" + ] + }, + { + "key": "key1010", + "messages": [ + "message7011" + ] + }, + { + "key": "key1011", + "messages": [ + "message7012" + ] + }, + { + "key": "key1012", + "messages": [ + "message7013" + ] + }, + { + "key": "key1013", + "messages": [ + "message7014" + ] + }, + { + "key": "key1014", + "messages": [ + "message7015" + ] + }, + { + "key": "key1015", + "messages": [ + "message7016" + ] + }, + { + "key": "key1016", + "messages": [ + "message7017" + ] + }, + { + "key": "key1017", + "messages": [ + "message7018" + ] + }, + { + "key": "key1018", + "messages": [ + "message7019" + ] + }, + { + "key": "key1019", + "messages": [ + "message7020" + ] + }, + { + "key": "key1020", + "messages": [ + "message7021" + ] + }, + { + "key": "key1021", + "messages": [ + "message7022" + ] + }, + { + "key": "key1022", + "messages": [ + "message7023" + ] + }, + { + "key": "key1023", + "messages": [ + "message7024" + ] + }, + { + "key": "key1024", + "messages": [ + "message7025" + ] + }, + { + "key": "key1025", + "messages": [ + "message7026" + ] + }, + { + "key": "key1026", + "messages": [ + "message7027" + ] + }, + { + "key": "key1027", + "messages": [ + "message7028" + ] + }, + { + "key": "key1028", + "messages": [ + "message7029" + ] + }, + { + "key": "key1029", + "messages": [ + "message7030" + ] + }, + { + "key": "key1030", + "messages": [ + "message7031" + ] + }, + { + "key": "key1031", + "messages": [ + "message7032" + ] + }, + { + "key": "key1032", + "messages": [ + "message7033" + ] + }, + { + "key": "key1033", + "messages": [ + "message7034" + ] + }, + { + "key": "key1034", + "messages": [ + "message7035" + ] + }, + { + "key": "key1035", + "messages": [ + "message7036" + ] + }, + { + "key": "key1036", + "messages": [ + "message7037" + ] + }, + { + "key": "key1037", + "messages": [ + "message7038" + ] + }, + { + "key": "key1038", + "messages": [ + "message7039" + ] + }, + { + "key": "key1039", + "messages": [ + "message7040" + ] + }, + { + "key": "key1040", + "messages": [ + "message7041" + ] + }, + { + "key": "key1041", + "messages": [ + "message7042" + ] + }, + { + "key": "key1042", + "messages": [ + "message7043" + ] + }, + { + "key": "key1043", + "messages": [ + "message7044" + ] + }, + { + "key": "key1044", + "messages": [ + "message7045" + ] + }, + { + "key": "key1045", + "messages": [ + "message7046" + ] + }, + { + "key": "key1046", + "messages": [ + "message7047" + ] + }, + { + "key": "key1047", + "messages": [ + "message7048" + ] + }, + { + "key": "key1048", + "messages": [ + "message7049" + ] + }, + { + "key": "key1049", + "messages": [ + "message7050" + ] + }, + { + "key": "key1050", + "messages": [ + "message7051" + ] + }, + { + "key": "key1051", + "messages": [ + "message7052" + ] + }, + { + "key": "key1052", + "messages": [ + "message7053" + ] + }, + { + "key": "key1053", + "messages": [ + "message7054" + ] + }, + { + "key": "key1054", + "messages": [ + "message7055" + ] + }, + { + "key": "key1055", + "messages": [ + "message7056" + ] + }, + { + "key": "key1056", + "messages": [ + "message7057" + ] + }, + { + "key": "key1057", + "messages": [ + "message7058" + ] + }, + { + "key": "key1058", + "messages": [ + "message7059" + ] + }, + { + "key": "key1059", + "messages": [ + "message7060" + ] + }, + { + "key": "key1060", + "messages": [ + "message7061" + ] + }, + { + "key": "key1061", + "messages": [ + "message7062" + ] + }, + { + "key": "key1062", + "messages": [ + "message7063" + ] + }, + { + "key": "key1063", + "messages": [ + "message7064" + ] + }, + { + "key": "key1064", + "messages": [ + "message7065" + ] + }, + { + "key": "key1065", + "messages": [ + "message7066" + ] + }, + { + "key": "key1066", + "messages": [ + "message7067" + ] + }, + { + "key": "key1067", + "messages": [ + "message7068" + ] + }, + { + "key": "key1068", + "messages": [ + "message7069" + ] + }, + { + "key": "key1069", + "messages": [ + "message7070" + ] + }, + { + "key": "key1070", + "messages": [ + "message7071" + ] + }, + { + "key": "key1071", + "messages": [ + "message7072" + ] + }, + { + "key": "key1072", + "messages": [ + "message7073" + ] + }, + { + "key": "key1073", + "messages": [ + "message7074" + ] + }, + { + "key": "key1074", + "messages": [ + "message7075" + ] + }, + { + "key": "key1075", + "messages": [ + "message7076" + ] + }, + { + "key": "key1076", + "messages": [ + "message7077" + ] + }, + { + "key": "key1077", + "messages": [ + "message7078" + ] + }, + { + "key": "key1078", + "messages": [ + "message7079" + ] + }, + { + "key": "key1079", + "messages": [ + "message7080" + ] + }, + { + "key": "key1080", + "messages": [ + "message7081" + ] + }, + { + "key": "key1081", + "messages": [ + "message7082" + ] + }, + { + "key": "key1082", + "messages": [ + "message7083" + ] + }, + { + "key": "key1083", + "messages": [ + "message7084" + ] + }, + { + "key": "key1084", + "messages": [ + "message7085" + ] + }, + { + "key": "key1085", + "messages": [ + "message7086" + ] + }, + { + "key": "key1086", + "messages": [ + "message7087" + ] + }, + { + "key": "key1087", + "messages": [ + "message7088" + ] + }, + { + "key": "key1088", + "messages": [ + "message7089" + ] + }, + { + "key": "key1089", + "messages": [ + "message7090" + ] + }, + { + "key": "key1090", + "messages": [ + "message7091" + ] + }, + { + "key": "key1091", + "messages": [ + "message7092" + ] + }, + { + "key": "key1092", + "messages": [ + "message7093" + ] + }, + { + "key": "key1093", + "messages": [ + "message7094" + ] + }, + { + "key": "key1094", + "messages": [ + "message7095" + ] + }, + { + "key": "key1095", + "messages": [ + "message7096" + ] + }, + { + "key": "key1096", + "messages": [ + "message7097" + ] + }, + { + "key": "key1097", + "messages": [ + "message7098" + ] + }, + { + "key": "key1098", + "messages": [ + "message7099" + ] + }, + { + "key": "key1099", + "messages": [ + "message7100" + ] + }, + { + "key": "key1100", + "messages": [ + "message7101" + ] + }, + { + "key": "key1101", + "messages": [ + "message7102" + ] + }, + { + "key": "key1102", + "messages": [ + "message7103" + ] + }, + { + "key": "key1103", + "messages": [ + "message7104" + ] + }, + { + "key": "key1104", + "messages": [ + "message7105" + ] + }, + { + "key": "key1105", + "messages": [ + "message7106" + ] + }, + { + "key": "key1106", + "messages": [ + "message7107" + ] + }, + { + "key": "key1107", + "messages": [ + "message7108" + ] + }, + { + "key": "key1108", + "messages": [ + "message7109" + ] + }, + { + "key": "key1109", + "messages": [ + "message7110" + ] + }, + { + "key": "key1110", + "messages": [ + "message7111" + ] + }, + { + "key": "key1111", + "messages": [ + "message7112" + ] + }, + { + "key": "key1112", + "messages": [ + "message7113" + ] + }, + { + "key": "key1113", + "messages": [ + "message7114" + ] + }, + { + "key": "key1114", + "messages": [ + "message7115" + ] + }, + { + "key": "key1115", + "messages": [ + "message7116" + ] + }, + { + "key": "key1116", + "messages": [ + "message7117" + ] + }, + { + "key": "key1117", + "messages": [ + "message7118" + ] + }, + { + "key": "key1118", + "messages": [ + "message7119" + ] + }, + { + "key": "key1119", + "messages": [ + "message7120" + ] + }, + { + "key": "key1120", + "messages": [ + "message7121" + ] + }, + { + "key": "key1121", + "messages": [ + "message7122" + ] + }, + { + "key": "key1122", + "messages": [ + "message7123" + ] + }, + { + "key": "key1123", + "messages": [ + "message7124" + ] + }, + { + "key": "key1124", + "messages": [ + "message7125" + ] + }, + { + "key": "key1125", + "messages": [ + "message7126" + ] + }, + { + "key": "key1126", + "messages": [ + "message7127" + ] + }, + { + "key": "key1127", + "messages": [ + "message7128" + ] + }, + { + "key": "key1128", + "messages": [ + "message7129" + ] + }, + { + "key": "key1129", + "messages": [ + "message7130" + ] + }, + { + "key": "key1130", + "messages": [ + "message7131" + ] + }, + { + "key": "key1131", + "messages": [ + "message7132" + ] + }, + { + "key": "key1132", + "messages": [ + "message7133" + ] + }, + { + "key": "key1133", + "messages": [ + "message7134" + ] + }, + { + "key": "key1134", + "messages": [ + "message7135" + ] + }, + { + "key": "key1135", + "messages": [ + "message7136" + ] + }, + { + "key": "key1136", + "messages": [ + "message7137" + ] + }, + { + "key": "key1137", + "messages": [ + "message7138" + ] + }, + { + "key": "key1138", + "messages": [ + "message7139" + ] + }, + { + "key": "key1139", + "messages": [ + "message7140" + ] + }, + { + "key": "key1140", + "messages": [ + "message7141" + ] + }, + { + "key": "key1141", + "messages": [ + "message7142" + ] + }, + { + "key": "key1142", + "messages": [ + "message7143" + ] + }, + { + "key": "key1143", + "messages": [ + "message7144" + ] + }, + { + "key": "key1144", + "messages": [ + "message7145" + ] + }, + { + "key": "key1145", + "messages": [ + "message7146" + ] + }, + { + "key": "key1146", + "messages": [ + "message7147" + ] + }, + { + "key": "key1147", + "messages": [ + "message7148" + ] + }, + { + "key": "key1148", + "messages": [ + "message7149" + ] + }, + { + "key": "key1149", + "messages": [ + "message7150" + ] + }, + { + "key": "key1150", + "messages": [ + "message7151" + ] + }, + { + "key": "key1151", + "messages": [ + "message7152" + ] + }, + { + "key": "key1152", + "messages": [ + "message7153" + ] + }, + { + "key": "key1153", + "messages": [ + "message7154" + ] + }, + { + "key": "key1154", + "messages": [ + "message7155" + ] + }, + { + "key": "key1155", + "messages": [ + "message7156" + ] + }, + { + "key": "key1156", + "messages": [ + "message7157" + ] + }, + { + "key": "key1157", + "messages": [ + "message7158" + ] + }, + { + "key": "key1158", + "messages": [ + "message7159" + ] + }, + { + "key": "key1159", + "messages": [ + "message7160" + ] + }, + { + "key": "key1160", + "messages": [ + "message7161" + ] + }, + { + "key": "key1161", + "messages": [ + "message7162" + ] + }, + { + "key": "key1162", + "messages": [ + "message7163" + ] + }, + { + "key": "key1163", + "messages": [ + "message7164" + ] + }, + { + "key": "key1164", + "messages": [ + "message7165" + ] + }, + { + "key": "key1165", + "messages": [ + "message7166" + ] + }, + { + "key": "key1166", + "messages": [ + "message7167" + ] + }, + { + "key": "key1167", + "messages": [ + "message7168" + ] + }, + { + "key": "key1168", + "messages": [ + "message7169" + ] + }, + { + "key": "key1169", + "messages": [ + "message7170" + ] + }, + { + "key": "key1170", + "messages": [ + "message7171" + ] + }, + { + "key": "key1171", + "messages": [ + "message7172" + ] + }, + { + "key": "key1172", + "messages": [ + "message7173" + ] + }, + { + "key": "key1173", + "messages": [ + "message7174" + ] + }, + { + "key": "key1174", + "messages": [ + "message7175" + ] + }, + { + "key": "key1175", + "messages": [ + "message7176" + ] + }, + { + "key": "key1176", + "messages": [ + "message7177" + ] + }, + { + "key": "key1177", + "messages": [ + "message7178" + ] + }, + { + "key": "key1178", + "messages": [ + "message7179" + ] + }, + { + "key": "key1179", + "messages": [ + "message7180" + ] + }, + { + "key": "key1180", + "messages": [ + "message7181" + ] + }, + { + "key": "key1181", + "messages": [ + "message7182" + ] + }, + { + "key": "key1182", + "messages": [ + "message7183" + ] + }, + { + "key": "key1183", + "messages": [ + "message7184" + ] + }, + { + "key": "key1184", + "messages": [ + "message7185" + ] + }, + { + "key": "key1185", + "messages": [ + "message7186" + ] + }, + { + "key": "key1186", + "messages": [ + "message7187" + ] + }, + { + "key": "key1187", + "messages": [ + "message7188" + ] + }, + { + "key": "key1188", + "messages": [ + "message7189" + ] + }, + { + "key": "key1189", + "messages": [ + "message7190" + ] + }, + { + "key": "key1190", + "messages": [ + "message7191" + ] + }, + { + "key": "key1191", + "messages": [ + "message7192" + ] + }, + { + "key": "key1192", + "messages": [ + "message7193" + ] + }, + { + "key": "key1193", + "messages": [ + "message7194" + ] + }, + { + "key": "key1194", + "messages": [ + "message7195" + ] + }, + { + "key": "key1195", + "messages": [ + "message7196" + ] + }, + { + "key": "key1196", + "messages": [ + "message7197" + ] + }, + { + "key": "key1197", + "messages": [ + "message7198" + ] + }, + { + "key": "key1198", + "messages": [ + "message7199" + ] + }, + { + "key": "key1199", + "messages": [ + "message7200" + ] + }, + { + "key": "key1200", + "messages": [ + "message7201" + ] + }, + { + "key": "key1201", + "messages": [ + "message7202" + ] + }, + { + "key": "key1202", + "messages": [ + "message7203" + ] + }, + { + "key": "key1203", + "messages": [ + "message7204" + ] + }, + { + "key": "key1204", + "messages": [ + "message7205" + ] + }, + { + "key": "key1205", + "messages": [ + "message7206" + ] + }, + { + "key": "key1206", + "messages": [ + "message7207" + ] + }, + { + "key": "key1207", + "messages": [ + "message7208" + ] + }, + { + "key": "key1208", + "messages": [ + "message7209" + ] + }, + { + "key": "key1209", + "messages": [ + "message7210" + ] + }, + { + "key": "key1210", + "messages": [ + "message7211" + ] + }, + { + "key": "key1211", + "messages": [ + "message7212" + ] + }, + { + "key": "key1212", + "messages": [ + "message7213" + ] + }, + { + "key": "key1213", + "messages": [ + "message7214" + ] + }, + { + "key": "key1214", + "messages": [ + "message7215" + ] + }, + { + "key": "key1215", + "messages": [ + "message7216" + ] + }, + { + "key": "key1216", + "messages": [ + "message7217" + ] + }, + { + "key": "key1217", + "messages": [ + "message7218" + ] + }, + { + "key": "key1218", + "messages": [ + "message7219" + ] + }, + { + "key": "key1219", + "messages": [ + "message7220" + ] + }, + { + "key": "key1220", + "messages": [ + "message7221" + ] + }, + { + "key": "key1221", + "messages": [ + "message7222" + ] + }, + { + "key": "key1222", + "messages": [ + "message7223" + ] + }, + { + "key": "key1223", + "messages": [ + "message7224" + ] + }, + { + "key": "key1224", + "messages": [ + "message7225" + ] + }, + { + "key": "key1225", + "messages": [ + "message7226" + ] + }, + { + "key": "key1226", + "messages": [ + "message7227" + ] + }, + { + "key": "key1227", + "messages": [ + "message7228" + ] + }, + { + "key": "key1228", + "messages": [ + "message7229" + ] + }, + { + "key": "key1229", + "messages": [ + "message7230" + ] + }, + { + "key": "key1230", + "messages": [ + "message7231" + ] + }, + { + "key": "key1231", + "messages": [ + "message7232" + ] + }, + { + "key": "key1232", + "messages": [ + "message7233" + ] + }, + { + "key": "key1233", + "messages": [ + "message7234" + ] + }, + { + "key": "key1234", + "messages": [ + "message7235" + ] + }, + { + "key": "key1235", + "messages": [ + "message7236" + ] + }, + { + "key": "key1236", + "messages": [ + "message7237" + ] + }, + { + "key": "key1237", + "messages": [ + "message7238" + ] + }, + { + "key": "key1238", + "messages": [ + "message7239" + ] + }, + { + "key": "key1239", + "messages": [ + "message7240" + ] + }, + { + "key": "key1240", + "messages": [ + "message7241" + ] + }, + { + "key": "key1241", + "messages": [ + "message7242" + ] + }, + { + "key": "key1242", + "messages": [ + "message7243" + ] + }, + { + "key": "key1243", + "messages": [ + "message7244" + ] + }, + { + "key": "key1244", + "messages": [ + "message7245" + ] + }, + { + "key": "key1245", + "messages": [ + "message7246" + ] + }, + { + "key": "key1246", + "messages": [ + "message7247" + ] + }, + { + "key": "key1247", + "messages": [ + "message7248" + ] + }, + { + "key": "key1248", + "messages": [ + "message7249" + ] + }, + { + "key": "key1249", + "messages": [ + "message7250" + ] + }, + { + "key": "key1250", + "messages": [ + "message7251" + ] + }, + { + "key": "key1251", + "messages": [ + "message7252" + ] + }, + { + "key": "key1252", + "messages": [ + "message7253" + ] + }, + { + "key": "key1253", + "messages": [ + "message7254" + ] + }, + { + "key": "key1254", + "messages": [ + "message7255" + ] + }, + { + "key": "key1255", + "messages": [ + "message7256" + ] + }, + { + "key": "key1256", + "messages": [ + "message7257" + ] + }, + { + "key": "key1257", + "messages": [ + "message7258" + ] + }, + { + "key": "key1258", + "messages": [ + "message7259" + ] + }, + { + "key": "key1259", + "messages": [ + "message7260" + ] + }, + { + "key": "key1260", + "messages": [ + "message7261" + ] + }, + { + "key": "key1261", + "messages": [ + "message7262" + ] + }, + { + "key": "key1262", + "messages": [ + "message7263" + ] + }, + { + "key": "key1263", + "messages": [ + "message7264" + ] + }, + { + "key": "key1264", + "messages": [ + "message7265" + ] + }, + { + "key": "key1265", + "messages": [ + "message7266" + ] + }, + { + "key": "key1266", + "messages": [ + "message7267" + ] + }, + { + "key": "key1267", + "messages": [ + "message7268" + ] + }, + { + "key": "key1268", + "messages": [ + "message7269" + ] + }, + { + "key": "key1269", + "messages": [ + "message7270" + ] + }, + { + "key": "key1270", + "messages": [ + "message7271" + ] + }, + { + "key": "key1271", + "messages": [ + "message7272" + ] + }, + { + "key": "key1272", + "messages": [ + "message7273" + ] + }, + { + "key": "key1273", + "messages": [ + "message7274" + ] + }, + { + "key": "key1274", + "messages": [ + "message7275" + ] + }, + { + "key": "key1275", + "messages": [ + "message7276" + ] + }, + { + "key": "key1276", + "messages": [ + "message7277" + ] + }, + { + "key": "key1277", + "messages": [ + "message7278" + ] + }, + { + "key": "key1278", + "messages": [ + "message7279" + ] + }, + { + "key": "key1279", + "messages": [ + "message7280" + ] + }, + { + "key": "key1280", + "messages": [ + "message7281" + ] + }, + { + "key": "key1281", + "messages": [ + "message7282" + ] + }, + { + "key": "key1282", + "messages": [ + "message7283" + ] + }, + { + "key": "key1283", + "messages": [ + "message7284" + ] + }, + { + "key": "key1284", + "messages": [ + "message7285" + ] + }, + { + "key": "key1285", + "messages": [ + "message7286" + ] + }, + { + "key": "key1286", + "messages": [ + "message7287" + ] + }, + { + "key": "key1287", + "messages": [ + "message7288" + ] + }, + { + "key": "key1288", + "messages": [ + "message7289" + ] + }, + { + "key": "key1289", + "messages": [ + "message7290" + ] + }, + { + "key": "key1290", + "messages": [ + "message7291" + ] + }, + { + "key": "key1291", + "messages": [ + "message7292" + ] + }, + { + "key": "key1292", + "messages": [ + "message7293" + ] + }, + { + "key": "key1293", + "messages": [ + "message7294" + ] + }, + { + "key": "key1294", + "messages": [ + "message7295" + ] + }, + { + "key": "key1295", + "messages": [ + "message7296" + ] + }, + { + "key": "key1296", + "messages": [ + "message7297" + ] + }, + { + "key": "key1297", + "messages": [ + "message7298" + ] + }, + { + "key": "key1298", + "messages": [ + "message7299" + ] + }, + { + "key": "key1299", + "messages": [ + "message7300" + ] + }, + { + "key": "key1300", + "messages": [ + "message7301" + ] + }, + { + "key": "key1301", + "messages": [ + "message7302" + ] + }, + { + "key": "key1302", + "messages": [ + "message7303" + ] + }, + { + "key": "key1303", + "messages": [ + "message7304" + ] + }, + { + "key": "key1304", + "messages": [ + "message7305" + ] + }, + { + "key": "key1305", + "messages": [ + "message7306" + ] + }, + { + "key": "key1306", + "messages": [ + "message7307" + ] + }, + { + "key": "key1307", + "messages": [ + "message7308" + ] + }, + { + "key": "key1308", + "messages": [ + "message7309" + ] + }, + { + "key": "key1309", + "messages": [ + "message7310" + ] + }, + { + "key": "key1310", + "messages": [ + "message7311" + ] + }, + { + "key": "key1311", + "messages": [ + "message7312" + ] + }, + { + "key": "key1312", + "messages": [ + "message7313" + ] + }, + { + "key": "key1313", + "messages": [ + "message7314" + ] + }, + { + "key": "key1314", + "messages": [ + "message7315" + ] + }, + { + "key": "key1315", + "messages": [ + "message7316" + ] + }, + { + "key": "key1316", + "messages": [ + "message7317" + ] + }, + { + "key": "key1317", + "messages": [ + "message7318" + ] + }, + { + "key": "key1318", + "messages": [ + "message7319" + ] + }, + { + "key": "key1319", + "messages": [ + "message7320" + ] + }, + { + "key": "key1320", + "messages": [ + "message7321" + ] + }, + { + "key": "key1321", + "messages": [ + "message7322" + ] + }, + { + "key": "key1322", + "messages": [ + "message7323" + ] + }, + { + "key": "key1323", + "messages": [ + "message7324" + ] + }, + { + "key": "key1324", + "messages": [ + "message7325" + ] + }, + { + "key": "key1325", + "messages": [ + "message7326" + ] + }, + { + "key": "key1326", + "messages": [ + "message7327" + ] + }, + { + "key": "key1327", + "messages": [ + "message7328" + ] + }, + { + "key": "key1328", + "messages": [ + "message7329" + ] + }, + { + "key": "key1329", + "messages": [ + "message7330" + ] + }, + { + "key": "key1330", + "messages": [ + "message7331" + ] + }, + { + "key": "key1331", + "messages": [ + "message7332" + ] + }, + { + "key": "key1332", + "messages": [ + "message7333" + ] + }, + { + "key": "key1333", + "messages": [ + "message7334" + ] + }, + { + "key": "key1334", + "messages": [ + "message7335" + ] + }, + { + "key": "key1335", + "messages": [ + "message7336" + ] + }, + { + "key": "key1336", + "messages": [ + "message7337" + ] + }, + { + "key": "key1337", + "messages": [ + "message7338" + ] + }, + { + "key": "key1338", + "messages": [ + "message7339" + ] + }, + { + "key": "key1339", + "messages": [ + "message7340" + ] + }, + { + "key": "key1340", + "messages": [ + "message7341" + ] + }, + { + "key": "key1341", + "messages": [ + "message7342" + ] + }, + { + "key": "key1342", + "messages": [ + "message7343" + ] + }, + { + "key": "key1343", + "messages": [ + "message7344" + ] + }, + { + "key": "key1344", + "messages": [ + "message7345" + ] + }, + { + "key": "key1345", + "messages": [ + "message7346" + ] + }, + { + "key": "key1346", + "messages": [ + "message7347" + ] + }, + { + "key": "key1347", + "messages": [ + "message7348" + ] + }, + { + "key": "key1348", + "messages": [ + "message7349" + ] + }, + { + "key": "key1349", + "messages": [ + "message7350" + ] + }, + { + "key": "key1350", + "messages": [ + "message7351" + ] + }, + { + "key": "key1351", + "messages": [ + "message7352" + ] + }, + { + "key": "key1352", + "messages": [ + "message7353" + ] + }, + { + "key": "key1353", + "messages": [ + "message7354" + ] + }, + { + "key": "key1354", + "messages": [ + "message7355" + ] + }, + { + "key": "key1355", + "messages": [ + "message7356" + ] + }, + { + "key": "key1356", + "messages": [ + "message7357" + ] + }, + { + "key": "key1357", + "messages": [ + "message7358" + ] + }, + { + "key": "key1358", + "messages": [ + "message7359" + ] + }, + { + "key": "key1359", + "messages": [ + "message7360" + ] + }, + { + "key": "key1360", + "messages": [ + "message7361" + ] + }, + { + "key": "key1361", + "messages": [ + "message7362" + ] + }, + { + "key": "key1362", + "messages": [ + "message7363" + ] + }, + { + "key": "key1363", + "messages": [ + "message7364" + ] + }, + { + "key": "key1364", + "messages": [ + "message7365" + ] + }, + { + "key": "key1365", + "messages": [ + "message7366" + ] + }, + { + "key": "key1366", + "messages": [ + "message7367" + ] + }, + { + "key": "key1367", + "messages": [ + "message7368" + ] + }, + { + "key": "key1368", + "messages": [ + "message7369" + ] + }, + { + "key": "key1369", + "messages": [ + "message7370" + ] + }, + { + "key": "key1370", + "messages": [ + "message7371" + ] + }, + { + "key": "key1371", + "messages": [ + "message7372" + ] + }, + { + "key": "key1372", + "messages": [ + "message7373" + ] + }, + { + "key": "key1373", + "messages": [ + "message7374" + ] + }, + { + "key": "key1374", + "messages": [ + "message7375" + ] + }, + { + "key": "key1375", + "messages": [ + "message7376" + ] + }, + { + "key": "key1376", + "messages": [ + "message7377" + ] + }, + { + "key": "key1377", + "messages": [ + "message7378" + ] + }, + { + "key": "key1378", + "messages": [ + "message7379" + ] + }, + { + "key": "key1379", + "messages": [ + "message7380" + ] + }, + { + "key": "key1380", + "messages": [ + "message7381" + ] + }, + { + "key": "key1381", + "messages": [ + "message7382" + ] + }, + { + "key": "key1382", + "messages": [ + "message7383" + ] + }, + { + "key": "key1383", + "messages": [ + "message7384" + ] + }, + { + "key": "key1384", + "messages": [ + "message7385" + ] + }, + { + "key": "key1385", + "messages": [ + "message7386" + ] + }, + { + "key": "key1386", + "messages": [ + "message7387" + ] + }, + { + "key": "key1387", + "messages": [ + "message7388" + ] + }, + { + "key": "key1388", + "messages": [ + "message7389" + ] + }, + { + "key": "key1389", + "messages": [ + "message7390" + ] + }, + { + "key": "key1390", + "messages": [ + "message7391" + ] + }, + { + "key": "key1391", + "messages": [ + "message7392" + ] + }, + { + "key": "key1392", + "messages": [ + "message7393" + ] + }, + { + "key": "key1393", + "messages": [ + "message7394" + ] + }, + { + "key": "key1394", + "messages": [ + "message7395" + ] + }, + { + "key": "key1395", + "messages": [ + "message7396" + ] + }, + { + "key": "key1396", + "messages": [ + "message7397" + ] + }, + { + "key": "key1397", + "messages": [ + "message7398" + ] + }, + { + "key": "key1398", + "messages": [ + "message7399" + ] + }, + { + "key": "key1399", + "messages": [ + "message7400" + ] + }, + { + "key": "key1400", + "messages": [ + "message7401" + ] + }, + { + "key": "key1401", + "messages": [ + "message7402" + ] + }, + { + "key": "key1402", + "messages": [ + "message7403" + ] + }, + { + "key": "key1403", + "messages": [ + "message7404" + ] + }, + { + "key": "key1404", + "messages": [ + "message7405" + ] + }, + { + "key": "key1405", + "messages": [ + "message7406" + ] + }, + { + "key": "key1406", + "messages": [ + "message7407" + ] + }, + { + "key": "key1407", + "messages": [ + "message7408" + ] + }, + { + "key": "key1408", + "messages": [ + "message7409" + ] + }, + { + "key": "key1409", + "messages": [ + "message7410" + ] + }, + { + "key": "key1410", + "messages": [ + "message7411" + ] + }, + { + "key": "key1411", + "messages": [ + "message7412" + ] + }, + { + "key": "key1412", + "messages": [ + "message7413" + ] + }, + { + "key": "key1413", + "messages": [ + "message7414" + ] + }, + { + "key": "key1414", + "messages": [ + "message7415" + ] + }, + { + "key": "key1415", + "messages": [ + "message7416" + ] + }, + { + "key": "key1416", + "messages": [ + "message7417" + ] + }, + { + "key": "key1417", + "messages": [ + "message7418" + ] + }, + { + "key": "key1418", + "messages": [ + "message7419" + ] + }, + { + "key": "key1419", + "messages": [ + "message7420" + ] + }, + { + "key": "key1420", + "messages": [ + "message7421" + ] + }, + { + "key": "key1421", + "messages": [ + "message7422" + ] + }, + { + "key": "key1422", + "messages": [ + "message7423" + ] + }, + { + "key": "key1423", + "messages": [ + "message7424" + ] + }, + { + "key": "key1424", + "messages": [ + "message7425" + ] + }, + { + "key": "key1425", + "messages": [ + "message7426" + ] + }, + { + "key": "key1426", + "messages": [ + "message7427" + ] + }, + { + "key": "key1427", + "messages": [ + "message7428" + ] + }, + { + "key": "key1428", + "messages": [ + "message7429" + ] + }, + { + "key": "key1429", + "messages": [ + "message7430" + ] + }, + { + "key": "key1430", + "messages": [ + "message7431" + ] + }, + { + "key": "key1431", + "messages": [ + "message7432" + ] + }, + { + "key": "key1432", + "messages": [ + "message7433" + ] + }, + { + "key": "key1433", + "messages": [ + "message7434" + ] + }, + { + "key": "key1434", + "messages": [ + "message7435" + ] + }, + { + "key": "key1435", + "messages": [ + "message7436" + ] + }, + { + "key": "key1436", + "messages": [ + "message7437" + ] + }, + { + "key": "key1437", + "messages": [ + "message7438" + ] + }, + { + "key": "key1438", + "messages": [ + "message7439" + ] + }, + { + "key": "key1439", + "messages": [ + "message7440" + ] + }, + { + "key": "key1440", + "messages": [ + "message7441" + ] + }, + { + "key": "key1441", + "messages": [ + "message7442" + ] + }, + { + "key": "key1442", + "messages": [ + "message7443" + ] + }, + { + "key": "key1443", + "messages": [ + "message7444" + ] + }, + { + "key": "key1444", + "messages": [ + "message7445" + ] + }, + { + "key": "key1445", + "messages": [ + "message7446" + ] + }, + { + "key": "key1446", + "messages": [ + "message7447" + ] + }, + { + "key": "key1447", + "messages": [ + "message7448" + ] + }, + { + "key": "key1448", + "messages": [ + "message7449" + ] + }, + { + "key": "key1449", + "messages": [ + "message7450" + ] + }, + { + "key": "key1450", + "messages": [ + "message7451" + ] + }, + { + "key": "key1451", + "messages": [ + "message7452" + ] + }, + { + "key": "key1452", + "messages": [ + "message7453" + ] + }, + { + "key": "key1453", + "messages": [ + "message7454" + ] + }, + { + "key": "key1454", + "messages": [ + "message7455" + ] + }, + { + "key": "key1455", + "messages": [ + "message7456" + ] + }, + { + "key": "key1456", + "messages": [ + "message7457" + ] + }, + { + "key": "key1457", + "messages": [ + "message7458" + ] + }, + { + "key": "key1458", + "messages": [ + "message7459" + ] + }, + { + "key": "key1459", + "messages": [ + "message7460" + ] + }, + { + "key": "key1460", + "messages": [ + "message7461" + ] + }, + { + "key": "key1461", + "messages": [ + "message7462" + ] + }, + { + "key": "key1462", + "messages": [ + "message7463" + ] + }, + { + "key": "key1463", + "messages": [ + "message7464" + ] + }, + { + "key": "key1464", + "messages": [ + "message7465" + ] + }, + { + "key": "key1465", + "messages": [ + "message7466" + ] + }, + { + "key": "key1466", + "messages": [ + "message7467" + ] + }, + { + "key": "key1467", + "messages": [ + "message7468" + ] + }, + { + "key": "key1468", + "messages": [ + "message7469" + ] + }, + { + "key": "key1469", + "messages": [ + "message7470" + ] + }, + { + "key": "key1470", + "messages": [ + "message7471" + ] + }, + { + "key": "key1471", + "messages": [ + "message7472" + ] + }, + { + "key": "key1472", + "messages": [ + "message7473" + ] + }, + { + "key": "key1473", + "messages": [ + "message7474" + ] + }, + { + "key": "key1474", + "messages": [ + "message7475" + ] + }, + { + "key": "key1475", + "messages": [ + "message7476" + ] + }, + { + "key": "key1476", + "messages": [ + "message7477" + ] + }, + { + "key": "key1477", + "messages": [ + "message7478" + ] + }, + { + "key": "key1478", + "messages": [ + "message7479" + ] + }, + { + "key": "key1479", + "messages": [ + "message7480" + ] + }, + { + "key": "key1480", + "messages": [ + "message7481" + ] + }, + { + "key": "key1481", + "messages": [ + "message7482" + ] + }, + { + "key": "key1482", + "messages": [ + "message7483" + ] + }, + { + "key": "key1483", + "messages": [ + "message7484" + ] + }, + { + "key": "key1484", + "messages": [ + "message7485" + ] + }, + { + "key": "key1485", + "messages": [ + "message7486" + ] + }, + { + "key": "key1486", + "messages": [ + "message7487" + ] + }, + { + "key": "key1487", + "messages": [ + "message7488" + ] + }, + { + "key": "key1488", + "messages": [ + "message7489" + ] + }, + { + "key": "key1489", + "messages": [ + "message7490" + ] + }, + { + "key": "key1490", + "messages": [ + "message7491" + ] + }, + { + "key": "key1491", + "messages": [ + "message7492" + ] + }, + { + "key": "key1492", + "messages": [ + "message7493" + ] + }, + { + "key": "key1493", + "messages": [ + "message7494" + ] + }, + { + "key": "key1494", + "messages": [ + "message7495" + ] + }, + { + "key": "key1495", + "messages": [ + "message7496" + ] + }, + { + "key": "key1496", + "messages": [ + "message7497" + ] + }, + { + "key": "key1497", + "messages": [ + "message7498" + ] + }, + { + "key": "key1498", + "messages": [ + "message7499" + ] + }, + { + "key": "key1499", + "messages": [ + "message7500" + ] + }, + { + "key": "key1500", + "messages": [ + "message7501" + ] + }, + { + "key": "key1501", + "messages": [ + "message7502" + ] + }, + { + "key": "key1502", + "messages": [ + "message7503" + ] + }, + { + "key": "key1503", + "messages": [ + "message7504" + ] + }, + { + "key": "key1504", + "messages": [ + "message7505" + ] + }, + { + "key": "key1505", + "messages": [ + "message7506" + ] + }, + { + "key": "key1506", + "messages": [ + "message7507" + ] + }, + { + "key": "key1507", + "messages": [ + "message7508" + ] + }, + { + "key": "key1508", + "messages": [ + "message7509" + ] + }, + { + "key": "key1509", + "messages": [ + "message7510" + ] + }, + { + "key": "key1510", + "messages": [ + "message7511" + ] + }, + { + "key": "key1511", + "messages": [ + "message7512" + ] + }, + { + "key": "key1512", + "messages": [ + "message7513" + ] + }, + { + "key": "key1513", + "messages": [ + "message7514" + ] + }, + { + "key": "key1514", + "messages": [ + "message7515" + ] + }, + { + "key": "key1515", + "messages": [ + "message7516" + ] + }, + { + "key": "key1516", + "messages": [ + "message7517" + ] + }, + { + "key": "key1517", + "messages": [ + "message7518" + ] + }, + { + "key": "key1518", + "messages": [ + "message7519" + ] + }, + { + "key": "key1519", + "messages": [ + "message7520" + ] + }, + { + "key": "key1520", + "messages": [ + "message7521" + ] + }, + { + "key": "key1521", + "messages": [ + "message7522" + ] + }, + { + "key": "key1522", + "messages": [ + "message7523" + ] + }, + { + "key": "key1523", + "messages": [ + "message7524" + ] + }, + { + "key": "key1524", + "messages": [ + "message7525" + ] + }, + { + "key": "key1525", + "messages": [ + "message7526" + ] + }, + { + "key": "key1526", + "messages": [ + "message7527" + ] + }, + { + "key": "key1527", + "messages": [ + "message7528" + ] + }, + { + "key": "key1528", + "messages": [ + "message7529" + ] + }, + { + "key": "key1529", + "messages": [ + "message7530" + ] + }, + { + "key": "key1530", + "messages": [ + "message7531" + ] + }, + { + "key": "key1531", + "messages": [ + "message7532" + ] + }, + { + "key": "key1532", + "messages": [ + "message7533" + ] + }, + { + "key": "key1533", + "messages": [ + "message7534" + ] + }, + { + "key": "key1534", + "messages": [ + "message7535" + ] + }, + { + "key": "key1535", + "messages": [ + "message7536" + ] + }, + { + "key": "key1536", + "messages": [ + "message7537" + ] + }, + { + "key": "key1537", + "messages": [ + "message7538" + ] + }, + { + "key": "key1538", + "messages": [ + "message7539" + ] + }, + { + "key": "key1539", + "messages": [ + "message7540" + ] + }, + { + "key": "key1540", + "messages": [ + "message7541" + ] + }, + { + "key": "key1541", + "messages": [ + "message7542" + ] + }, + { + "key": "key1542", + "messages": [ + "message7543" + ] + }, + { + "key": "key1543", + "messages": [ + "message7544" + ] + }, + { + "key": "key1544", + "messages": [ + "message7545" + ] + }, + { + "key": "key1545", + "messages": [ + "message7546" + ] + }, + { + "key": "key1546", + "messages": [ + "message7547" + ] + }, + { + "key": "key1547", + "messages": [ + "message7548" + ] + }, + { + "key": "key1548", + "messages": [ + "message7549" + ] + }, + { + "key": "key1549", + "messages": [ + "message7550" + ] + }, + { + "key": "key1550", + "messages": [ + "message7551" + ] + }, + { + "key": "key1551", + "messages": [ + "message7552" + ] + }, + { + "key": "key1552", + "messages": [ + "message7553" + ] + }, + { + "key": "key1553", + "messages": [ + "message7554" + ] + }, + { + "key": "key1554", + "messages": [ + "message7555" + ] + }, + { + "key": "key1555", + "messages": [ + "message7556" + ] + }, + { + "key": "key1556", + "messages": [ + "message7557" + ] + }, + { + "key": "key1557", + "messages": [ + "message7558" + ] + }, + { + "key": "key1558", + "messages": [ + "message7559" + ] + }, + { + "key": "key1559", + "messages": [ + "message7560" + ] + }, + { + "key": "key1560", + "messages": [ + "message7561" + ] + }, + { + "key": "key1561", + "messages": [ + "message7562" + ] + }, + { + "key": "key1562", + "messages": [ + "message7563" + ] + }, + { + "key": "key1563", + "messages": [ + "message7564" + ] + }, + { + "key": "key1564", + "messages": [ + "message7565" + ] + }, + { + "key": "key1565", + "messages": [ + "message7566" + ] + }, + { + "key": "key1566", + "messages": [ + "message7567" + ] + }, + { + "key": "key1567", + "messages": [ + "message7568" + ] + }, + { + "key": "key1568", + "messages": [ + "message7569" + ] + }, + { + "key": "key1569", + "messages": [ + "message7570" + ] + }, + { + "key": "key1570", + "messages": [ + "message7571" + ] + }, + { + "key": "key1571", + "messages": [ + "message7572" + ] + }, + { + "key": "key1572", + "messages": [ + "message7573" + ] + }, + { + "key": "key1573", + "messages": [ + "message7574" + ] + }, + { + "key": "key1574", + "messages": [ + "message7575" + ] + }, + { + "key": "key1575", + "messages": [ + "message7576" + ] + }, + { + "key": "key1576", + "messages": [ + "message7577" + ] + }, + { + "key": "key1577", + "messages": [ + "message7578" + ] + }, + { + "key": "key1578", + "messages": [ + "message7579" + ] + }, + { + "key": "key1579", + "messages": [ + "message7580" + ] + }, + { + "key": "key1580", + "messages": [ + "message7581" + ] + }, + { + "key": "key1581", + "messages": [ + "message7582" + ] + }, + { + "key": "key1582", + "messages": [ + "message7583" + ] + }, + { + "key": "key1583", + "messages": [ + "message7584" + ] + }, + { + "key": "key1584", + "messages": [ + "message7585" + ] + }, + { + "key": "key1585", + "messages": [ + "message7586" + ] + }, + { + "key": "key1586", + "messages": [ + "message7587" + ] + }, + { + "key": "key1587", + "messages": [ + "message7588" + ] + }, + { + "key": "key1588", + "messages": [ + "message7589" + ] + }, + { + "key": "key1589", + "messages": [ + "message7590" + ] + }, + { + "key": "key1590", + "messages": [ + "message7591" + ] + }, + { + "key": "key1591", + "messages": [ + "message7592" + ] + }, + { + "key": "key1592", + "messages": [ + "message7593" + ] + }, + { + "key": "key1593", + "messages": [ + "message7594" + ] + }, + { + "key": "key1594", + "messages": [ + "message7595" + ] + }, + { + "key": "key1595", + "messages": [ + "message7596" + ] + }, + { + "key": "key1596", + "messages": [ + "message7597" + ] + }, + { + "key": "key1597", + "messages": [ + "message7598" + ] + }, + { + "key": "key1598", + "messages": [ + "message7599" + ] + }, + { + "key": "key1599", + "messages": [ + "message7600" + ] + }, + { + "key": "key1600", + "messages": [ + "message7601" + ] + }, + { + "key": "key1601", + "messages": [ + "message7602" + ] + }, + { + "key": "key1602", + "messages": [ + "message7603" + ] + }, + { + "key": "key1603", + "messages": [ + "message7604" + ] + }, + { + "key": "key1604", + "messages": [ + "message7605" + ] + }, + { + "key": "key1605", + "messages": [ + "message7606" + ] + }, + { + "key": "key1606", + "messages": [ + "message7607" + ] + }, + { + "key": "key1607", + "messages": [ + "message7608" + ] + }, + { + "key": "key1608", + "messages": [ + "message7609" + ] + }, + { + "key": "key1609", + "messages": [ + "message7610" + ] + }, + { + "key": "key1610", + "messages": [ + "message7611" + ] + }, + { + "key": "key1611", + "messages": [ + "message7612" + ] + }, + { + "key": "key1612", + "messages": [ + "message7613" + ] + }, + { + "key": "key1613", + "messages": [ + "message7614" + ] + }, + { + "key": "key1614", + "messages": [ + "message7615" + ] + }, + { + "key": "key1615", + "messages": [ + "message7616" + ] + }, + { + "key": "key1616", + "messages": [ + "message7617" + ] + }, + { + "key": "key1617", + "messages": [ + "message7618" + ] + }, + { + "key": "key1618", + "messages": [ + "message7619" + ] + }, + { + "key": "key1619", + "messages": [ + "message7620" + ] + }, + { + "key": "key1620", + "messages": [ + "message7621" + ] + }, + { + "key": "key1621", + "messages": [ + "message7622" + ] + }, + { + "key": "key1622", + "messages": [ + "message7623" + ] + }, + { + "key": "key1623", + "messages": [ + "message7624" + ] + }, + { + "key": "key1624", + "messages": [ + "message7625" + ] + }, + { + "key": "key1625", + "messages": [ + "message7626" + ] + }, + { + "key": "key1626", + "messages": [ + "message7627" + ] + }, + { + "key": "key1627", + "messages": [ + "message7628" + ] + }, + { + "key": "key1628", + "messages": [ + "message7629" + ] + }, + { + "key": "key1629", + "messages": [ + "message7630" + ] + }, + { + "key": "key1630", + "messages": [ + "message7631" + ] + }, + { + "key": "key1631", + "messages": [ + "message7632" + ] + }, + { + "key": "key1632", + "messages": [ + "message7633" + ] + }, + { + "key": "key1633", + "messages": [ + "message7634" + ] + }, + { + "key": "key1634", + "messages": [ + "message7635" + ] + }, + { + "key": "key1635", + "messages": [ + "message7636" + ] + }, + { + "key": "key1636", + "messages": [ + "message7637" + ] + }, + { + "key": "key1637", + "messages": [ + "message7638" + ] + }, + { + "key": "key1638", + "messages": [ + "message7639" + ] + }, + { + "key": "key1639", + "messages": [ + "message7640" + ] + }, + { + "key": "key1640", + "messages": [ + "message7641" + ] + }, + { + "key": "key1641", + "messages": [ + "message7642" + ] + }, + { + "key": "key1642", + "messages": [ + "message7643" + ] + }, + { + "key": "key1643", + "messages": [ + "message7644" + ] + }, + { + "key": "key1644", + "messages": [ + "message7645" + ] + }, + { + "key": "key1645", + "messages": [ + "message7646" + ] + }, + { + "key": "key1646", + "messages": [ + "message7647" + ] + }, + { + "key": "key1647", + "messages": [ + "message7648" + ] + }, + { + "key": "key1648", + "messages": [ + "message7649" + ] + }, + { + "key": "key1649", + "messages": [ + "message7650" + ] + }, + { + "key": "key1650", + "messages": [ + "message7651" + ] + }, + { + "key": "key1651", + "messages": [ + "message7652" + ] + }, + { + "key": "key1652", + "messages": [ + "message7653" + ] + }, + { + "key": "key1653", + "messages": [ + "message7654" + ] + }, + { + "key": "key1654", + "messages": [ + "message7655" + ] + }, + { + "key": "key1655", + "messages": [ + "message7656" + ] + }, + { + "key": "key1656", + "messages": [ + "message7657" + ] + }, + { + "key": "key1657", + "messages": [ + "message7658" + ] + }, + { + "key": "key1658", + "messages": [ + "message7659" + ] + }, + { + "key": "key1659", + "messages": [ + "message7660" + ] + }, + { + "key": "key1660", + "messages": [ + "message7661" + ] + }, + { + "key": "key1661", + "messages": [ + "message7662" + ] + }, + { + "key": "key1662", + "messages": [ + "message7663" + ] + }, + { + "key": "key1663", + "messages": [ + "message7664" + ] + }, + { + "key": "key1664", + "messages": [ + "message7665" + ] + }, + { + "key": "key1665", + "messages": [ + "message7666" + ] + }, + { + "key": "key1666", + "messages": [ + "message7667" + ] + }, + { + "key": "key1667", + "messages": [ + "message7668" + ] + }, + { + "key": "key1668", + "messages": [ + "message7669" + ] + }, + { + "key": "key1669", + "messages": [ + "message7670" + ] + }, + { + "key": "key1670", + "messages": [ + "message7671" + ] + }, + { + "key": "key1671", + "messages": [ + "message7672" + ] + }, + { + "key": "key1672", + "messages": [ + "message7673" + ] + }, + { + "key": "key1673", + "messages": [ + "message7674" + ] + }, + { + "key": "key1674", + "messages": [ + "message7675" + ] + }, + { + "key": "key1675", + "messages": [ + "message7676" + ] + }, + { + "key": "key1676", + "messages": [ + "message7677" + ] + }, + { + "key": "key1677", + "messages": [ + "message7678" + ] + }, + { + "key": "key1678", + "messages": [ + "message7679" + ] + }, + { + "key": "key1679", + "messages": [ + "message7680" + ] + }, + { + "key": "key1680", + "messages": [ + "message7681" + ] + }, + { + "key": "key1681", + "messages": [ + "message7682" + ] + }, + { + "key": "key1682", + "messages": [ + "message7683" + ] + }, + { + "key": "key1683", + "messages": [ + "message7684" + ] + }, + { + "key": "key1684", + "messages": [ + "message7685" + ] + }, + { + "key": "key1685", + "messages": [ + "message7686" + ] + }, + { + "key": "key1686", + "messages": [ + "message7687" + ] + }, + { + "key": "key1687", + "messages": [ + "message7688" + ] + }, + { + "key": "key1688", + "messages": [ + "message7689" + ] + }, + { + "key": "key1689", + "messages": [ + "message7690" + ] + }, + { + "key": "key1690", + "messages": [ + "message7691" + ] + }, + { + "key": "key1691", + "messages": [ + "message7692" + ] + }, + { + "key": "key1692", + "messages": [ + "message7693" + ] + }, + { + "key": "key1693", + "messages": [ + "message7694" + ] + }, + { + "key": "key1694", + "messages": [ + "message7695" + ] + }, + { + "key": "key1695", + "messages": [ + "message7696" + ] + }, + { + "key": "key1696", + "messages": [ + "message7697" + ] + }, + { + "key": "key1697", + "messages": [ + "message7698" + ] + }, + { + "key": "key1698", + "messages": [ + "message7699" + ] + }, + { + "key": "key1699", + "messages": [ + "message7700" + ] + }, + { + "key": "key1700", + "messages": [ + "message7701" + ] + }, + { + "key": "key1701", + "messages": [ + "message7702" + ] + }, + { + "key": "key1702", + "messages": [ + "message7703" + ] + }, + { + "key": "key1703", + "messages": [ + "message7704" + ] + }, + { + "key": "key1704", + "messages": [ + "message7705" + ] + }, + { + "key": "key1705", + "messages": [ + "message7706" + ] + }, + { + "key": "key1706", + "messages": [ + "message7707" + ] + }, + { + "key": "key1707", + "messages": [ + "message7708" + ] + }, + { + "key": "key1708", + "messages": [ + "message7709" + ] + }, + { + "key": "key1709", + "messages": [ + "message7710" + ] + }, + { + "key": "key1710", + "messages": [ + "message7711" + ] + }, + { + "key": "key1711", + "messages": [ + "message7712" + ] + }, + { + "key": "key1712", + "messages": [ + "message7713" + ] + }, + { + "key": "key1713", + "messages": [ + "message7714" + ] + }, + { + "key": "key1714", + "messages": [ + "message7715" + ] + }, + { + "key": "key1715", + "messages": [ + "message7716" + ] + }, + { + "key": "key1716", + "messages": [ + "message7717" + ] + }, + { + "key": "key1717", + "messages": [ + "message7718" + ] + }, + { + "key": "key1718", + "messages": [ + "message7719" + ] + }, + { + "key": "key1719", + "messages": [ + "message7720" + ] + }, + { + "key": "key1720", + "messages": [ + "message7721" + ] + }, + { + "key": "key1721", + "messages": [ + "message7722" + ] + }, + { + "key": "key1722", + "messages": [ + "message7723" + ] + }, + { + "key": "key1723", + "messages": [ + "message7724" + ] + }, + { + "key": "key1724", + "messages": [ + "message7725" + ] + }, + { + "key": "key1725", + "messages": [ + "message7726" + ] + }, + { + "key": "key1726", + "messages": [ + "message7727" + ] + }, + { + "key": "key1727", + "messages": [ + "message7728" + ] + }, + { + "key": "key1728", + "messages": [ + "message7729" + ] + }, + { + "key": "key1729", + "messages": [ + "message7730" + ] + }, + { + "key": "key1730", + "messages": [ + "message7731" + ] + }, + { + "key": "key1731", + "messages": [ + "message7732" + ] + }, + { + "key": "key1732", + "messages": [ + "message7733" + ] + }, + { + "key": "key1733", + "messages": [ + "message7734" + ] + }, + { + "key": "key1734", + "messages": [ + "message7735" + ] + }, + { + "key": "key1735", + "messages": [ + "message7736" + ] + }, + { + "key": "key1736", + "messages": [ + "message7737" + ] + }, + { + "key": "key1737", + "messages": [ + "message7738" + ] + }, + { + "key": "key1738", + "messages": [ + "message7739" + ] + }, + { + "key": "key1739", + "messages": [ + "message7740" + ] + }, + { + "key": "key1740", + "messages": [ + "message7741" + ] + }, + { + "key": "key1741", + "messages": [ + "message7742" + ] + }, + { + "key": "key1742", + "messages": [ + "message7743" + ] + }, + { + "key": "key1743", + "messages": [ + "message7744" + ] + }, + { + "key": "key1744", + "messages": [ + "message7745" + ] + }, + { + "key": "key1745", + "messages": [ + "message7746" + ] + }, + { + "key": "key1746", + "messages": [ + "message7747" + ] + }, + { + "key": "key1747", + "messages": [ + "message7748" + ] + }, + { + "key": "key1748", + "messages": [ + "message7749" + ] + }, + { + "key": "key1749", + "messages": [ + "message7750" + ] + }, + { + "key": "key1750", + "messages": [ + "message7751" + ] + }, + { + "key": "key1751", + "messages": [ + "message7752" + ] + }, + { + "key": "key1752", + "messages": [ + "message7753" + ] + }, + { + "key": "key1753", + "messages": [ + "message7754" + ] + }, + { + "key": "key1754", + "messages": [ + "message7755" + ] + }, + { + "key": "key1755", + "messages": [ + "message7756" + ] + }, + { + "key": "key1756", + "messages": [ + "message7757" + ] + }, + { + "key": "key1757", + "messages": [ + "message7758" + ] + }, + { + "key": "key1758", + "messages": [ + "message7759" + ] + }, + { + "key": "key1759", + "messages": [ + "message7760" + ] + }, + { + "key": "key1760", + "messages": [ + "message7761" + ] + }, + { + "key": "key1761", + "messages": [ + "message7762" + ] + }, + { + "key": "key1762", + "messages": [ + "message7763" + ] + }, + { + "key": "key1763", + "messages": [ + "message7764" + ] + }, + { + "key": "key1764", + "messages": [ + "message7765" + ] + }, + { + "key": "key1765", + "messages": [ + "message7766" + ] + }, + { + "key": "key1766", + "messages": [ + "message7767" + ] + }, + { + "key": "key1767", + "messages": [ + "message7768" + ] + }, + { + "key": "key1768", + "messages": [ + "message7769" + ] + }, + { + "key": "key1769", + "messages": [ + "message7770" + ] + }, + { + "key": "key1770", + "messages": [ + "message7771" + ] + }, + { + "key": "key1771", + "messages": [ + "message7772" + ] + }, + { + "key": "key1772", + "messages": [ + "message7773" + ] + }, + { + "key": "key1773", + "messages": [ + "message7774" + ] + }, + { + "key": "key1774", + "messages": [ + "message7775" + ] + }, + { + "key": "key1775", + "messages": [ + "message7776" + ] + }, + { + "key": "key1776", + "messages": [ + "message7777" + ] + }, + { + "key": "key1777", + "messages": [ + "message7778" + ] + }, + { + "key": "key1778", + "messages": [ + "message7779" + ] + }, + { + "key": "key1779", + "messages": [ + "message7780" + ] + }, + { + "key": "key1780", + "messages": [ + "message7781" + ] + }, + { + "key": "key1781", + "messages": [ + "message7782" + ] + }, + { + "key": "key1782", + "messages": [ + "message7783" + ] + }, + { + "key": "key1783", + "messages": [ + "message7784" + ] + }, + { + "key": "key1784", + "messages": [ + "message7785" + ] + }, + { + "key": "key1785", + "messages": [ + "message7786" + ] + }, + { + "key": "key1786", + "messages": [ + "message7787" + ] + }, + { + "key": "key1787", + "messages": [ + "message7788" + ] + }, + { + "key": "key1788", + "messages": [ + "message7789" + ] + }, + { + "key": "key1789", + "messages": [ + "message7790" + ] + }, + { + "key": "key1790", + "messages": [ + "message7791" + ] + }, + { + "key": "key1791", + "messages": [ + "message7792" + ] + }, + { + "key": "key1792", + "messages": [ + "message7793" + ] + }, + { + "key": "key1793", + "messages": [ + "message7794" + ] + }, + { + "key": "key1794", + "messages": [ + "message7795" + ] + }, + { + "key": "key1795", + "messages": [ + "message7796" + ] + }, + { + "key": "key1796", + "messages": [ + "message7797" + ] + }, + { + "key": "key1797", + "messages": [ + "message7798" + ] + }, + { + "key": "key1798", + "messages": [ + "message7799" + ] + }, + { + "key": "key1799", + "messages": [ + "message7800" + ] + }, + { + "key": "key1800", + "messages": [ + "message7801" + ] + }, + { + "key": "key1801", + "messages": [ + "message7802" + ] + }, + { + "key": "key1802", + "messages": [ + "message7803" + ] + }, + { + "key": "key1803", + "messages": [ + "message7804" + ] + }, + { + "key": "key1804", + "messages": [ + "message7805" + ] + }, + { + "key": "key1805", + "messages": [ + "message7806" + ] + }, + { + "key": "key1806", + "messages": [ + "message7807" + ] + }, + { + "key": "key1807", + "messages": [ + "message7808" + ] + }, + { + "key": "key1808", + "messages": [ + "message7809" + ] + }, + { + "key": "key1809", + "messages": [ + "message7810" + ] + }, + { + "key": "key1810", + "messages": [ + "message7811" + ] + }, + { + "key": "key1811", + "messages": [ + "message7812" + ] + }, + { + "key": "key1812", + "messages": [ + "message7813" + ] + }, + { + "key": "key1813", + "messages": [ + "message7814" + ] + }, + { + "key": "key1814", + "messages": [ + "message7815" + ] + }, + { + "key": "key1815", + "messages": [ + "message7816" + ] + }, + { + "key": "key1816", + "messages": [ + "message7817" + ] + }, + { + "key": "key1817", + "messages": [ + "message7818" + ] + }, + { + "key": "key1818", + "messages": [ + "message7819" + ] + }, + { + "key": "key1819", + "messages": [ + "message7820" + ] + }, + { + "key": "key1820", + "messages": [ + "message7821" + ] + }, + { + "key": "key1821", + "messages": [ + "message7822" + ] + }, + { + "key": "key1822", + "messages": [ + "message7823" + ] + }, + { + "key": "key1823", + "messages": [ + "message7824" + ] + }, + { + "key": "key1824", + "messages": [ + "message7825" + ] + }, + { + "key": "key1825", + "messages": [ + "message7826" + ] + }, + { + "key": "key1826", + "messages": [ + "message7827" + ] + }, + { + "key": "key1827", + "messages": [ + "message7828" + ] + }, + { + "key": "key1828", + "messages": [ + "message7829" + ] + }, + { + "key": "key1829", + "messages": [ + "message7830" + ] + }, + { + "key": "key1830", + "messages": [ + "message7831" + ] + }, + { + "key": "key1831", + "messages": [ + "message7832" + ] + }, + { + "key": "key1832", + "messages": [ + "message7833" + ] + }, + { + "key": "key1833", + "messages": [ + "message7834" + ] + }, + { + "key": "key1834", + "messages": [ + "message7835" + ] + }, + { + "key": "key1835", + "messages": [ + "message7836" + ] + }, + { + "key": "key1836", + "messages": [ + "message7837" + ] + }, + { + "key": "key1837", + "messages": [ + "message7838" + ] + }, + { + "key": "key1838", + "messages": [ + "message7839" + ] + }, + { + "key": "key1839", + "messages": [ + "message7840" + ] + }, + { + "key": "key1840", + "messages": [ + "message7841" + ] + }, + { + "key": "key1841", + "messages": [ + "message7842" + ] + }, + { + "key": "key1842", + "messages": [ + "message7843" + ] + }, + { + "key": "key1843", + "messages": [ + "message7844" + ] + }, + { + "key": "key1844", + "messages": [ + "message7845" + ] + }, + { + "key": "key1845", + "messages": [ + "message7846" + ] + }, + { + "key": "key1846", + "messages": [ + "message7847" + ] + }, + { + "key": "key1847", + "messages": [ + "message7848" + ] + }, + { + "key": "key1848", + "messages": [ + "message7849" + ] + }, + { + "key": "key1849", + "messages": [ + "message7850" + ] + }, + { + "key": "key1850", + "messages": [ + "message7851" + ] + }, + { + "key": "key1851", + "messages": [ + "message7852" + ] + }, + { + "key": "key1852", + "messages": [ + "message7853" + ] + }, + { + "key": "key1853", + "messages": [ + "message7854" + ] + }, + { + "key": "key1854", + "messages": [ + "message7855" + ] + }, + { + "key": "key1855", + "messages": [ + "message7856" + ] + }, + { + "key": "key1856", + "messages": [ + "message7857" + ] + }, + { + "key": "key1857", + "messages": [ + "message7858" + ] + }, + { + "key": "key1858", + "messages": [ + "message7859" + ] + }, + { + "key": "key1859", + "messages": [ + "message7860" + ] + }, + { + "key": "key1860", + "messages": [ + "message7861" + ] + }, + { + "key": "key1861", + "messages": [ + "message7862" + ] + }, + { + "key": "key1862", + "messages": [ + "message7863" + ] + }, + { + "key": "key1863", + "messages": [ + "message7864" + ] + }, + { + "key": "key1864", + "messages": [ + "message7865" + ] + }, + { + "key": "key1865", + "messages": [ + "message7866" + ] + }, + { + "key": "key1866", + "messages": [ + "message7867" + ] + }, + { + "key": "key1867", + "messages": [ + "message7868" + ] + }, + { + "key": "key1868", + "messages": [ + "message7869" + ] + }, + { + "key": "key1869", + "messages": [ + "message7870" + ] + }, + { + "key": "key1870", + "messages": [ + "message7871" + ] + }, + { + "key": "key1871", + "messages": [ + "message7872" + ] + }, + { + "key": "key1872", + "messages": [ + "message7873" + ] + }, + { + "key": "key1873", + "messages": [ + "message7874" + ] + }, + { + "key": "key1874", + "messages": [ + "message7875" + ] + }, + { + "key": "key1875", + "messages": [ + "message7876" + ] + }, + { + "key": "key1876", + "messages": [ + "message7877" + ] + }, + { + "key": "key1877", + "messages": [ + "message7878" + ] + }, + { + "key": "key1878", + "messages": [ + "message7879" + ] + }, + { + "key": "key1879", + "messages": [ + "message7880" + ] + }, + { + "key": "key1880", + "messages": [ + "message7881" + ] + }, + { + "key": "key1881", + "messages": [ + "message7882" + ] + }, + { + "key": "key1882", + "messages": [ + "message7883" + ] + }, + { + "key": "key1883", + "messages": [ + "message7884" + ] + }, + { + "key": "key1884", + "messages": [ + "message7885" + ] + }, + { + "key": "key1885", + "messages": [ + "message7886" + ] + }, + { + "key": "key1886", + "messages": [ + "message7887" + ] + }, + { + "key": "key1887", + "messages": [ + "message7888" + ] + }, + { + "key": "key1888", + "messages": [ + "message7889" + ] + }, + { + "key": "key1889", + "messages": [ + "message7890" + ] + }, + { + "key": "key1890", + "messages": [ + "message7891" + ] + }, + { + "key": "key1891", + "messages": [ + "message7892" + ] + }, + { + "key": "key1892", + "messages": [ + "message7893" + ] + }, + { + "key": "key1893", + "messages": [ + "message7894" + ] + }, + { + "key": "key1894", + "messages": [ + "message7895" + ] + }, + { + "key": "key1895", + "messages": [ + "message7896" + ] + }, + { + "key": "key1896", + "messages": [ + "message7897" + ] + }, + { + "key": "key1897", + "messages": [ + "message7898" + ] + }, + { + "key": "key1898", + "messages": [ + "message7899" + ] + }, + { + "key": "key1899", + "messages": [ + "message7900" + ] + }, + { + "key": "key1900", + "messages": [ + "message7901" + ] + }, + { + "key": "key1901", + "messages": [ + "message7902" + ] + }, + { + "key": "key1902", + "messages": [ + "message7903" + ] + }, + { + "key": "key1903", + "messages": [ + "message7904" + ] + }, + { + "key": "key1904", + "messages": [ + "message7905" + ] + }, + { + "key": "key1905", + "messages": [ + "message7906" + ] + }, + { + "key": "key1906", + "messages": [ + "message7907" + ] + }, + { + "key": "key1907", + "messages": [ + "message7908" + ] + }, + { + "key": "key1908", + "messages": [ + "message7909" + ] + }, + { + "key": "key1909", + "messages": [ + "message7910" + ] + }, + { + "key": "key1910", + "messages": [ + "message7911" + ] + }, + { + "key": "key1911", + "messages": [ + "message7912" + ] + }, + { + "key": "key1912", + "messages": [ + "message7913" + ] + }, + { + "key": "key1913", + "messages": [ + "message7914" + ] + }, + { + "key": "key1914", + "messages": [ + "message7915" + ] + }, + { + "key": "key1915", + "messages": [ + "message7916" + ] + }, + { + "key": "key1916", + "messages": [ + "message7917" + ] + }, + { + "key": "key1917", + "messages": [ + "message7918" + ] + }, + { + "key": "key1918", + "messages": [ + "message7919" + ] + }, + { + "key": "key1919", + "messages": [ + "message7920" + ] + }, + { + "key": "key1920", + "messages": [ + "message7921" + ] + }, + { + "key": "key1921", + "messages": [ + "message7922" + ] + }, + { + "key": "key1922", + "messages": [ + "message7923" + ] + }, + { + "key": "key1923", + "messages": [ + "message7924" + ] + }, + { + "key": "key1924", + "messages": [ + "message7925" + ] + }, + { + "key": "key1925", + "messages": [ + "message7926" + ] + }, + { + "key": "key1926", + "messages": [ + "message7927" + ] + }, + { + "key": "key1927", + "messages": [ + "message7928" + ] + }, + { + "key": "key1928", + "messages": [ + "message7929" + ] + }, + { + "key": "key1929", + "messages": [ + "message7930" + ] + }, + { + "key": "key1930", + "messages": [ + "message7931" + ] + }, + { + "key": "key1931", + "messages": [ + "message7932" + ] + }, + { + "key": "key1932", + "messages": [ + "message7933" + ] + }, + { + "key": "key1933", + "messages": [ + "message7934" + ] + }, + { + "key": "key1934", + "messages": [ + "message7935" + ] + }, + { + "key": "key1935", + "messages": [ + "message7936" + ] + }, + { + "key": "key1936", + "messages": [ + "message7937" + ] + }, + { + "key": "key1937", + "messages": [ + "message7938" + ] + }, + { + "key": "key1938", + "messages": [ + "message7939" + ] + }, + { + "key": "key1939", + "messages": [ + "message7940" + ] + }, + { + "key": "key1940", + "messages": [ + "message7941" + ] + }, + { + "key": "key1941", + "messages": [ + "message7942" + ] + }, + { + "key": "key1942", + "messages": [ + "message7943" + ] + }, + { + "key": "key1943", + "messages": [ + "message7944" + ] + }, + { + "key": "key1944", + "messages": [ + "message7945" + ] + }, + { + "key": "key1945", + "messages": [ + "message7946" + ] + }, + { + "key": "key1946", + "messages": [ + "message7947" + ] + }, + { + "key": "key1947", + "messages": [ + "message7948" + ] + }, + { + "key": "key1948", + "messages": [ + "message7949" + ] + }, + { + "key": "key1949", + "messages": [ + "message7950" + ] + }, + { + "key": "key1950", + "messages": [ + "message7951" + ] + }, + { + "key": "key1951", + "messages": [ + "message7952" + ] + }, + { + "key": "key1952", + "messages": [ + "message7953" + ] + }, + { + "key": "key1953", + "messages": [ + "message7954" + ] + }, + { + "key": "key1954", + "messages": [ + "message7955" + ] + }, + { + "key": "key1955", + "messages": [ + "message7956" + ] + }, + { + "key": "key1956", + "messages": [ + "message7957" + ] + }, + { + "key": "key1957", + "messages": [ + "message7958" + ] + }, + { + "key": "key1958", + "messages": [ + "message7959" + ] + }, + { + "key": "key1959", + "messages": [ + "message7960" + ] + }, + { + "key": "key1960", + "messages": [ + "message7961" + ] + }, + { + "key": "key1961", + "messages": [ + "message7962" + ] + }, + { + "key": "key1962", + "messages": [ + "message7963" + ] + }, + { + "key": "key1963", + "messages": [ + "message7964" + ] + }, + { + "key": "key1964", + "messages": [ + "message7965" + ] + }, + { + "key": "key1965", + "messages": [ + "message7966" + ] + }, + { + "key": "key1966", + "messages": [ + "message7967" + ] + }, + { + "key": "key1967", + "messages": [ + "message7968" + ] + }, + { + "key": "key1968", + "messages": [ + "message7969" + ] + }, + { + "key": "key1969", + "messages": [ + "message7970" + ] + }, + { + "key": "key1970", + "messages": [ + "message7971" + ] + }, + { + "key": "key1971", + "messages": [ + "message7972" + ] + }, + { + "key": "key1972", + "messages": [ + "message7973" + ] + }, + { + "key": "key1973", + "messages": [ + "message7974" + ] + }, + { + "key": "key1974", + "messages": [ + "message7975" + ] + }, + { + "key": "key1975", + "messages": [ + "message7976" + ] + }, + { + "key": "key1976", + "messages": [ + "message7977" + ] + }, + { + "key": "key1977", + "messages": [ + "message7978" + ] + }, + { + "key": "key1978", + "messages": [ + "message7979" + ] + }, + { + "key": "key1979", + "messages": [ + "message7980" + ] + }, + { + "key": "key1980", + "messages": [ + "message7981" + ] + }, + { + "key": "key1981", + "messages": [ + "message7982" + ] + }, + { + "key": "key1982", + "messages": [ + "message7983" + ] + }, + { + "key": "key1983", + "messages": [ + "message7984" + ] + }, + { + "key": "key1984", + "messages": [ + "message7985" + ] + }, + { + "key": "key1985", + "messages": [ + "message7986" + ] + }, + { + "key": "key1986", + "messages": [ + "message7987" + ] + }, + { + "key": "key1987", + "messages": [ + "message7988" + ] + }, + { + "key": "key1988", + "messages": [ + "message7989" + ] + }, + { + "key": "key1989", + "messages": [ + "message7990" + ] + }, + { + "key": "key1990", + "messages": [ + "message7991" + ] + }, + { + "key": "key1991", + "messages": [ + "message7992" + ] + }, + { + "key": "key1992", + "messages": [ + "message7993" + ] + }, + { + "key": "key1993", + "messages": [ + "message7994" + ] + }, + { + "key": "key1994", + "messages": [ + "message7995" + ] + }, + { + "key": "key1995", + "messages": [ + "message7996" + ] + }, + { + "key": "key1996", + "messages": [ + "message7997" + ] + }, + { + "key": "key1997", + "messages": [ + "message7998" + ] + }, + { + "key": "key1998", + "messages": [ + "message7999" + ] + }, + { + "key": "key1999", + "messages": [ + "message8000" + ] + } + ] +} diff --git a/handwritten/pubsub/system-test/fixtures/province.json b/handwritten/pubsub/system-test/fixtures/province.json new file mode 100644 index 00000000000..bfca0395c8d --- /dev/null +++ b/handwritten/pubsub/system-test/fixtures/province.json @@ -0,0 +1 @@ +{"name":"Ontario","post_abbr":"ON"} \ No newline at end of file diff --git a/handwritten/pubsub/system-test/fixtures/provinces.avsc b/handwritten/pubsub/system-test/fixtures/provinces.avsc new file mode 100644 index 00000000000..3997e71a88d --- /dev/null +++ b/handwritten/pubsub/system-test/fixtures/provinces.avsc @@ -0,0 +1,18 @@ +{ + "type":"record", + "name":"Province", + "namespace":"utilities", + "doc":"A list of provinces in Canada.", + "fields":[ + { + "name":"name", + "type":"string", + "doc":"The common name of the province." + }, + { + "name":"post_abbr", + "type":"string", + "doc":"The postal code abbreviation of the province." + } + ] +} \ No newline at end of file diff --git a/handwritten/pubsub/system-test/fixtures/sample/package.json b/handwritten/pubsub/system-test/fixtures/sample/package.json new file mode 100644 index 00000000000..fa3e4f326ad --- /dev/null +++ b/handwritten/pubsub/system-test/fixtures/sample/package.json @@ -0,0 +1,23 @@ +{ + "name": "pubsub-sample-fixture", + "description": "An app we're using to test the library.", + "scripts": { + "check": "gts check", + "clean": "gts clean", + "compile": "tsc -p .", + "fix": "gts fix", + "prepare": "npm run compile", + "pretest": "npm run compile", + "posttest": "npm run check", + "start": "node build/src/index.js" + }, + "license": "Apache-2.0", + "dependencies": { + "@google-cloud/pubsub": "file:./pubsub.tgz" + }, + "devDependencies": { + "@types/node": "^24.0.0", + "typescript": "^5.1.6", + "gts": "^7.0.0" + } +} diff --git a/handwritten/pubsub/system-test/fixtures/sample/src/index.ts b/handwritten/pubsub/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..afa3eac5749 --- /dev/null +++ b/handwritten/pubsub/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,8 @@ +import {PubSub} from '@google-cloud/pubsub'; + +async function main() { + const pubsub = new PubSub(); + console.log(pubsub); +} + +main(); diff --git a/handwritten/pubsub/system-test/fixtures/sample/tsconfig.json b/handwritten/pubsub/system-test/fixtures/sample/tsconfig.json new file mode 100644 index 00000000000..ecf766a7216 --- /dev/null +++ b/handwritten/pubsub/system-test/fixtures/sample/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "types": ["node"], + "skipLibCheck": false, + }, + "include": [ + "src/*.ts" + ] +} diff --git a/handwritten/pubsub/system-test/install.ts b/handwritten/pubsub/system-test/install.ts new file mode 100644 index 00000000000..5021ce4d6f8 --- /dev/null +++ b/handwritten/pubsub/system-test/install.ts @@ -0,0 +1,58 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as execa from 'execa'; +import * as mv from 'mv'; +import {ncp} from 'ncp'; +import * as tmp from 'tmp'; +import {promisify} from 'util'; +import {describe, it, after} from 'mocha'; + +const keep = false; +const mvp = promisify(mv) as {} as (...args: string[]) => Promise; +const ncpp = promisify(ncp); +const stagingDir = tmp.dirSync({keep, unsafeCleanup: true}); +const stagingPath = stagingDir.name; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const pkg = require('../../package.json'); + +describe('📦 pack and install', () => { + /** + * Create a staging directory with temp fixtures used to test on a fresh + * application. + */ + it('should be able to use the d.ts', async () => { + await execa('npm', ['pack', '--unsafe-perm']); + const tarball = `google-cloud-pubsub-${pkg.version}.tgz`; + await mvp(tarball, `${stagingPath}/pubsub.tgz`); + await ncpp('system-test/fixtures/sample', `${stagingPath}/`); + await execa('npm', ['install', '--unsafe-perm'], { + cwd: `${stagingPath}/`, + stdio: 'inherit', + }); + await execa('node', ['--throw-deprecation', 'build/src/index.js'], { + cwd: `${stagingPath}/`, + stdio: 'inherit', + }); + }); + + /** + * CLEAN UP - remove the staging directory when done. + */ + after('cleanup staging', () => { + if (!keep) { + stagingDir.removeCallback(); + } + }); +}); diff --git a/handwritten/pubsub/system-test/pubsub.ts b/handwritten/pubsub/system-test/pubsub.ts new file mode 100644 index 00000000000..44aaff74110 --- /dev/null +++ b/handwritten/pubsub/system-test/pubsub.ts @@ -0,0 +1,1135 @@ +// Copyright 2014 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, after} from 'mocha'; +import * as crypto from 'crypto'; +import defer = require('p-defer'); + +import {promises as fs} from 'fs'; + +import { + Message, + PubSub, + ServiceError, + Snapshot, + Subscription, + Topic, + SchemaTypes, + SchemaViews, + ISchema, + Duration, + Schema, + SubscriptionOptions, +} from '../src'; +import {MessageOptions} from '../src/topic'; +import {TestResources} from '../test/testResources'; +import {GoogleError} from 'google-gax'; + +const pubsub = new PubSub(); + +interface UsedTopic { + name: string; + fullName: string; + topic: Topic; +} + +interface UsedSub { + name: string; + fullName: string; + sub: Subscription; +} + +describe('pubsub', () => { + const resources = new TestResources('ps-sys'); + + async function generateTopic(test: string): Promise { + const name = resources.generateName(test); + const [topic] = await pubsub.topic(name).get({autoCreate: true}); + const fullName = topic.name; + return {name, topic, fullName}; + } + + async function generateSub(test: string, topicName: string, opts: SubscriptionOptions = {}): Promise { + const name = resources.generateName(test); + const sub = pubsub.topic(topicName).subscription(name, opts); + await sub.create(); + const fullName = sub.name; + return {name, sub, fullName}; + } + + function generateSnapshotName(test: string) { + return resources.generateName(`ss-${test}`); + } + + function generateSubName(test: string) { + return resources.generateName(`sub-${test}`); + } + + function generateSchemaName(test: string) { + return resources.generateName(`sch-${test}`); + } + + function generateTopicName(test: string) { + return resources.generateName(`top-${test}`); + } + + async function deleteTestResources(): Promise { + const [subs] = await pubsub.getSubscriptions(); + const [topics] = await pubsub.getTopics(); + const [snaps] = await pubsub.getSnapshots(); + + // Close out schemas first, since other things may be + // depending on them. + const schemas: Schema[] = []; + for await (const s of pubsub.listSchemas()) { + schemas.push(pubsub.schema(s.name!)); + } + await Promise.all( + resources.filterForCleanup(schemas).map(x => x.delete?.()) + ); + + // Snapshots. + await Promise.all( + resources.filterForCleanup(snaps).map(x => x.delete?.()) + ) + + // Subscriptions next. + await Promise.all( + resources.filterForCleanup(subs).map(x => x.delete?.()) + ); + + // Finally topics. + await Promise.all( + resources.filterForCleanup(topics).map(x => x.delete?.()) + ); + } + + async function publishPop(test: string, message: MessageOptions) { + const topic = await generateTopic(test); + const sub = await generateSub(test, topic.name); + for (let i = 0; i < 6; i++) { + await topic.topic.publishMessage(message); + } + return new Promise((resolve, reject) => { + sub.sub.on('error', reject); + sub.sub.once('message', resolve); + }); + } + + before(async () => { + await deleteTestResources(); + }); + + after(() => { + return deleteTestResources(); + }); + + describe('Topic', () => { + it('should be listed', async () => { + const testTopics = [ + await generateTopic('should-list'), + await generateTopic('should-list'), + ]; + const [topics] = await pubsub.getTopics(); + const results = topics.filter(topic => { + return testTopics.findIndex(t => t.fullName === topic.name) >= 0; + }); + assert.strictEqual(results.length, testTopics.length); + }); + + it('should list topics in a stream', async () => { + const testTopics = [ + await generateTopic('stream-list'), + await generateTopic('stream-list'), + ]; + const topicsEmitted = new Array(); + await new Promise((res, rej) => { + pubsub + .getTopicsStream() + .on('error', rej) + .on('data', (topic: Topic) => { + topicsEmitted.push(topic); + }) + .on('end', () => { + const results = topicsEmitted.filter(topic => { + return testTopics.findIndex(t => t.fullName === topic.name) >= 0; + }); + + assert.strictEqual(results.length, testTopics.length); + res(); + }); + }); + }); + + it('should allow manual paging', async () => { + const testTopics = [ + await generateTopic('man-page'), + await generateTopic('man-page'), + ]; + const [topics] = await pubsub.getTopics({ + pageSize: 1, + gaxOpts: {autoPaginate: false}, + }); + assert.strictEqual(topics.length, 1); + }); + + it('should be created and deleted', async () => { + const testTopic = await generateTopic('c-and-d'); + await testTopic.topic.delete(); + }); + + it('should honor the autoCreate option', done => { + const topic = pubsub.topic(generateTopicName('auto')); + + topic.get({autoCreate: true}, done); + }); + + it('should confirm if a topic exists', async () => { + const testTopic = await generateTopic('c-e'); + const topic = pubsub.topic(testTopic.name); + + const [exists] = await topic.exists(); + assert.strictEqual(exists, true); + }); + + it('should confirm if a topic does not exist', done => { + const topic = pubsub.topic('should-not-exist'); + + topic.exists( + (err: Error | null | undefined, exists: boolean | null | undefined) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + } + ); + }); + + it('should publish a message', async () => { + const testTopic = await generateTopic('pub-msg'); + const topic = testTopic.topic; + const message = { + data: Buffer.from('message from me'), + orderingKey: 'a', + }; + + const result = await topic.publishMessage(message); + }); + + it('should publish a message with attributes', async () => { + const data = Buffer.from('raw message data'); + const attributes = { + customAttribute: 'value', + }; + const message = await publishPop('pub-attr', {data, attributes}); + assert.deepStrictEqual(message.data, data); + assert.deepStrictEqual(message.attributes, attributes); + }); + + it('should get the metadata of a topic', async () => { + const testTopic = await generateTopic('md-topic'); + const topic = testTopic.topic; + const [meta] = await topic.getMetadata(); + assert.strictEqual(meta.name, topic.name); + }); + + it('should set metadata for a topic', async () => { + const threeDaysInSeconds = 3 * 24 * 60 * 60; + const testTopic = await generateTopic('md-set'); + + const topic = testTopic.topic; + await topic.setMetadata({ + messageRetentionDuration: { + seconds: threeDaysInSeconds, + }, + }); + const [metadata] = await topic.getMetadata(); + const {seconds, nanos} = metadata.messageRetentionDuration!; + + assert.strictEqual(Number(seconds), threeDaysInSeconds); + assert.strictEqual(Number(nanos), 0); + }); + + describe('ordered messages', () => { + interface Expected { + key: string; + messages: string[]; + } + + interface Input { + key: string; + message: string; + } + + interface Pending { + [key: string]: string[]; + } + + it('should pass the acceptance tests', async () => { + const testTopic = await generateTopic('ordered'); + const topic = testTopic.topic; + const [subscription] = await topic.createSubscription( + generateSubName('ordered'), + { + enableMessageOrdering: true, + } + ); + const { + input, + expected, + // eslint-disable-next-line @typescript-eslint/no-var-requires + } = require('../../system-test/fixtures/ordered-messages.json'); + + const pending: Pending = {}; + + expected.forEach(({key, messages}: Expected) => { + pending[key] = messages; + }); + + const deferred = defer(); + + // Make sure we're listening when the lease manager throws the messages at us. + subscription + .on('error', deferred.reject) + .on('message', (message: Message) => { + const key = message.orderingKey || ''; + const data = message.data.toString(); + const messages = pending[key]; + + if (!messages) { + deferred.reject( + new Error( + `Unknown key "${key}" for test data: ${JSON.stringify( + pending, + null, + 4 + )}` + ) + ); + subscription.close(); + return; + } + + const expected = messages[0]; + + if (key && data !== expected) { + deferred.reject( + new Error( + `Expected "${expected}" but received "${data}" for key "${key}"` + ) + ); + subscription.close(); + return; + } + + message.ack(); + messages.splice(messages.indexOf(data), 1); + + if (!pending[key].length) delete pending[key]; + if (!Object.keys(pending).length) { + deferred.resolve(); + } + }); + + const publishes = input.map(({key, message}: Input) => { + const options: MessageOptions = { + data: Buffer.from(message), + }; + + if (key) { + options.orderingKey = key; + } + + return topic.publishMessage(options); + }); + await Promise.all(publishes); + + await deferred.promise; + }); + }); + }); + + describe('Subscription', () => { + async function subPop(testName: string, count: number) { + const testTopic = await generateTopic(testName); + const topic = testTopic.topic; + + const testSubProms: Promise[] = []; + for (let i = 0; i < count; i++) { + testSubProms.push(generateSub(testName, testTopic.name, { + minAckDeadline: Duration.from({seconds: 60}), + maxAckDeadline: Duration.from({seconds: 60}), + })); + } + const testSubs = await Promise.all(testSubProms); + const subs = testSubs.map(t => t.sub); + for (let i = 0; i < 10; i++) { + const data = Buffer.from('hello'); + await topic.publishMessage({data}); + } + await new Promise(r => setTimeout(r, 2500)); + + return { + testTopic, + topic, + testSubs, + subs, + }; + } + + it('should return error if creating an existing subscription', async () => { + // Use a new topic... + const topic = await generateTopic('sub-dup'); + + // And make a sub... + const existing = await generateSub('sub-dup', topic.name); + + // ...another but with the same subscription name that we already created... + const subscription = topic.topic.subscription(existing.name); + + try { + await subscription.create(); + assert.fail('Should not have created subscription successfully.'); + } catch (e) { + // ...and it should fail, because the subscription name is unique to the + // project, and not the topic. + const err = e as GoogleError; + assert.strictEqual(err!.code, 6); + } + }); + + it('should list all subscriptions registered to the topic', async () => { + const pop = await subPop('list-subs', 2); + const [subs] = await pop.topic.getSubscriptions(); + assert.strictEqual(subs!.length, 2); + assert(subs![0] instanceof Subscription); + }); + + it('should list all topic subscriptions as a stream', async () => { + const pop = await subPop('list-subs', 2); + + await new Promise((res, rej) => { + const subscriptionsEmitted: Array<{}> = []; + pop.topic + .getSubscriptionsStream() + .on('error', rej) + .on('data', (subscription: {}) => { + subscriptionsEmitted.push(subscription); + }) + .on('end', () => { + assert.strictEqual(subscriptionsEmitted.length, 2); + res(); + }); + }); + }); + + it('should list all subscriptions regardless of topic', async () => { + // Make sure there are some subs. + await subPop('all-subs', 1); + + const [results] = await pubsub.getSubscriptions(); + assert(results instanceof Array); + }); + + it('should list all subscriptions as a stream', async () => { + // Make sure there are some subs. + await subPop('all-subs', 1); + + await new Promise((res, rej) => { + let subscriptionEmitted = false; + + pubsub + .getSubscriptionsStream() + .on('error', rej) + .on('data', (subscription: Subscription) => { + subscriptionEmitted = subscription instanceof Subscription; + }) + .on('end', () => { + assert.strictEqual(subscriptionEmitted, true); + res(); + }); + }); + }); + + it('should allow creation and deletion of a subscription', async () => { + const testTopic = await generateTopic('c-d-sub'); + const subName = generateSubName('c-d-sub'); + const [sub] = await testTopic.topic.createSubscription(subName); + assert(sub instanceof Subscription); + await sub.delete(); + }); + + it('should honor the autoCreate option', async () => { + const testTopic = await generateTopic('auto-c'); + const sub = testTopic.topic.subscription(generateSubName('auto-c')); + + await sub.get({autoCreate: true}); + }); + + it('should confirm if a sub exists', async () => { + const testTopic = await generateTopic('exists'); + const testSub = await generateSub('exists', testTopic.name); + const sub = testSub.sub; + + const [exists] = await sub.exists(); + assert.strictEqual(exists, true); + }); + + it('should confirm if a sub does not exist', async () => { + const testTopic = await generateTopic('dne'); + const sub = testTopic.topic.subscription('should-not-exist'); + + const [exists] = await sub.exists(); + assert.strictEqual(exists, false); + }); + + it('should create a subscription with message retention', async () => { + const subName = generateSubName('sub-ret'); + const threeDaysInSeconds = 3 * 24 * 60 * 60; + const callOptions = { + messageRetentionDuration: threeDaysInSeconds, + topic: '', + name: '', + }; + + const testTopic = await generateTopic('msg-ret'); + const [sub] = await testTopic.topic.createSubscription(subName, callOptions); + const [metadata] = await sub.getMetadata(); + assert.strictEqual( + Number(metadata!.messageRetentionDuration!.seconds), + threeDaysInSeconds + ); + assert.strictEqual( + Number(metadata!.messageRetentionDuration!.nanos), + 0 + ); + }); + + it('should set metadata for a subscription', async () => { + const testTopic = await generateTopic('met-sub'); + const subscription = testTopic.topic.subscription(generateSubName('met-sub')); + const threeDaysInSeconds = 3 * 24 * 60 * 60; + + await subscription.create(); + await subscription.setMetadata({ + messageRetentionDuration: threeDaysInSeconds, + }); + const [metadata] = await subscription.getMetadata(); + const {seconds, nanos} = metadata.messageRetentionDuration!; + + assert.strictEqual(Number(seconds), threeDaysInSeconds); + assert.strictEqual(Number(nanos), 0); + }); + + it('should error when using a non-existent subscription', async () => { + const testTopic = await generateTopic('dne-sub'); + const subscription = testTopic.topic.subscription(generateSubName('dne-sub')); + + await new Promise((res, rej) => { + subscription.on('error', (err: {code: number}) => { + assert.strictEqual(err.code, 5); + subscription.close(res); + }); + + subscription.on('message', () => { + rej(new Error('Should not have been called.')); + }); + }); + }); + + it('should receive the published messages', async () => { + const pop = await subPop('recv', 1); + let messageCount = 0; + const subscription = pop.subs[0]; + + await new Promise((res, rej) => { + subscription.on('error', rej); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + subscription.on('message', message => { + assert.deepStrictEqual(message.data, Buffer.from('hello')); + message.ack(); + + if (++messageCount === 10) { + subscription.close(res); + } + }); + }); + }); + + it('should ack the message', async () => { + const pop = await subPop('ack', 1); + const subscription = pop.subs[0]; + + await new Promise((res, rej) => { + let finished = false; + subscription.on('error', () => { + if (!finished) { + finished = true; + subscription.close(rej); + } + }); + subscription.on('message', ack); + + function ack(message: Message) { + if (!finished) { + finished = true; + message.ack(); + subscription.close(res); + } + } + }); + }); + + it('should nack the message', async () => { + const pop = await subPop('nack', 1); + const subscription = pop.subs[0]; + + await new Promise((res, rej) => { + let finished = false; + subscription.on('error', () => { + if (!finished) { + finished = true; + subscription.close(rej); + } + }); + subscription.on('message', nack); + + function nack(message: Message) { + if (!finished) { + finished = true; + message.nack(); + subscription.close(res); + } + } + }); + }); + + it('should respect flow control limits', async () => { + const maxMessages = 3; + let messageCount = 0; + + const pop = await subPop('fcl', 1); + const subscription = pop.topic.subscription(pop.testSubs[0].name, { + flowControl: {maxMessages, allowExcessMessages: false}, + }); + + await new Promise((res, rej) => { + subscription.on('error', rej); + subscription.on('message', onMessage); + + function onMessage() { + if (++messageCount < maxMessages) { + return; + } + + subscription.close(res); + } + }); + }); + + it('should send and receive large messages', async () => { + const pop = await subPop('large', 1); + const subscription = pop.subs[0]; + const data = crypto.randomBytes(9000000); // 9mb + + const messageId = await pop.topic.publishMessage({data}); + await new Promise((res, rej) => { + subscription.on('error', rej).on('message', (message: Message) => { + if (message.id !== messageId) { + return; + } + + assert.deepStrictEqual(data, message.data); + subscription.close(res); + }); + }); + }); + + it('should detach subscriptions', async () => { + const pop = await subPop('detach', 1); + const subscription = pop.subs[0]; + const [before] = await subscription.detached(); + assert.strictEqual(before, false); + await pubsub.detachSubscription(subscription.name); + const [after] = await subscription.detached(); + assert.strictEqual(after, true); + }); + + // can be ran manually to test options/memory usage/etc. + it.skip('should handle a large volume of messages', async function () { + const MESSAGES = 200000; + + const deferred = defer(); + const messages = new Set(); + + let duplicates = 0; + + this.timeout(0); + + const pop = await subPop('many', 1); + const topic = pop.topic; + const subscription = pop.subs[0]; + + topic.setPublishOptions({batching: {maxMessages: 999}}); + await publish(MESSAGES); + + const startTime = Date.now(); + subscription.on('error', deferred.reject).on('message', onmessage); + + return deferred.promise; + + function onmessage(message: Message) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const testid = (message.attributes as any).testid; + + if (!testid) { + return; + } + + message.ack(); + + if (messages.has(testid)) { + messages.delete(testid); + } else { + duplicates += 1; + } + + if (messages.size > 0) { + return; + } + + const total = MESSAGES + duplicates; + const duration = (Date.now() - startTime) / 1000 / 60; + const acksPerMin = Math.floor(total / duration); + + console.log(`${total} messages processed.`); + console.log(`${duplicates} messages redelivered.`); + console.log(`${acksPerMin} acks/m on average.`); + + subscription.close((err: unknown) => { + if (err) { + deferred.reject(err); + } else { + deferred.resolve(); + } + }); + } + + function publish(messageCount: number) { + const data = Buffer.from('Hello, world!'); + const promises: Array> = []; + + let id = 0; + + for (let i = 0; i < messageCount; i++) { + const testid = String(++id); + const attributes = {testid}; + messages.add(testid); + promises.push(topic.publishMessage({data, attributes})); + } + + return Promise.all(promises); + } + }); + }); + + describe('IAM', () => { + it('should get a policy', async () => { + const testTopic = await generateTopic('get-pol'); + const topic = testTopic.topic; + + const [policy] = await topic.iam.getPolicy(); + assert.deepStrictEqual(policy!.bindings, []); + assert.strictEqual(policy!.version, 0); + }); + + it('should set a policy', async () => { + const testTopic = await generateTopic('set-pol'); + const topic = testTopic.topic; + const policy = { + bindings: [ + { + role: 'roles/pubsub.publisher', + members: [ + 'serviceAccount:gmail-api-push@system.gserviceaccount.com', + ], + }, + ], + }; + + const [newPolicy] = await topic.iam.setPolicy(policy); + const expectedBindings = policy.bindings.map(binding => + Object.assign({condition: null}, binding) + ); + assert.deepStrictEqual(newPolicy!.bindings, expectedBindings); + }); + + it('should test the iam permissions', async () => { + const testTopic = await generateTopic('set-pol'); + const topic = testTopic.topic; + const testPermissions = ['pubsub.topics.get', 'pubsub.topics.update']; + + const [permissions] = await topic.iam.testPermissions(testPermissions); + assert.deepStrictEqual(permissions, { + 'pubsub.topics.get': true, + 'pubsub.topics.update': true, + }); + }); + }); + + describe('Snapshot', () => { + async function snapshotPop(test: string) { + const topic: Topic = (await generateTopic('snap')).topic; + const subscription: Subscription = (await generateSub('snap', topic.name)).sub; + const snapshotId: string = generateSnapshotName('snap'); + const snapshot: Snapshot = subscription.snapshot(snapshotId); + + await snapshot.create(); + + return { + topic, + subscription, + snapshotId, + snapshot, + }; + } + + + function getSnapshotName({name}: {name: string}) { + return name.split('/').pop(); + } + + before(async () => { + await deleteTestResources(); + }); + + after(async () => { + await deleteTestResources(); + }); + + it('should get a list of snapshots', async () => { + const pop = await snapshotPop('list'); + const [snapshots] = await pubsub.getSnapshots(); + assert(snapshots!.length > 0); + const names = snapshots!.map(getSnapshotName); + assert(names.includes(pop.snapshotId)); + }); + + it('should get a list of snapshots as a stream', async () => { + const pop = await snapshotPop('list-s'); + const snapshots = await new Promise((res, rej) => { + const snaps = new Array(); + pubsub + .getSnapshotsStream() + .on('error', rej) + .on('data', (snapshot: Snapshot) => snaps.push(snapshot)) + .on('end', () => { + res(snaps); + }); + }); + assert(snapshots.length > 0); + const names = snapshots.map(getSnapshotName); + assert(names.includes(pop.snapshotId)); + }); + + describe('seeking', () => { + async function seekPop(test: string) { + const pop = await snapshotPop(test); + const errorPromise = new Promise((_, reject) => + pop.subscription.on('error', reject) + ); + + return { + errorPromise, + ...pop, + }; + } + + // This creates a Promise that hooks the 'message' callback of the + // subscription above, and resolves when that callback calls `resolve`. + type WorkCallback = (arg: Message, resolve: Function) => void; + function makeMessagePromise(subscription: Subscription, workCallback: WorkCallback): Promise { + return new Promise(resolve => { + subscription.on('message', (arg: Message) => { + workCallback(arg, resolve); + }); + }); + } + + async function publishTestMessage(topic: Topic) { + return await topic.publishMessage({data: Buffer.from('Hello, world!')}); + } + + it('should seek to a snapshot', async () => { + const pop = await seekPop('sn-seek'); + let messageCount = 0; + + type EventParameter = {id: string; ack: () => void}; + let messageId: string; + const messagePromise = makeMessagePromise( + pop.subscription, + async (message: EventParameter, resolve) => { + if (message.id !== messageId) { + return; + } + message.ack(); + + if (++messageCount === 1) { + await pop.snapshot.seek(); + return; + } + + assert.strictEqual(messageCount, 2); + await pop.subscription.close(); + + resolve(); + } + ); + + messageId = await publishTestMessage(pop.topic); + await Promise.race([pop.errorPromise, messagePromise]); + }); + + it('should seek to a date', async () => { + const pop = await seekPop('sn-seek-date'); + let messageCount = 0; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + type EventParameter = {id: string; ack: () => void; publishTime: any}; + let messageId: string; + const messagePromise = makeMessagePromise( + pop.subscription, + async (message: EventParameter, resolve) => { + if (message.id !== messageId) { + return; + } + + message.ack(); + + if (++messageCount === 1) { + pop.subscription.seek( + message.publishTime, + (err: ServiceError | null) => { + assert.ifError(err); + } + ); + return; + } + + assert.strictEqual(messageCount, 2); + await pop.subscription.close(); + + resolve(); + } + ); + + messageId = await publishTestMessage(pop.topic); + await Promise.race([pop.errorPromise, messagePromise]); + }); + + it('should seek to a future date (purge)', async () => { + const pop = await seekPop('sn-purge'); + const testText = 'Oh no!'; + + await publishTestMessage(pop.topic); + + // Forward-seek to remove any messages from the queue (those were + // placed there in before()). + // + // We... probably won't be using this in 3000? + await pop.subscription.seek(new Date('3000-01-01')); + + // Drop a second message and make sure it's the right ID. + await pop.topic.publishMessage({data: Buffer.from(testText)}); + + type EventParameter = {data: {toString: () => string}; ack: () => void}; + const messagePromise = makeMessagePromise( + pop.subscription, + async (message: EventParameter, resolve) => { + // If we get the default message from before() then this fails. + assert.equal(message.data.toString(), testText); + message.ack(); + await pop.subscription.close(); + + resolve(); + } + ); + + await Promise.race([pop.errorPromise, messagePromise]); + }); + }); + }); + + describe('schema', () => { + // This should really be handled by a standard method of Array(), imo, but it's not. + async function aiToArray( + iterator: AsyncIterable, + nameFilter?: string + ): Promise { + const result = [] as ISchema[]; + for await (const i of iterator) { + if (!nameFilter || (nameFilter && i.name?.endsWith(nameFilter))) { + result.push(i); + } + } + + return result; + } + + const getSchemaDef = async () => { + const schemaDef = ( + await fs.readFile('system-test/fixtures/provinces.avsc') + ).toString(); + + return schemaDef; + }; + + const setupTestSchema = async (test: string) => { + const schemaDef = await getSchemaDef(); + const schemaId = generateSchemaName(test); + await pubsub.createSchema(schemaId, SchemaTypes.Avro, schemaDef); + return schemaId; + }; + + it('should create a schema', async () => { + const schemaId = await setupTestSchema('sc-create'); + const schemaList = await aiToArray(pubsub.listSchemas(), schemaId); + assert.strictEqual(schemaList.length, 1); + }); + + it('should delete a schema', async () => { + const schemaId = await setupTestSchema('sc-del'); + + // Validate that we created one, because delete() doesn't throw, and we + // might end up causing a false negative. + const preSchemaList = await aiToArray(pubsub.listSchemas(), schemaId); + assert.strictEqual(preSchemaList.length, 1); + + await pubsub.schema(schemaId).delete(); + + const postSchemaList = await aiToArray(pubsub.listSchemas(), schemaId); + assert.strictEqual(postSchemaList.length, 0); + }); + + it('should list schemas', async () => { + const schemaId = await setupTestSchema('sc-list'); + + const basicList = await aiToArray( + pubsub.listSchemas(SchemaViews.Basic), + schemaId + ); + assert.strictEqual(basicList.length, 1); + assert.strictEqual(basicList[0].definition, ''); + + const fullList = await aiToArray( + pubsub.listSchemas(SchemaViews.Full), + schemaId + ); + assert.strictEqual(fullList.length, 1); + assert.ok(fullList[0].definition); + }); + + it('should get a schema', async () => { + const schemaId = await setupTestSchema('sc-get'); + const schema = pubsub.schema(schemaId); + const info = await schema.get(SchemaViews.Basic); + assert.strictEqual(info.definition, ''); + + const fullInfo = await schema.get(SchemaViews.Full); + assert.ok(fullInfo.definition); + }); + + it('should validate a schema', async () => { + const schemaDef = await getSchemaDef(); + + try { + await pubsub.validateSchema({ + type: SchemaTypes.Avro, + definition: schemaDef, + }); + } catch (e) { + assert.strictEqual(e, undefined, 'Error thrown by validateSchema'); + } + + const badSchemaDef = '{"not_actually":"avro"}'; + try { + await pubsub.validateSchema({ + type: SchemaTypes.Avro, + definition: badSchemaDef, + }); + } catch (e) { + assert.ok(e); + } + + const fakeSchemaDef = 'woohoo i am a schema, no really'; + + try { + await pubsub.validateSchema({ + type: SchemaTypes.Avro, + definition: fakeSchemaDef, + }); + } catch (e) { + assert.ok(e); + } + }); + + // The server doesn't seem to be returning proper responses for this. + // Commenting out for now, until it can be discussed. + // TODO(feywind): Uncomment this later. May be solved by b/188927641. + /* it('should validate a message', async () => { + const schemaId = await setupTestSchema(); + const schema = pubsub.schema(schemaId); + const testMessage = ( + await fs.readFile('system-test/fixtures/province.json') + ).toString(); + + try { + await schema.validateMessage(testMessage, Encodings.Json); + } catch (e) { + console.log(e, e.message, e.toString()); + assert.strictEqual(e, undefined, 'Error thrown by validateSchema'); + } + + const badMessage = '{"foo":"bar"}'; + + try { + await schema.validateMessage(badMessage, Encodings.Json); + } catch (e) { + assert.ok(e); + } + + const fakeMessage = 'woohoo i am a message, no really'; + + try { + await schema.validateMessage(fakeMessage, Encodings.Json); + } catch (e) { + assert.ok(e); + } + }); */ + }); + + it('should allow closing of publisher clients', async () => { + // The full call stack of close() is tested in unit tests; this is mostly + // to verify that the close() method is actually there and doesn't error. + const localPubsub = new PubSub(); + + // Just use the client object to make sure it has opened a connection. + await pubsub.getTopics(); + + // Tell it to close, and validate that it's marked closed. + await localPubsub.close(); + assert.strictEqual(localPubsub.isOpen, false); + }); +}); diff --git a/handwritten/pubsub/test/ack-metadata.ts b/handwritten/pubsub/test/ack-metadata.ts new file mode 100644 index 00000000000..1b01faf33e8 --- /dev/null +++ b/handwritten/pubsub/test/ack-metadata.ts @@ -0,0 +1,225 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {describe, it} from 'mocha'; +import * as assert from 'assert'; +import { + AckErrorInfo, + processAckErrorInfo, + processAckRpcError, +} from '../src/ack-metadata'; +import {GoogleError, Status} from 'google-gax'; +import {AckResponses} from '../src/subscriber'; + +describe('ack-metadata', () => { + it('deals with no ErrorInfo', () => { + const error = {} as GoogleError; + const results = processAckErrorInfo(error); + assert.strictEqual(results.size, 0); + }); + + it('handles permanent errors', () => { + const ackId = '12345'; + const errorCode = 'PERMANENT_FAILURE_INVALID_ACK_ID'; + const error = { + errorInfoMetadata: { + [ackId]: errorCode, + }, + } as unknown as GoogleError; + + const results = processAckErrorInfo(error); + + assert.deepStrictEqual(Array.from(results.entries()), [ + [ + ackId, + { + transient: false, + response: AckResponses.Invalid, + rawErrorCode: errorCode, + }, + ], + ]); + }); + + it('handles transient errors', () => { + const ackId = '12345'; + const errorCode = 'TRANSIENT_FAILURE_ESPRESSO_BAR_CLOSED'; + const error = { + errorInfoMetadata: { + [ackId]: errorCode, + }, + } as unknown as GoogleError; + + const results = processAckErrorInfo(error); + + assert.deepStrictEqual(Array.from(results.entries()), [ + [ + ackId, + { + transient: true, + rawErrorCode: errorCode, + }, + ], + ]); + }); + + it('handles other errors', () => { + const ackId = '12345'; + const errorCode = 'NO_IDEA_ERROR'; + const error = { + errorInfoMetadata: { + [ackId]: errorCode, + }, + } as unknown as GoogleError; + + const results = processAckErrorInfo(error); + + assert.deepStrictEqual(Array.from(results.entries()), [ + [ + ackId, + { + transient: false, + response: AckResponses.Other, + rawErrorCode: errorCode, + }, + ], + ]); + }); + + it('handles multiple responses', () => { + const ackIds = ['12345', '23456', '34567']; + const errorCodes = [ + 'PERMANENT_FAILURE_INVALID_ACK_ID', + 'TRANSIENT_FAILURE_ESPRESSO_BAR_CLOSED', + 'NO_IDEA_ERROR', + ]; + const expectedResults = new Map([ + [ + ackIds[0], + { + transient: false, + response: AckResponses.Invalid, + rawErrorCode: errorCodes[0], + }, + ], + [ + ackIds[1], + { + transient: true, + rawErrorCode: errorCodes[1], + }, + ], + [ + ackIds[2], + { + transient: false, + response: AckResponses.Other, + rawErrorCode: errorCodes[2], + }, + ], + ]); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const metaData: any = {}; + for (let i = 0; i < ackIds.length; i++) { + metaData[ackIds[i]] = errorCodes[i]; + } + + const error = { + errorInfoMetadata: metaData, + } as unknown as GoogleError; + + const results = processAckErrorInfo(error); + + ackIds.forEach(id => { + const ackError = results.get(id); + const expected = expectedResults.get(id); + assert.deepStrictEqual(ackError, expected); + }); + }); + + it('handles gRPC errors', () => { + const testTable = [ + { + code: Status.DEADLINE_EXCEEDED, + result: { + transient: true, + grpcErrorCode: Status.DEADLINE_EXCEEDED, + response: AckResponses.Other, + }, + }, + { + code: Status.RESOURCE_EXHAUSTED, + result: { + transient: true, + grpcErrorCode: Status.RESOURCE_EXHAUSTED, + response: AckResponses.Other, + }, + }, + { + code: Status.ABORTED, + result: { + transient: true, + grpcErrorCode: Status.ABORTED, + response: AckResponses.Other, + }, + }, + { + code: Status.INTERNAL, + result: { + transient: true, + grpcErrorCode: Status.INTERNAL, + response: AckResponses.Other, + }, + }, + { + code: Status.UNAVAILABLE, + result: { + transient: true, + grpcErrorCode: Status.UNAVAILABLE, + response: AckResponses.Other, + }, + }, + { + code: Status.PERMISSION_DENIED, + result: { + transient: false, + grpcErrorCode: Status.PERMISSION_DENIED, + response: AckResponses.PermissionDenied, + }, + }, + { + code: Status.FAILED_PRECONDITION, + result: { + transient: false, + grpcErrorCode: Status.FAILED_PRECONDITION, + response: AckResponses.FailedPrecondition, + }, + }, + { + code: Status.UNIMPLEMENTED, + result: { + transient: false, + grpcErrorCode: Status.UNIMPLEMENTED, + response: AckResponses.Other, + }, + }, + ]; + + for (const t of testTable) { + const result = processAckRpcError(t.code); + assert.deepStrictEqual(result, t.result); + } + }); +}); diff --git a/handwritten/pubsub/test/exponential-retry.ts b/handwritten/pubsub/test/exponential-retry.ts new file mode 100644 index 00000000000..5a36bd04d5f --- /dev/null +++ b/handwritten/pubsub/test/exponential-retry.ts @@ -0,0 +1,234 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {describe, it} from 'mocha'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; + +import {ExponentialRetry} from '../src/exponential-retry'; +import {Duration} from '../src/temporal'; +import {TestUtils} from './test-utils'; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function introspect(obj: unknown): any { + return obj; +} + +interface TestItem { + foo: string; +} + +function makeItem() { + return { + foo: 'an item', + }; +} + +describe('exponential retry class', () => { + const sandbox = sinon.createSandbox(); + afterEach(() => sandbox.restore()); + + it('initializes correctly', () => { + // This one is honestly not terribly interesting except that the + // class is storing the durations as numbers internally. + const er = new ExponentialRetry( + Duration.from({seconds: 1}), + Duration.from({seconds: 2}), + ); + + const eri = introspect(er); + assert.strictEqual(eri._backoffMs, 1000); + assert.strictEqual(eri._maxBackoffMs, 2000); + }); + + it('makes the first callback', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const er = new ExponentialRetry( + Duration.from({milliseconds: 100}), + Duration.from({milliseconds: 1000}), + ); + sandbox.stub(global.Math, 'random').returns(0.75); + + const item = makeItem(); + let retried = false; + er.retryLater(item, (s: typeof item, t: Duration) => { + assert.strictEqual(s, item); + assert.strictEqual(t.milliseconds, 125); + retried = true; + }); + + clock.tick(125); + + const leftovers = er.close(); + assert.strictEqual(retried, true); + assert.strictEqual(leftovers.length, 0); + }); + + it('closes gracefully', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const er = new ExponentialRetry( + Duration.from({milliseconds: 100}), + Duration.from({milliseconds: 1000}), + ); + sandbox.stub(global.Math, 'random').returns(0.75); + + let called = false; + const item = makeItem(); + er.retryLater(item, (s: typeof item, t: Duration) => { + assert.strictEqual(s, item); + assert.strictEqual(t.milliseconds, 125); + called = true; + }); + + clock.tick(5); + + const leftovers = er.close(); + + clock.tick(125); + + assert.strictEqual(called, false); + + const eri = introspect(er); + assert.strictEqual(eri._items.isEmpty(), true); + + assert.strictEqual(leftovers.length, 1); + }); + + it('backs off exponentially', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const er = new ExponentialRetry( + Duration.from({milliseconds: 100}), + Duration.from({milliseconds: 1000}), + ); + sandbox.stub(global.Math, 'random').returns(0.75); + + let callbackCount = 0; + let callbackTime: Duration = Duration.from({milliseconds: 0}); + + const item = makeItem(); + const callback = (s: TestItem, t: Duration) => { + assert.strictEqual(s, item); + callbackTime = t; + callbackCount++; + if (callbackCount === 1) { + er.retryLater(item, callback); + } + }; + er.retryLater(item, callback); + + clock.tick(125); + assert.strictEqual(callbackCount, 1); + assert.strictEqual(callbackTime.milliseconds, 125); + + clock.tick(400); + assert.strictEqual(callbackCount, 2); + assert.strictEqual(callbackTime.milliseconds, 375); + + const leftovers = er.close(); + assert.strictEqual(leftovers.length, 0); + }); + + it('backs off exponentially until the max backoff', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const item = makeItem(); + const er = new ExponentialRetry( + Duration.from({milliseconds: 100}), + Duration.from({milliseconds: 150}), + ); + sandbox.stub(global.Math, 'random').returns(0.75); + + let callbackCount = 0; + let callbackTime: Duration = Duration.from({milliseconds: 0}); + + const callback = (s: TestItem, t: Duration) => { + assert.strictEqual(s, item); + callbackTime = t; + callbackCount++; + if (callbackCount === 1) { + er.retryLater(item, callback); + } + }; + er.retryLater(item, callback); + + clock.tick(125); + assert.strictEqual(callbackCount, 1); + assert.strictEqual(callbackTime.milliseconds, 125); + + clock.tick(400); + assert.strictEqual(callbackCount, 2); + assert.strictEqual(callbackTime.milliseconds, 312); + + const leftovers = er.close(); + assert.strictEqual(leftovers.length, 0); + }); + + it('calls retries in the right order', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const items = [makeItem(), makeItem()]; + + const er = new ExponentialRetry( + Duration.from({milliseconds: 100}), + Duration.from({milliseconds: 1000}), + ); + + // Just disable the fuzz for this test. + sandbox.stub(global.Math, 'random').returns(0.5); + + const callbackCounts = [0, 0]; + const callbackTimes: Duration[] = [ + Duration.from({milliseconds: 0}), + Duration.from({milliseconds: 0}), + ]; + + const callback = (s: TestItem, t: Duration) => { + const idx = s === items[0] ? 0 : 1; + callbackCounts[idx]++; + callbackTimes[idx] = t; + + if (callbackCounts[idx] < 2) { + er.retryLater(items[idx], callback); + } + }; + + // Load in the first item and get it retrying. + er.retryLater(items[0], callback); + + clock.tick(300); + assert.deepStrictEqual(callbackCounts, [2, 0]); + assert.deepStrictEqual( + callbackTimes.map(d => d.milliseconds), + [300, 0], + ); + + // Load in the second item and get it retrying. + er.retryLater(items[1], callback); + + clock.tick(125); + + // The first item should've retried twice and still be in the queue, + // while the second item should've retried once and quit. + assert.deepStrictEqual(callbackCounts, [2, 1]); + assert.deepStrictEqual( + callbackTimes.map(d => d.milliseconds), + [300, 100], + ); + + // Make sure that we did in fact set another timer for the next event. + const eri = introspect(er); + assert.ok(eri._timer); + + const leftovers = er.close(); + assert.strictEqual(leftovers.length, 1); + }); +}); diff --git a/handwritten/pubsub/test/gapic_publisher_v1.ts b/handwritten/pubsub/test/gapic_publisher_v1.ts new file mode 100644 index 00000000000..1e183b71639 --- /dev/null +++ b/handwritten/pubsub/test/gapic_publisher_v1.ts @@ -0,0 +1,2555 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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 publisherModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} 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.PublisherClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new publisherModule.v1.PublisherClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new publisherModule.v1.PublisherClient(); + 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 = publisherModule.v1.PublisherClient.servicePath; + assert.strictEqual(servicePath, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = publisherModule.v1.PublisherClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new publisherModule.v1.PublisherClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new publisherModule.v1.PublisherClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 publisherModule.v1.PublisherClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 publisherModule.v1.PublisherClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 publisherModule.v1.PublisherClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = publisherModule.v1.PublisherClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new publisherModule.v1.PublisherClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new publisherModule.v1.PublisherClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.publisherStub, undefined); + await client.initialize(); + assert(client.publisherStub); + }); + + it('has close method for the initialized client', done => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => { + throw err; + }); + assert(client.publisherStub); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.publisherStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new publisherModule.v1.PublisherClient({ + 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 publisherModule.v1.PublisherClient({ + 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('createTopic', () => { + it('invokes createTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + const defaultValue1 = getTypeDefaultValue('.google.pubsub.v1.Topic', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + client.innerApiCalls.createTopic = stubSimpleCall(expectedResponse); + const [response] = await client.createTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + const defaultValue1 = getTypeDefaultValue('.google.pubsub.v1.Topic', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + client.innerApiCalls.createTopic = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTopic( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + const defaultValue1 = getTypeDefaultValue('.google.pubsub.v1.Topic', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTopic = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createTopic(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + const defaultValue1 = getTypeDefaultValue('.google.pubsub.v1.Topic', [ + 'name', + ]); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.createTopic(request), expectedError); + }); + }); + + describe('updateTopic', () => { + it('invokes updateTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest(), + ); + request.topic ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateTopicRequest', + ['topic', 'name'], + ); + request.topic.name = defaultValue1; + const expectedHeaderRequestParams = `topic.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + client.innerApiCalls.updateTopic = stubSimpleCall(expectedResponse); + const [response] = await client.updateTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest(), + ); + request.topic ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateTopicRequest', + ['topic', 'name'], + ); + request.topic.name = defaultValue1; + const expectedHeaderRequestParams = `topic.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + client.innerApiCalls.updateTopic = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTopic( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest(), + ); + request.topic ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateTopicRequest', + ['topic', 'name'], + ); + request.topic.name = defaultValue1; + const expectedHeaderRequestParams = `topic.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTopic = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTopic(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest(), + ); + request.topic ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateTopicRequest', + ['topic', 'name'], + ); + request.topic.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.updateTopic(request), expectedError); + }); + }); + + describe('publish', () => { + it('invokes publish without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PublishRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PublishResponse(), + ); + client.innerApiCalls.publish = stubSimpleCall(expectedResponse); + const [response] = await client.publish(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.publish as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.publish as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PublishRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PublishResponse(), + ); + client.innerApiCalls.publish = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.publish( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IPublishResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.publish as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.publish as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PublishRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.publish = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.publish(request), expectedError); + const actualRequest = (client.innerApiCalls.publish as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.publish as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PublishRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.publish(request), expectedError); + }); + }); + + describe('getTopic', () => { + it('invokes getTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + client.innerApiCalls.getTopic = stubSimpleCall(expectedResponse); + const [response] = await client.getTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic(), + ); + client.innerApiCalls.getTopic = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTopic( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTopic = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTopic(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getTopic(request), expectedError); + }); + }); + + describe('deleteTopic', () => { + it('invokes deleteTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTopic = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTopic(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTopic = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTopic( + 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.deleteTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTopic = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteTopic(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTopic as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTopic as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTopic with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteTopicRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteTopic(request), expectedError); + }); + }); + + describe('detachSubscription', () => { + it('invokes detachSubscription without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DetachSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionResponse(), + ); + client.innerApiCalls.detachSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.detachSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.detachSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detachSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detachSubscription without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DetachSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionResponse(), + ); + client.innerApiCalls.detachSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detachSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IDetachSubscriptionResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.detachSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detachSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detachSubscription with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DetachSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.detachSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.detachSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.detachSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.detachSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes detachSubscription with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DetachSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DetachSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.detachSubscription(request), expectedError); + }); + }); + + describe('listTopics', () => { + it('invokes listTopics without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.innerApiCalls.listTopics = stubSimpleCall(expectedResponse); + const [response] = await client.listTopics(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTopics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopics without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.innerApiCalls.listTopics = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTopics( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTopics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopics with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopics = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTopics(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTopics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.descriptors.page.listTopics.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTopicsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Topic[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Topic) => { + 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.listTopics.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopics, request), + ); + assert( + (client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTopicsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopics.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listTopicsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Topic[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Topic) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopics, request), + ); + assert( + (client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTopics without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.descriptors.page.listTopics.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ITopic[] = []; + const iterable = client.listTopicsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listTopics.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTopics with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listTopicsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ITopic[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listTopics.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listTopicSubscriptions', () => { + it('invokes listTopicSubscriptions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSubscriptions = + stubSimpleCall(expectedResponse); + const [response] = await client.listTopicSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTopicSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopicSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSubscriptions without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSubscriptions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTopicSubscriptions( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTopicSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopicSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSubscriptions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopicSubscriptions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listTopicSubscriptions(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listTopicSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopicSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSubscriptionsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSubscriptions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTopicSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.listTopicSubscriptions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSubscriptions, request), + ); + assert( + ( + client.descriptors.page.listTopicSubscriptions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listTopicSubscriptionsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSubscriptions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTopicSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listTopicSubscriptions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSubscriptions, request), + ); + assert( + ( + client.descriptors.page.listTopicSubscriptions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listTopicSubscriptions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSubscriptions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.listTopicSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listTopicSubscriptions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSubscriptionsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSubscriptions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTopicSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('listTopicSnapshots', () => { + it('invokes listTopicSnapshots without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSnapshots = + stubSimpleCall(expectedResponse); + const [response] = await client.listTopicSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTopicSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopicSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSnapshots without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listTopicSnapshots = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTopicSnapshots( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTopicSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopicSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSnapshots with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopicSnapshots = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTopicSnapshots(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTopicSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTopicSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTopicSnapshotsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSnapshots.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTopicSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.listTopicSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSnapshots, request), + ); + assert( + (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTopicSnapshotsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSnapshots.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTopicSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSnapshots, request), + ); + assert( + (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTopicSnapshots without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listTopicSnapshots.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.listTopicSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTopicSnapshots with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListTopicSnapshotsRequest', + ['topic'], + ); + request.topic = defaultValue1; + const expectedHeaderRequestParams = `topic=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSnapshots.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTopicSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + + describe('Path templates', () => { + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectTopic', async () => { + const fakePath = '/rendered/path/projectTopic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('schema', async () => { + const fakePath = '/rendered/path/schema'; + const expectedParameters = { + project: 'projectValue', + schema: 'schemaValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.schemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schemaPath', () => { + const result = client.schemaPath('projectValue', 'schemaValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSchemaName', () => { + const result = client.matchProjectFromSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSchemaFromSchemaName', () => { + const result = client.matchSchemaFromSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + (client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('snapshot', async () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + snapshot: 'snapshotValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath('projectValue', 'snapshotValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscription', async () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscription: 'subscriptionValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriptionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/gapic_schema_service_v1.ts b/handwritten/pubsub/test/gapic_schema_service_v1.ts new file mode 100644 index 00000000000..165864ede35 --- /dev/null +++ b/handwritten/pubsub/test/gapic_schema_service_v1.ts @@ -0,0 +1,2543 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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 schemaserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} 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.SchemaServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + 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 = + schemaserviceModule.v1.SchemaServiceClient.servicePath; + assert.strictEqual(servicePath, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + schemaserviceModule.v1.SchemaServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 schemaserviceModule.v1.SchemaServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 schemaserviceModule.v1.SchemaServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 schemaserviceModule.v1.SchemaServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = schemaserviceModule.v1.SchemaServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.schemaServiceStub, undefined); + await client.initialize(); + assert(client.schemaServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => { + throw err; + }); + assert(client.schemaServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.schemaServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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('createSchema', () => { + it('invokes createSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.createSchema = stubSimpleCall(expectedResponse); + const [response] = await client.createSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.createSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSchema( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.createSchema(request), expectedError); + }); + }); + + describe('getSchema', () => { + it('invokes getSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.getSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.getSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSchema( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getSchema(request), expectedError); + }); + }); + + describe('commitSchema', () => { + it('invokes commitSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CommitSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.commitSchema = stubSimpleCall(expectedResponse); + const [response] = await client.commitSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.commitSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CommitSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.commitSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commitSchema( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.commitSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CommitSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.commitSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.commitSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.commitSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CommitSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CommitSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.commitSchema(request), expectedError); + }); + }); + + describe('rollbackSchema', () => { + it('invokes rollbackSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.RollbackSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.rollbackSchema = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.RollbackSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.rollbackSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackSchema( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.RollbackSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.rollbackSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rollbackSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.RollbackSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.RollbackSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.rollbackSchema(request), expectedError); + }); + }); + + describe('deleteSchemaRevision', () => { + it('invokes deleteSchemaRevision without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRevisionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.deleteSchemaRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSchemaRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchemaRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchemaRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaRevision without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRevisionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Schema(), + ); + client.innerApiCalls.deleteSchemaRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchemaRevision( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchemaRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchemaRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaRevision with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRevisionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchemaRevision = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSchemaRevision(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSchemaRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchemaRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchemaRevision with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRevisionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRevisionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteSchemaRevision(request), expectedError); + }); + }); + + describe('deleteSchema', () => { + it('invokes deleteSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSchema = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchema( + 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.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteSchema(request), expectedError); + }); + }); + + describe('validateSchema', () => { + it('invokes validateSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaResponse(), + ); + client.innerApiCalls.validateSchema = stubSimpleCall(expectedResponse); + const [response] = await client.validateSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaResponse(), + ); + client.innerApiCalls.validateSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateSchema( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IValidateSchemaResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.validateSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.validateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.validateSchema(request), expectedError); + }); + }); + + describe('validateMessage', () => { + it('invokes validateMessage without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateMessageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageResponse(), + ); + client.innerApiCalls.validateMessage = stubSimpleCall(expectedResponse); + const [response] = await client.validateMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateMessage without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateMessageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageResponse(), + ); + client.innerApiCalls.validateMessage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validateMessage( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IValidateMessageResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.validateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateMessage with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateMessageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.validateMessage = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.validateMessage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.validateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes validateMessage with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ValidateMessageRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ValidateMessageRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.validateMessage(request), expectedError); + }); + }); + + describe('listSchemas', () => { + it('invokes listSchemas without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemas without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchemas( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemas with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchemas = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSchemas(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemasStream without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + 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.listSchemas.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemas, request), + ); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSchemasStream with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemas.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemas, request), + ); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSchemas without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISchema[] = []; + const iterable = client.listSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSchemas with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemas.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSchemaRevisions', () => { + it('invokes listSchemaRevisions without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemaRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listSchemaRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemaRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemaRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaRevisions without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.innerApiCalls.listSchemaRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchemaRevisions( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISchema[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemaRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemaRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaRevisions with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchemaRevisions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSchemaRevisions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSchemaRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemaRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemaRevisionsStream without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemaRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSchemaRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + 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.listSchemaRevisions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemaRevisions, request), + ); + assert( + (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSchemaRevisionsStream with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemaRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSchemaRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Schema[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Schema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemaRevisions, request), + ); + assert( + (client.descriptors.page.listSchemaRevisions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSchemaRevisions without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + generateSampleMessage(new protos.google.pubsub.v1.Schema()), + ]; + client.descriptors.page.listSchemaRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISchema[] = []; + const iterable = client.listSchemaRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSchemaRevisions with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSchemaRevisionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSchemaRevisionsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemaRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSchemaRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + + describe('Path templates', () => { + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectTopic', async () => { + const fakePath = '/rendered/path/projectTopic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('schema', async () => { + const fakePath = '/rendered/path/schema'; + const expectedParameters = { + project: 'projectValue', + schema: 'schemaValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.schemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schemaPath', () => { + const result = client.schemaPath('projectValue', 'schemaValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSchemaName', () => { + const result = client.matchProjectFromSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSchemaFromSchemaName', () => { + const result = client.matchSchemaFromSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + (client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('snapshot', async () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + snapshot: 'snapshotValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath('projectValue', 'snapshotValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscription', async () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscription: 'subscriptionValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriptionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/gapic_subscriber_v1.ts b/handwritten/pubsub/test/gapic_subscriber_v1.ts new file mode 100644 index 00000000000..cfe23b77b9a --- /dev/null +++ b/handwritten/pubsub/test/gapic_subscriber_v1.ts @@ -0,0 +1,3295 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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 subscriberModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function 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.SubscriberClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new subscriberModule.v1.SubscriberClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new subscriberModule.v1.SubscriberClient(); + 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 = subscriberModule.v1.SubscriberClient.servicePath; + assert.strictEqual(servicePath, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = subscriberModule.v1.SubscriberClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'pubsub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new subscriberModule.v1.SubscriberClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new subscriberModule.v1.SubscriberClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 subscriberModule.v1.SubscriberClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 subscriberModule.v1.SubscriberClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'pubsub.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 subscriberModule.v1.SubscriberClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = subscriberModule.v1.SubscriberClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new subscriberModule.v1.SubscriberClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new subscriberModule.v1.SubscriberClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.subscriberStub, undefined); + await client.initialize(); + assert(client.subscriberStub); + }); + + it('has close method for the initialized client', done => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => { + throw err; + }); + assert(client.subscriberStub); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.subscriberStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch(err => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new subscriberModule.v1.SubscriberClient({ + 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 subscriberModule.v1.SubscriberClient({ + 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('createSubscription', () => { + it('invokes createSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.Subscription', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + client.innerApiCalls.createSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.createSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.Subscription', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + client.innerApiCalls.createSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.Subscription', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.Subscription', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.createSubscription(request), expectedError); + }); + }); + + describe('getSubscription', () => { + it('invokes getSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + client.innerApiCalls.getSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.getSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + client.innerApiCalls.getSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getSubscription(request), expectedError); + }); + }); + + describe('updateSubscription', () => { + it('invokes updateSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + client.innerApiCalls.updateSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription(), + ); + client.innerApiCalls.updateSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedHeaderRequestParams = `subscription.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest(), + ); + request.subscription ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSubscriptionRequest', + ['subscription', 'name'], + ); + request.subscription.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.updateSubscription(request), expectedError); + }); + }); + + describe('deleteSubscription', () => { + it('invokes deleteSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSubscription = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSubscription = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSubscription( + 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.deleteSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSubscription = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSubscription(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSubscription as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSubscription with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSubscriptionRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteSubscription(request), expectedError); + }); + }); + + describe('modifyAckDeadline', () => { + it('invokes modifyAckDeadline without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyAckDeadlineRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.modifyAckDeadline = stubSimpleCall(expectedResponse); + const [response] = await client.modifyAckDeadline(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.modifyAckDeadline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyAckDeadline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyAckDeadline without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyAckDeadlineRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.modifyAckDeadline = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.modifyAckDeadline( + 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.modifyAckDeadline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyAckDeadline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyAckDeadline with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyAckDeadlineRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyAckDeadline = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.modifyAckDeadline(request), expectedError); + const actualRequest = ( + client.innerApiCalls.modifyAckDeadline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyAckDeadline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyAckDeadline with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyAckDeadlineRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.modifyAckDeadline(request), expectedError); + }); + }); + + describe('acknowledge', () => { + it('invokes acknowledge without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.AcknowledgeRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.acknowledge = stubSimpleCall(expectedResponse); + const [response] = await client.acknowledge(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acknowledge as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acknowledge as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledge without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.AcknowledgeRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.acknowledge = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acknowledge( + 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.acknowledge as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acknowledge as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledge with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.AcknowledgeRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledge = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.acknowledge(request), expectedError); + const actualRequest = ( + client.innerApiCalls.acknowledge as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acknowledge as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acknowledge with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.AcknowledgeRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.acknowledge(request), expectedError); + }); + }); + + describe('pull', () => { + it('invokes pull without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PullRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PullResponse(), + ); + client.innerApiCalls.pull = stubSimpleCall(expectedResponse); + const [response] = await client.pull(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pull as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pull as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pull without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PullRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PullResponse(), + ); + client.innerApiCalls.pull = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pull( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IPullResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pull as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pull as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pull with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PullRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pull = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pull(request), expectedError); + const actualRequest = (client.innerApiCalls.pull as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pull as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pull with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.PullRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.pull(request), expectedError); + }); + }); + + describe('modifyPushConfig', () => { + it('invokes modifyPushConfig without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyPushConfigRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.modifyPushConfig = stubSimpleCall(expectedResponse); + const [response] = await client.modifyPushConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.modifyPushConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyPushConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyPushConfig without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyPushConfigRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.modifyPushConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.modifyPushConfig( + 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.modifyPushConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyPushConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyPushConfig with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyPushConfigRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyPushConfig = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.modifyPushConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.modifyPushConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.modifyPushConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes modifyPushConfig with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ModifyPushConfigRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.modifyPushConfig(request), expectedError); + }); + }); + + describe('getSnapshot', () => { + it('invokes getSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot(), + ); + client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.getSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot(), + ); + client.innerApiCalls.getSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSnapshot = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.GetSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.getSnapshot(request), expectedError); + }); + }); + + describe('createSnapshot', () => { + it('invokes createSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot(), + ); + client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.createSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot(), + ); + client.innerApiCalls.createSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSnapshot = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.CreateSnapshotRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.createSnapshot(request), expectedError); + }); + }); + + describe('updateSnapshot', () => { + it('invokes updateSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest(), + ); + request.snapshot ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSnapshotRequest', + ['snapshot', 'name'], + ); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot(), + ); + client.innerApiCalls.updateSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.updateSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest(), + ); + request.snapshot ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSnapshotRequest', + ['snapshot', 'name'], + ); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot(), + ); + client.innerApiCalls.updateSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest(), + ); + request.snapshot ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSnapshotRequest', + ['snapshot', 'name'], + ); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSnapshot = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest(), + ); + request.snapshot ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.UpdateSnapshotRequest', + ['snapshot', 'name'], + ); + request.snapshot.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.updateSnapshot(request), expectedError); + }); + }); + + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSnapshot( + 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.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedHeaderRequestParams = `snapshot=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSnapshot = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.DeleteSnapshotRequest', + ['snapshot'], + ); + request.snapshot = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.deleteSnapshot(request), expectedError); + }); + }); + + describe('seek', () => { + it('invokes seek without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.SeekRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.SeekResponse(), + ); + client.innerApiCalls.seek = stubSimpleCall(expectedResponse); + const [response] = await client.seek(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.seek as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seek as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seek without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.SeekRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.SeekResponse(), + ); + client.innerApiCalls.seek = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.seek( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISeekResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.seek as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seek as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seek with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.SeekRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedHeaderRequestParams = `subscription=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.seek = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.seek(request), expectedError); + const actualRequest = (client.innerApiCalls.seek as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seek as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seek with closed client', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.SeekRequest', + ['subscription'], + ); + request.subscription = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => { + throw err; + }); + await assert.rejects(client.seek(request), expectedError); + }); + }); + + describe('streamingPull', () => { + it('invokes streamingPull without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullResponse(), + ); + client.innerApiCalls.streamingPull = + stubBidiStreamingCall(expectedResponse); + const stream = client.streamingPull(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.pubsub.v1.StreamingPullResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingPull as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes streamingPull with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingPull = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.streamingPull(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.pubsub.v1.StreamingPullResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.streamingPull as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + + describe('listSubscriptions', () => { + it('invokes listSubscriptions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.innerApiCalls.listSubscriptions = stubSimpleCall(expectedResponse); + const [response] = await client.listSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptions without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.innerApiCalls.listSubscriptions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubscriptions( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubscriptions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSubscriptions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscriptions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscriptionsStream without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.descriptors.page.listSubscriptions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Subscription[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { + 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.listSubscriptions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscriptions, request), + ); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSubscriptionsStream with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Subscription[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscriptions, request), + ); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSubscriptions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.descriptors.page.listSubscriptions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISubscription[] = []; + const iterable = client.listSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscriptions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSubscriptions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSubscriptionsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISubscription[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscriptions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSubscriptions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSnapshots', () => { + it('invokes listSnapshots without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSnapshots( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSnapshots = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSnapshots(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshotsStream without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.descriptors.page.listSnapshots.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Snapshot[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { + 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.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request), + ); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSnapshotsStream with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Snapshot[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request), + ); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSnapshots without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.descriptors.page.listSnapshots.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.pubsub.v1.ISnapshot[] = []; + const iterable = client.listSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSnapshots with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.pubsub.v1.ListSnapshotsRequest', + ['project'], + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISnapshot[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch(err => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + + describe('Path templates', () => { + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectTopic', async () => { + const fakePath = '/rendered/path/projectTopic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('schema', async () => { + const fakePath = '/rendered/path/schema'; + const expectedParameters = { + project: 'projectValue', + schema: 'schemaValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.schemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schemaPath', () => { + const result = client.schemaPath('projectValue', 'schemaValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSchemaName', () => { + const result = client.matchProjectFromSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSchemaFromSchemaName', () => { + const result = client.matchSchemaFromSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + (client.pathTemplates.schemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('snapshot', async () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + snapshot: 'snapshotValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath('projectValue', 'snapshotValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('subscription', async () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscription: 'subscriptionValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriptionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/histogram.ts b/handwritten/pubsub/test/histogram.ts new file mode 100644 index 00000000000..8a32be791a6 --- /dev/null +++ b/handwritten/pubsub/test/histogram.ts @@ -0,0 +1,119 @@ +// Copyright 2017 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it, beforeEach} from 'mocha'; +import {Histogram} from '../src/histogram.js'; + +describe('Histogram', () => { + let histogram: Histogram; + + const MIN_VALUE = 10000; + const MAX_VALUE = 600000; + + beforeEach(() => { + histogram = new Histogram({min: MIN_VALUE, max: MAX_VALUE}); + }); + + describe('initialization', () => { + it('should set default min/max values', () => { + histogram = new Histogram(); + assert.strictEqual(histogram.options.min, 0); + assert.strictEqual(histogram.options.max, Number.MAX_SAFE_INTEGER); + }); + + it('should accept user defined min/max values', () => { + histogram = new Histogram({min: 5, max: 10}); + + assert.strictEqual(histogram.options.min, 5); + assert.strictEqual(histogram.options.max, 10); + }); + + it('should create a data map', () => { + assert(histogram.data instanceof Map); + }); + + it('should set the initial length to 0', () => { + assert.strictEqual(histogram.length, 0); + }); + }); + + describe('add', () => { + it('should increment a value', () => { + histogram.data.set(MIN_VALUE, 1); + histogram.add(MIN_VALUE); + + assert.strictEqual(histogram.data.get(MIN_VALUE), 2); + }); + + it('should initialize a value if absent', () => { + histogram.add(MIN_VALUE); + + assert.strictEqual(histogram.data.get(MIN_VALUE), 1); + }); + + it('should adjust the length for each item added', () => { + histogram.add(MIN_VALUE); + histogram.add(MIN_VALUE); + histogram.add(MIN_VALUE * 2); + + assert.strictEqual(histogram.length, 3); + }); + + it('should cap the value', () => { + const outOfBounds = MAX_VALUE + MIN_VALUE; + + histogram.add(outOfBounds); + + assert.strictEqual(histogram.data.get(outOfBounds), undefined); + assert.strictEqual(histogram.data.get(MAX_VALUE), 1); + }); + + it('should apply a minimum', () => { + const outOfBounds = MIN_VALUE - 1000; + + histogram.add(outOfBounds); + + assert.strictEqual(histogram.data.get(outOfBounds), undefined); + assert.strictEqual(histogram.data.get(MIN_VALUE), 1); + }); + }); + + describe('percentile', () => { + function range(a: number, b: number) { + const result: number[] = []; + + for (; a < b; a++) { + result.push(a); + } + + return result; + } + + it('should return the nth percentile', () => { + range(100, 201).forEach(value => { + histogram.add(value * 1000); + }); + + assert.strictEqual(histogram.percentile(100), 200000); + assert.strictEqual(histogram.percentile(101), 200000); + assert.strictEqual(histogram.percentile(99), 199000); + assert.strictEqual(histogram.percentile(1), 101000); + }); + + it('should return the min value if unable to determine', () => { + assert.strictEqual(histogram.percentile(99), MIN_VALUE); + }); + }); +}); diff --git a/handwritten/pubsub/test/iam.ts b/handwritten/pubsub/test/iam.ts new file mode 100644 index 00000000000..a1f73f8bf35 --- /dev/null +++ b/handwritten/pubsub/test/iam.ts @@ -0,0 +1,237 @@ +// Copyright 2014 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, beforeEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; + +import * as iamTypes from '../src/iam'; +import {PubSub, RequestConfig} from '../src/pubsub'; +import * as util from '../src/util'; + +let promisified = false; +const fakeUtil = Object.assign({}, util, { + promisifySome( + class_: Function, + classProtos: object, + methods: string[], + ): void { + if (class_.name === 'IAM') { + promisified = true; + assert.deepStrictEqual(methods, [ + 'getPolicy', + 'setPolicy', + 'testPermissions', + ]); + } + // Defeats the method name type check. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + util.promisifySome(class_, classProtos, methods as any); + }, +}); + +describe('IAM', () => { + let IAM: typeof iamTypes.IAM; + let iam: iamTypes.IAM; + + const PUBSUB = { + options: {}, + request: util.noop, + } as {} as PubSub; + const ID = 'id'; + + before(() => { + IAM = proxyquire('../src/iam.js', { + './util': fakeUtil, + }).IAM; + }); + + beforeEach(() => { + iam = new IAM(PUBSUB, ID); + }); + + describe('initialization', () => { + it('should localize pubsub', () => { + assert.strictEqual(iam.pubsub, PUBSUB); + }); + + it('should localize pubsub#request', () => { + const fakeRequest = () => {}; + const fakePubsub = { + request: { + bind(context: PubSub) { + assert.strictEqual(context, fakePubsub); + return fakeRequest; + }, + }, + } as {} as PubSub; + const iam = new IAM(fakePubsub, ID); + + assert.strictEqual(iam.request, fakeRequest); + }); + + it('should localize the ID string', () => { + assert.strictEqual(iam.id, ID); + }); + + it('should localize the ID getter', () => { + iam = new IAM(PUBSUB, { + get name() { + return 'test'; + }, + }); + assert.strictEqual(iam.id, 'test'); + }); + + it('should promisify some of the things', () => { + assert(promisified); + }); + }); + + describe('getPolicy', () => { + it('should make the correct API request', done => { + iam.request = config => { + const reqOpts = {resource: iam.id}; + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'getIamPolicy'); + assert.deepStrictEqual(config.reqOpts, reqOpts); + + done(); + }; + + iam.getPolicy(assert.ifError); + }); + + it('should accept gax options', done => { + const gaxOpts = {}; + + iam.request = config => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + iam.getPolicy(gaxOpts, assert.ifError); + }); + }); + + describe('setPolicy', () => { + const policy: iamTypes.Policy = {etag: 'ACAB', bindings: []}; + + it('should throw an error if a policy is not supplied', () => { + assert.throws(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (iam as any).setPolicy(util.noop); + }, /A policy object is required\./); + }); + + it('should make the correct API request', done => { + iam.request = config => { + const reqOpts = {resource: iam.id, policy}; + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'setIamPolicy'); + assert.deepStrictEqual(config.reqOpts, reqOpts); + + done(); + }; + + iam.setPolicy(policy, assert.ifError); + }); + + it('should accept gax options', done => { + const gaxOpts = {}; + + iam.request = (config: RequestConfig) => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + iam.setPolicy(policy, gaxOpts, assert.ifError); + }); + }); + + describe('testPermissions', () => { + it('should throw an error if permissions are missing', () => { + assert.throws(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (iam as any).testPermissions(util.noop); + }, /Permissions are required\./); + }); + + it('should make the correct API request', done => { + const permissions = 'storage.bucket.list'; + const reqOpts = {resource: iam.id, permissions: [permissions]}; + + iam.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'testIamPermissions'); + assert.deepStrictEqual(config.reqOpts, reqOpts); + + done(); + }; + + iam.testPermissions(permissions, assert.ifError); + }); + + it('should accept gax options', done => { + const permissions = 'storage.bucket.list'; + const gaxOpts = {}; + + iam.request = config => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + iam.testPermissions(permissions, gaxOpts, assert.ifError); + }); + + it('should send an error back if the request fails', done => { + const permissions = ['storage.bucket.list']; + const error = new Error('Error.'); + const apiResponse = {}; + + iam.request = (config, callback: Function) => { + callback(error, apiResponse); + }; + + iam.testPermissions(permissions, (err, permissions, apiResp) => { + assert.strictEqual(err, error); + assert.strictEqual(permissions, null); + assert.strictEqual(apiResp, apiResponse); + done(); + }); + }); + + it('should pass back a hash of permissions the user has', done => { + const permissions = ['storage.bucket.list', 'storage.bucket.consume']; + const apiResponse = { + permissions: ['storage.bucket.consume'], + }; + + iam.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + + iam.testPermissions(permissions, (err, permissions, apiResp) => { + assert.ifError(err); + assert.deepStrictEqual(permissions, { + 'storage.bucket.list': false, + 'storage.bucket.consume': true, + }); + assert.strictEqual(apiResp, apiResponse); + + done(); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/index.ts b/handwritten/pubsub/test/index.ts new file mode 100644 index 00000000000..7db1e81601f --- /dev/null +++ b/handwritten/pubsub/test/index.ts @@ -0,0 +1,23 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it} from 'mocha'; +import * as pubsub from '../src'; + +describe('exports', () => { + it('should export the gapic clients', () => { + assert.ok(pubsub.v1); + }); +}); diff --git a/handwritten/pubsub/test/lease-manager.ts b/handwritten/pubsub/test/lease-manager.ts new file mode 100644 index 00000000000..0d74a39639a --- /dev/null +++ b/handwritten/pubsub/test/lease-manager.ts @@ -0,0 +1,752 @@ +/*! + * Copyright 2018 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import {EventEmitter} from 'events'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import * as defer from 'p-defer'; + +import * as leaseTypes from '../src/lease-manager'; +import { + AckError, + AckResponse, + AckResponses, + Message, + Subscriber, +} from '../src/subscriber'; +import {defaultOptions} from '../src/default-options'; +import {FakeLog, TestUtils} from './test-utils'; +import {Duration} from '../src'; +import {loggingUtils} from 'google-gax'; + +const FREE_MEM = 9376387072; +const fakeos = { + freemem: () => FREE_MEM, +}; + +class FakeSubscriber extends EventEmitter { + ackDeadline = 10; + isOpen = true; + modAckLatency = 2000; + maxExtensionTime = Duration.from({minutes: 60}); + async modAck(): Promise {} + async modAckWithResponse(): Promise { + return AckResponses.Success; + } + isExactlyOnceDelivery = false; +} + +class FakeSubscriberTelemetry { + flowStart() {} + flowEnd() {} + schedulerStart() {} + schedulerEnd() {} + modAckStart() {} + modAckStop() {} + processingStart() {} + processingEnd() {} +} + +class FakeMessage { + length = 20; + received: number; + subSpans: FakeSubscriberTelemetry = new FakeSubscriberTelemetry(); + _dispatched = false; + + constructor() { + this.received = Date.now(); + } + modAck(): void {} + async modAckWithResponse(): Promise { + return AckResponses.Success; + } + ackFailed() {} + endParentSpan() {} + dispatched() { + this._dispatched = true; + } + get isDispatched() { + return this._dispatched; + } + get handledPromise() { + return Promise.resolve(); + } +} + +interface LeaseManagerInternals { + _extendDeadlines(): void; + _messages: Set; + _isLeasing: boolean; + _scheduleExtension(): void; +} + +function getLMInternals(mgr: leaseTypes.LeaseManager): LeaseManagerInternals { + return mgr as unknown as LeaseManagerInternals; +} + +describe('LeaseManager', () => { + const sandbox = sinon.createSandbox(); + + let subscriber: Subscriber; + + // tslint:disable-next-line variable-name + let LeaseManager: typeof leaseTypes.LeaseManager; + let leaseManager: leaseTypes.LeaseManager; + + let fakeLog: FakeLog | undefined; + + before(() => { + LeaseManager = proxyquire('../src/lease-manager.js', { + os: fakeos, + '../src/subscriber': {Subscriber: FakeSubscriber, Message: FakeMessage}, + }).LeaseManager; + }); + + beforeEach(() => { + subscriber = new FakeSubscriber() as {} as Subscriber; + leaseManager = new LeaseManager(subscriber); + }); + + afterEach(() => { + fakeLog?.remove(); + leaseManager.clear(); + sandbox.restore(); + }); + + describe('instantiation', () => { + it('should default the bytes value to 0', () => { + assert.strictEqual(leaseManager.size, 0); + }); + + it('should capture any options passed in', () => { + const fakeOptions = {}; + const stub = sandbox.stub(LeaseManager.prototype, 'setOptions'); + new LeaseManager(subscriber, fakeOptions); + const [options] = stub.lastCall.args; + assert.strictEqual(options, fakeOptions); + }); + }); + + describe('pending', () => { + it('should return the number of pending messages', () => { + leaseManager.setOptions({allowExcessMessages: false, maxMessages: 1}); + + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.add(new FakeMessage() as {} as Message); + + assert.strictEqual(leaseManager.pending, 1); + }); + }); + + describe('size', () => { + it('should return the number of messages', () => { + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.add(new FakeMessage() as {} as Message); + + assert.strictEqual(leaseManager.size, 2); + }); + }); + + describe('add', () => { + it('should start a flow span', () => { + const message = new FakeMessage() as {} as Message; + const stub = sandbox.spy(message.subSpans, 'flowStart'); + + leaseManager.add(message); + + assert.strictEqual(stub.calledOnce, true); + }); + + it('should update the bytes/size values', () => { + const message = new FakeMessage() as {} as Message; + + leaseManager.add(message); + + assert.strictEqual(leaseManager.size, 1); + assert.strictEqual(leaseManager.bytes, message.length); + }); + + it('should dispatch the message if allowExcessMessages is true', done => { + const fakeMessage = new FakeMessage() as {} as Message; + + leaseManager.isFull = () => true; + leaseManager.setOptions({allowExcessMessages: true}); + + subscriber.on('message', message => { + assert.strictEqual(message, fakeMessage); + done(); + }); + + leaseManager.add(fakeMessage); + }); + + it('should make a log message about the dispatch', done => { + const fakeMessage = new FakeMessage() as {} as Message; + fakeMessage.id = 'a'; + fakeMessage.ackId = 'b'; + + fakeLog = new FakeLog(leaseTypes.logs.callbackDelivery); + + leaseManager.setOptions({ + allowExcessMessages: true, + }); + + subscriber.on('message', () => { + assert.strictEqual(fakeLog!.called, true); + assert.strictEqual( + fakeLog!.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog!.args![1] as string, 'a'); + assert.strictEqual(fakeLog!.args![2] as string, 'b'); + done(); + }); + + leaseManager.add(fakeMessage); + }); + + it('should make a log message about a failed dispatch', async () => { + const fakeMessage = new FakeMessage() as {} as Message; + fakeMessage.id = 'a'; + fakeMessage.ackId = 'b'; + + fakeLog = new FakeLog(leaseTypes.logs.callbackExceptions); + + leaseManager.setOptions({ + allowExcessMessages: true, + }); + + const deferred = defer(); + subscriber.on('message', () => { + process.nextTick(() => deferred.resolve()); + throw new Error('fooz'); + }); + + leaseManager.add(fakeMessage); + await deferred.promise; + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.ERROR, + ); + assert.strictEqual( + (fakeLog.args![0] as string).includes('exception'), + true, + ); + assert.strictEqual(fakeLog.args![1] as string, 'a'); + assert.strictEqual(fakeLog.args![2] as string, 'b'); + }); + + it('should dispatch the message if the inventory is not full', done => { + const fakeMessage = new FakeMessage() as {} as Message; + + leaseManager.isFull = () => false; + leaseManager.setOptions({allowExcessMessages: false}); + + subscriber.on('message', message => { + assert.strictEqual(message, fakeMessage); + done(); + }); + + leaseManager.add(fakeMessage); + }); + + it('should not dispatch the message if the inventory is full', done => { + const fakeMessage = new FakeMessage() as {} as Message; + + leaseManager.isFull = () => true; + leaseManager.setOptions({allowExcessMessages: false}); + + subscriber.on('message', () => { + done(new Error('Test should not have dispatched message.')); + }); + + leaseManager.add(fakeMessage); + setImmediate(done); + }); + + it('should log if blocked by client-side flow control', () => { + const fakeMessage = new FakeMessage() as {} as Message; + + sandbox.stub(leaseManager, 'isFull').returns(true); + const pendingStub = sandbox.stub(leaseManager, 'pending'); + pendingStub.get(() => 0); + leaseManager.setOptions({allowExcessMessages: false}); + fakeLog = new FakeLog(leaseTypes.logs.subscriberFlowControl); + + leaseManager.add(fakeMessage); + assert.strictEqual(fakeLog.called, true); + + fakeLog.called = false; + pendingStub.get(() => 1); + leaseManager.add(fakeMessage); + assert.strictEqual(fakeLog.called, false); + }); + + it('should not dispatch the message if the sub closes', done => { + const fakeMessage = new FakeMessage() as {} as Message; + + leaseManager.isFull = () => false; + + subscriber.isOpen = false; + subscriber.on('message', () => { + done(new Error('Test should not have dispatched message.')); + }); + + leaseManager.add(fakeMessage); + setImmediate(done); + }); + + it('should emit the full event if it becomes full', done => { + leaseManager.setOptions({allowExcessMessages: false, maxMessages: 1}); + + leaseManager.on('full', done); + leaseManager.add(new FakeMessage() as {} as Message); + }); + + describe('extending deadlines', () => { + let clock: sinon.SinonFakeTimers; + let random: number; + let expectedTimeout: number; + let halfway: number; + + beforeEach(() => { + // This random number was generated once to keep the test results stable. + random = 0.5756015072052962; + sandbox.stub(global.Math, 'random').returns(random); + clock = TestUtils.useFakeTimers(sandbox); + expectedTimeout = + (subscriber.ackDeadline * 1000 * 0.9 - subscriber.modAckLatency) * + random; + halfway = expectedTimeout / 2; + }); + + it('should schedule a lease extension', () => { + const message = new FakeMessage() as {} as Message; + const stub = sandbox + .stub(message, 'modAck') + .withArgs(subscriber.ackDeadline); + + leaseManager.add(message); + clock.tick(expectedTimeout); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should schedule a lease extension for exactly-once delivery', () => { + const message = new FakeMessage() as {} as Message; + const stub = sandbox + .stub(message, 'modAck') + .withArgs(subscriber.ackDeadline); + + leaseManager.add(message); + clock.tick(expectedTimeout); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should not schedule a lease extension if already in progress', () => { + const messages = [new FakeMessage(), new FakeMessage()]; + const stubs = messages.map(message => sandbox.stub(message, 'modAck')); + + // since only 1 timeout should be set, even if add messages at different + // times, they should all get extended at the same time + messages.forEach(message => { + leaseManager.add(message as {} as Message); + clock.tick(halfway); + }); + + messages.forEach((fakeMessage, i) => { + const [deadline] = stubs[i].lastCall.args as {} as [number]; + assert.strictEqual(deadline, subscriber.ackDeadline); + }); + }); + + it('should remove any messages that pass the maxExtensionMinutes value', () => { + const maxExtensionSeconds = (expectedTimeout - 100) / 1000; + const badMessages = [new FakeMessage(), new FakeMessage()]; + + subscriber.maxExtensionTime = Duration.from({ + seconds: maxExtensionSeconds, + }); + badMessages.forEach(message => + leaseManager.add(message as {} as Message), + ); + clock.tick(halfway); + + // only message that shouldn't be forgotten + const goodMessage = new FakeMessage(); + const removeStub = sandbox.stub(leaseManager, 'remove'); + const modAckStub = sandbox.stub(goodMessage, 'modAck'); + + fakeLog = new FakeLog(leaseTypes.logs.expiry); + + leaseManager.add(goodMessage as {} as Message); + clock.tick(halfway); + + // make sure the expired messages were forgotten + assert.strictEqual(removeStub.callCount, badMessages.length); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.WARNING, + ); + assert.strictEqual(fakeLog.called, true); + + badMessages.forEach((fakeMessage, i) => { + const [message] = removeStub.getCall(i).args; + assert.strictEqual(message, fakeMessage); + }); + + const [deadline] = modAckStub.lastCall.args as {} as [number]; + assert.strictEqual(deadline, subscriber.ackDeadline); + }); + + it('should remove and ackFailed any messages that fail to ack', done => { + (subscriber as unknown as FakeSubscriber).isExactlyOnceDelivery = true; + + subscriber.maxExtensionTime = Duration.from({minutes: 600}); + + const goodMessage = new FakeMessage(); + + const removeStub = sandbox.stub(leaseManager, 'remove'); + const mawrStub = sandbox + .stub(goodMessage, 'modAckWithResponse') + .rejects(new AckError(AckResponses.Invalid)); + const failed = sandbox.stub(goodMessage, 'ackFailed'); + + removeStub.callsFake(() => { + assert.strictEqual(mawrStub.callCount, 1); + assert.strictEqual(removeStub.callCount, 1); + assert.strictEqual(failed.callCount, 1); + done(); + }); + + leaseManager.add(goodMessage as {} as Message); + clock.tick(halfway * 2 + 1); + }); + + it('should continuously extend the deadlines', () => { + const message = new FakeMessage(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const stub = (sandbox as any) + .stub(message, 'modAck') + .withArgs(subscriber.ackDeadline); + + leaseManager.add(message as {} as Message); + clock.tick(expectedTimeout); + + assert.strictEqual(stub.callCount, 1); + clock.tick(expectedTimeout); + assert.strictEqual(stub.callCount, 2); + }); + }); + }); + + describe('clear', () => { + it('should completely clear out the inventory', () => { + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.clear(); + + assert.strictEqual(leaseManager.bytes, 0); + assert.strictEqual(leaseManager.size, 0); + }); + + it('should emit the free event if it was full', done => { + leaseManager.setOptions({maxMessages: 1}); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.on('free', done); + + setImmediate(() => leaseManager.clear()); + }); + + it('should log if it was full and is now empty', () => { + fakeLog = new FakeLog(leaseTypes.logs.subscriberFlowControl); + const pendingStub = sandbox.stub(leaseManager, 'pending'); + pendingStub.get(() => 0); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.clear(); + assert.strictEqual(fakeLog.called, false); + + pendingStub.get(() => 1); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.clear(); + assert.strictEqual(fakeLog.called, true); + }); + + it('should cancel any lease extensions', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const stub = sandbox.stub(subscriber, 'modAck').resolves(); + + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.clear(); + + // this would otherwise trigger a minimum of 2 modAcks + clock.tick(subscriber.ackDeadline * 1000 * 2); + + assert.strictEqual(stub.callCount, 0); + }); + }); + + describe('isFull', () => { + it('should return true if the maxMessages threshold is hit', () => { + const maxMessages = 1; + + leaseManager.setOptions({maxMessages}); + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.add(new FakeMessage() as {} as Message); + + assert.strictEqual(leaseManager.isFull(), true); + }); + + it('should return true if the maxBytes threshold is hit', () => { + const message = new FakeMessage(); + const maxBytes = message.length - 1; + + leaseManager.setOptions({maxBytes}); + leaseManager.add(message as {} as Message); + + assert.strictEqual(leaseManager.isFull(), true); + }); + + it('should return false if no thresholds are hit', () => { + const message = new FakeMessage(); + const maxMessages = 2; + const maxBytes = message.length + 1; + + leaseManager.setOptions({maxMessages, maxBytes}); + leaseManager.add(message as {} as Message); + + assert.strictEqual(leaseManager.isFull(), false); + }); + }); + + describe('remove', () => { + it('should noop for unknown messages', () => { + const message = new FakeMessage(); + + leaseManager.add(message as {} as Message); + leaseManager.remove(new FakeMessage() as {} as Message); + + assert.strictEqual(leaseManager.size, 1); + assert.strictEqual(leaseManager.bytes, message.length); + }); + + it('should update the bytes/size values', () => { + const message = new FakeMessage() as {} as Message; + + leaseManager.add(message); + leaseManager.remove(message); + + assert.strictEqual(leaseManager.size, 0); + assert.strictEqual(leaseManager.bytes, 0); + }); + + it('should emit the free event if there is free space', done => { + const message = new FakeMessage() as {} as Message; + + leaseManager.setOptions({maxMessages: 1}); + leaseManager.add(message); + setImmediate(() => leaseManager.remove(message)); + + leaseManager.on('free', () => { + assert.strictEqual(leaseManager.size, 0); + done(); + }); + }); + + it('should remove a message from the pending state', done => { + const pending = new FakeMessage() as {} as Message; + + leaseManager.setOptions({allowExcessMessages: false, maxMessages: 1}); + + subscriber.on('message', message => { + if (message === pending) { + done(new Error('Pending messages should not be emitted.')); + } + }); + + leaseManager.add(new FakeMessage() as {} as Message); + leaseManager.add(pending); + leaseManager.remove(pending); + + assert.strictEqual(leaseManager.pending, 0); + setImmediate(done); + }); + + it('should dispense a pending message', done => { + const temp = new FakeMessage() as {} as Message; + const pending = new FakeMessage() as {} as Message; + + leaseManager.setOptions({allowExcessMessages: false, maxMessages: 1}); + + subscriber.on('message', message => { + if (message === temp) { + return; + } + + assert.strictEqual(leaseManager.size, 1); + assert.strictEqual(message, pending); + done(); + }); + + leaseManager.add(temp); + leaseManager.add(pending); + leaseManager.remove(temp); + }); + + it('log when dispensing a pending message', () => { + const temp = new FakeMessage() as {} as Message; + const pending = new FakeMessage() as {} as Message; + + leaseManager.setOptions({allowExcessMessages: false, maxMessages: 1}); + fakeLog = new FakeLog(leaseTypes.logs.subscriberFlowControl); + + leaseManager.add(temp); + leaseManager.add(pending); + leaseManager.remove(temp); + assert.strictEqual(fakeLog.called, true); + }); + + it('should cancel any extensions if no messages are left', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const message = new FakeMessage() as {} as Message; + const stub = sandbox.stub(subscriber, 'modAck').resolves(); + + leaseManager.add(message); + leaseManager.remove(message); + + clock.tick(subscriber.ackDeadline * 1000 * 2); + + assert.strictEqual(stub.callCount, 0); + }); + }); + + describe('setOptions', () => { + it('should allow excess messages by default', () => {}); + + it('should default maxBytes', () => { + const littleMessage = new FakeMessage() as {} as Message; + const bigMessage = new FakeMessage(); + + leaseManager.add(littleMessage); + assert.strictEqual(leaseManager.isFull(), false); + + leaseManager.remove(littleMessage); + bigMessage.length = defaultOptions.subscription.maxOutstandingBytes * 2; + leaseManager.add(bigMessage as {} as Message); + assert.strictEqual(leaseManager.isFull(), true); + }); + + it('should cap maxMessages', () => { + for ( + let i = 0; + i < defaultOptions.subscription.maxOutstandingMessages; + i++ + ) { + assert.strictEqual(leaseManager.isFull(), false); + leaseManager.add(new FakeMessage() as {} as Message); + } + + assert.strictEqual(leaseManager.isFull(), true); + }); + }); + + describe('deadline extension', () => { + beforeEach(() => { + TestUtils.useFakeTimers(sandbox); + }); + afterEach(() => { + sandbox.clock.restore(); + }); + + it('calls regular modAck periodically w/o exactly-once', () => { + const lmi = getLMInternals(leaseManager); + const msg = new Message(subscriber, { + ackId: 'ackack', + message: {data: ''}, + deliveryAttempt: 0, + }); + sandbox.clock.tick(1); + + const maStub = sandbox.stub(msg, 'modAck'); + + lmi._messages.add(msg); + lmi._extendDeadlines(); + + assert.ok(maStub.calledOnce); + }); + + it('calls modAckWithResponse periodically w/exactly-once, successful', async () => { + const lmi = getLMInternals(leaseManager); + const msg = new Message(subscriber, { + ackId: 'ackack', + message: {data: ''}, + deliveryAttempt: 0, + }); + sandbox.clock.tick(1); + (subscriber as unknown as FakeSubscriber).isExactlyOnceDelivery = true; + + const done = defer(); + sandbox.stub(msg, 'modAck').callsFake(() => { + console.error('oops we did it wrong'); + }); + + const maStub = sandbox.stub(msg, 'modAckWithResponse'); + maStub.callsFake(async () => { + done.resolve(); + return AckResponses.Success; + }); + + lmi._messages.add(msg); + lmi._extendDeadlines(); + + await done.promise; + assert.ok(maStub.calledOnce); + }); + + it('calls modAckWithResponse periodically w/exactly-once, failure', async () => { + const lmi = getLMInternals(leaseManager); + const msg = new Message(subscriber, { + ackId: 'ackack', + message: {data: ''}, + deliveryAttempt: 0, + }); + sandbox.clock.tick(1); + (subscriber as unknown as FakeSubscriber).isExactlyOnceDelivery = true; + + const done = defer(); + + const maStub = sandbox.stub(msg, 'modAckWithResponse'); + maStub.callsFake(async () => { + done.resolve(); + throw new AckError(AckResponses.Invalid); + }); + const rmStub = sandbox.stub(leaseManager, 'remove'); + + lmi._messages.add(msg); + lmi._extendDeadlines(); + + await done.promise; + + assert.ok(maStub.calledOnce); + assert.ok(rmStub.calledOnce); + }); + }); +}); diff --git a/handwritten/pubsub/test/message-queues.ts b/handwritten/pubsub/test/message-queues.ts new file mode 100644 index 00000000000..f91129e7da6 --- /dev/null +++ b/handwritten/pubsub/test/message-queues.ts @@ -0,0 +1,915 @@ +/*! + * Copyright 2018 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import {EventEmitter} from 'events'; +import {CallOptions, GoogleError, loggingUtils, Status} from 'google-gax'; +import * as sinon from 'sinon'; +import * as uuid from 'uuid'; +import defer = require('p-defer'); + +import * as messageTypes from '../src/message-queues'; +import {BatchError} from '../src/message-queues'; +import {Message, Subscriber} from '../src/subscriber'; +import {DebugMessage} from '../src/debug'; +import {FakeLog, TestUtils} from './test-utils'; + +class FakeClient { + async acknowledge( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + reqOpts: {subscription: string; ackIds: string[]}, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + callOptions: CallOptions, + ): Promise {} + async modifyAckDeadline( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + reqOpts: { + subscription: string; + ackIds: string[]; + ackDeadlineSeconds: number; + }, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + callOptions: CallOptions, + ): Promise {} +} + +class FakeSubscriber extends EventEmitter { + name: string; + client: FakeClient; + iEOS: boolean; + + constructor() { + super(); + + this.name = `projects/test/subscriptions/${uuid.v4()}`; + this.client = new FakeClient(); + this.iEOS = false; + } + async getClient(): Promise { + return this.client; + } + get isExactlyOnceDelivery(): boolean { + return this.iEOS; + } +} + +class FakeMessage { + ackId: string; + constructor() { + this.ackId = uuid.v4(); + } +} + +function fakeMessage() { + return new FakeMessage() as unknown as Message; +} + +class MessageQueue extends messageTypes.MessageQueue { + batches: messageTypes.QueuedMessages[] = []; + protected getType(): string { + return 'test'; + } + async _sendBatch( + batch: messageTypes.QueuedMessages, + ): Promise { + this.batches.push(batch); + return []; + } +} + +class AckQueue extends messageTypes.AckQueue { + get requests() { + return this._requests; + } +} + +class ModAckQueue extends messageTypes.ModAckQueue { + get requests() { + return this._requests; + } +} + +describe('MessageQueues', () => { + const sandbox = sinon.createSandbox(); + + let fakeSubscriber: FakeSubscriber; + let subscriber: Subscriber; + + before(() => {}); + + beforeEach(() => { + fakeSubscriber = new FakeSubscriber(); + subscriber = fakeSubscriber as unknown as Subscriber; + }); + + afterEach(() => sandbox.restore()); + + describe('MessageQueue', () => { + let messageQueue: MessageQueue; + + beforeEach(() => { + messageQueue = new MessageQueue(subscriber); + }); + + describe('initialization', () => { + it('should default numPendingRequests', () => { + assert.strictEqual(messageQueue.numPendingRequests, 0); + }); + + it('should set any provided options', () => { + const fakeOptions = {}; + const stub = sandbox.stub(MessageQueue.prototype, 'setOptions'); + new MessageQueue(subscriber, fakeOptions); + + const [options] = stub.lastCall.args; + assert.strictEqual(options, fakeOptions); + }); + }); + + describe('maxMilliseconds', () => { + it('should return the maxMilliseconds option', () => { + const maxMilliseconds = 101; + + messageQueue.setOptions({maxMilliseconds}); + assert.strictEqual(messageQueue.maxMilliseconds, maxMilliseconds); + }); + }); + + describe('add', () => { + it('should increase the number of pending requests', () => { + void messageQueue.add(new FakeMessage() as Message); + assert.strictEqual(messageQueue.numPendingRequests, 1); + }); + + it('should flush the queue if at capacity', () => { + const stub = sandbox.stub(messageQueue, 'flush'); + + messageQueue.setOptions({maxMessages: 1}); + void messageQueue.add(new FakeMessage() as Message); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should flush the queue if at byte capacity', () => { + const stub = sandbox.stub(messageQueue, 'flush'); + + messageQueue.bytes = messageTypes.MAX_BATCH_BYTES - 10; + void messageQueue.add(new FakeMessage() as Message); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should schedule a flush if needed', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const stub = sandbox.stub(messageQueue, 'flush'); + const delay = 1000; + + messageQueue.setOptions({maxMilliseconds: delay}); + void messageQueue.add(new FakeMessage() as Message); + + assert.strictEqual(stub.callCount, 0); + clock.tick(delay); + assert.strictEqual(stub.callCount, 1); + }); + + it('should return a Promise that resolves when the ack is sent', async () => { + const clock = TestUtils.useFakeTimers(sandbox); + const delay = 1000; + messageQueue.setOptions({maxMilliseconds: delay}); + + sandbox + .stub(messageQueue, '_sendBatch') + .callsFake((batch: messageTypes.QueuedMessages) => { + batch.forEach(m => { + m.responsePromise?.resolve(); + }); + return Promise.resolve([]); + }); + + const completion = messageQueue.add(new FakeMessage() as Message); + clock.tick(delay); + await completion; + }); + }); + + describe('flush', () => { + it('should cancel scheduled flushes', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const spy = sandbox.spy(messageQueue, 'flush'); + const delay = 1000; + + messageQueue.setOptions({maxMilliseconds: delay}); + void messageQueue.add(new FakeMessage() as Message); + void messageQueue.flush('test'); + clock.tick(delay); + + assert.strictEqual(spy.callCount, 1); + }); + + it('should remove the messages from the queue', () => { + void messageQueue.add(new FakeMessage() as Message); + void messageQueue.flush('test'); + + assert.strictEqual(messageQueue.numPendingRequests, 0); + }); + + it('should remove the bytes of messages from the queue', () => { + void messageQueue.add(new FakeMessage() as Message); + void messageQueue.flush('test'); + + assert.strictEqual(messageQueue.bytes, 0); + }); + + it('should send the batch', () => { + const message = new FakeMessage(); + const deadline = 10; + + void messageQueue.add(message as Message, deadline); + void messageQueue.flush('test'); + + const [batch] = messageQueue.batches; + assert.strictEqual(batch[0].message.ackId, message.ackId); + assert.strictEqual(batch[0].deadline, deadline); + assert.ok(batch[0].responsePromise?.resolve); + }); + + it('should emit any errors as debug events', done => { + const fakeError = new Error('err'); + + sandbox.stub(messageQueue.batches, 'push').throws(fakeError); + + subscriber.on('debug', msg => { + assert.strictEqual(msg.message, fakeError.message); + done(); + }); + + void messageQueue.flush('test'); + }); + + it('should resolve any pending promises', async () => { + const promise = messageQueue.onFlush(); + setImmediate(async () => await messageQueue.flush('test')); + return promise; + }); + + it('should resolve onDrain only after all in-flight messages have been flushed', async () => { + const log: string[] = []; + const sendDone = defer(); + sandbox.stub(messageQueue, '_sendBatch').callsFake(async () => { + log.push('send:start'); + await sendDone.promise; + log.push('send:end'); + return []; + }); + + const message = new FakeMessage(); + const deadline = 10; + const onDrainBeforeFlush = messageQueue + .onDrain() + .then(() => log.push('drain1')); + void messageQueue.add(message as Message, deadline); + void messageQueue.flush('test'); + assert.deepStrictEqual(log, ['send:start']); + sendDone.resolve(); + await messageQueue.onDrain().then(() => log.push('drain2')); + await onDrainBeforeFlush; + + assert.deepStrictEqual(log, [ + 'send:start', + 'send:end', + 'drain1', + 'drain2', + ]); + }); + }); + + describe('onFlush', () => { + it('should create a promise', () => { + const promise = messageQueue.onFlush(); + + assert(promise instanceof Promise); + }); + + it('should re-use existing promises', () => { + const promise1 = messageQueue.onFlush(); + const promise2 = messageQueue.onFlush(); + + assert.strictEqual(promise1, promise2); + }); + }); + + describe('onDrain', () => { + it('should create a promise', () => { + const promise = messageQueue.onDrain(); + + assert(promise instanceof Promise); + }); + + it('should re-use existing promises', () => { + const promise1 = messageQueue.onDrain(); + const promise2 = messageQueue.onDrain(); + + assert.strictEqual(promise1, promise2); + }); + }); + + describe('setOptions', () => { + it('should default maxMessages to 3000', () => { + const stub = sandbox.stub(messageQueue, 'flush'); + + for (let i = 0; i < 3000; i++) { + assert.strictEqual(stub.callCount, 0); + void messageQueue.add(fakeMessage()); + } + + assert.strictEqual(stub.callCount, 1); + }); + + it('should respect user supplied maxMessages', () => { + const stub = sandbox.stub(messageQueue, 'flush'); + const maxMessages = 100; + + messageQueue.setOptions({maxMessages}); + + for (let i = 0; i < maxMessages; i++) { + assert.strictEqual(stub.callCount, 0); + void messageQueue.add(fakeMessage()); + } + + assert.strictEqual(stub.callCount, 1); + }); + + it('should default maxMilliseconds to 100', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const stub = sandbox.stub(messageQueue, 'flush'); + + void messageQueue.add(fakeMessage()); + clock.tick(100); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should respect user supplied maxMilliseconds', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const stub = sandbox.stub(messageQueue, 'flush'); + const maxMilliseconds = 10000; + + messageQueue.setOptions({maxMilliseconds}); + void messageQueue.add(fakeMessage()); + clock.tick(maxMilliseconds); + + assert.strictEqual(stub.callCount, 1); + }); + }); + }); + + describe('AckQueue', () => { + let ackQueue: AckQueue; + + beforeEach(() => { + ackQueue = new AckQueue(subscriber); + }); + + it('should send batches via Client#acknowledge', async () => { + const messages = [ + new FakeMessage(), + new FakeMessage(), + new FakeMessage(), + ]; + + const stub = sandbox + .stub(fakeSubscriber.client, 'acknowledge') + .resolves(); + const expectedReqOpts = { + subscription: subscriber.name, + ackIds: messages.map(({ackId}) => ackId), + }; + + messages.forEach(message => ackQueue.add(message as Message)); + await ackQueue.flush('test'); + + const [reqOpts] = stub.lastCall.args; + assert.deepStrictEqual(reqOpts, expectedReqOpts); + }); + + it('should make a log message about batch sends', async () => { + const messages = [new FakeMessage()]; + + sandbox.stub(fakeSubscriber.client, 'acknowledge').resolves(); + const fakeLog = new FakeLog(messageTypes.logs.ackBatch); + + messages.forEach(message => ackQueue.add(message as Message)); + await ackQueue.flush('logtest'); + + fakeLog.remove(); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'logtest'); + }); + + it('should send call options', async () => { + const fakeCallOptions = {timeout: 10000}; + const stub = sandbox + .stub(fakeSubscriber.client, 'acknowledge') + .resolves(); + + ackQueue.setOptions({callOptions: fakeCallOptions}); + await ackQueue.flush('test'); + + const [, callOptions] = stub.lastCall.args; + assert.strictEqual(callOptions, fakeCallOptions); + }); + + it('should throw a BatchError on "debug" if unable to ack due to grpc error', done => { + const messages = [ + new FakeMessage(), + new FakeMessage(), + new FakeMessage(), + ]; + + const ackIds = messages.map(message => message.ackId); + + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + + // Since this runs without EOS enabled, we should get the old error handling. + const expectedMessage = 'Failed to "ack" for 3 message(s). Reason: Err.'; + + sandbox.stub(fakeSubscriber.client, 'acknowledge').rejects(fakeError); + + subscriber.on('debug', (msg: DebugMessage) => { + try { + assert.strictEqual(msg.message, expectedMessage); + const batchError = msg.error! as unknown as BatchError; + assert.strictEqual(batchError.message, expectedMessage); + assert.deepStrictEqual(batchError.ackIds, ackIds); + assert.strictEqual(batchError.code, fakeError.code); + done(); + } catch (e) { + // I'm unsure why Mocha's regular handler doesn't work here, + // but manually throw the exception from asserts. + done(e); + } + }); + + messages.forEach(message => ackQueue.add(message as Message)); + void ackQueue.flush('test'); + }); + + // The analogous modAck version is very similar, so please sync changes. + describe('handle ack responses when !isExactlyOnceDelivery', () => { + it('should appropriately resolve result promises when !isExactlyOnceDelivery', async () => { + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + + const stub = sandbox + .stub(fakeSubscriber.client, 'acknowledge') + .rejects(fakeError); + + const message = new FakeMessage() as Message; + const completion = ackQueue.add(message); + await ackQueue.flush('test'); + assert.strictEqual(stub.callCount, 1); + await assert.doesNotReject(completion); + }); + }); + + // The analogous modAck version is very similar, so please sync changes. + describe('handle ack responses for exactly-once delivery', () => { + beforeEach(() => { + fakeSubscriber.iEOS = true; + }); + + it('should trigger Promise resolves on no errors', async () => { + const messages = [fakeMessage(), fakeMessage(), fakeMessage()]; + messages.forEach(m => ackQueue.add(m)); + + sandbox.stub(fakeSubscriber.client, 'acknowledge').resolves(); + const proms = ackQueue.requests.map( + (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, + ); + await ackQueue.flush('test'); + const results = await Promise.allSettled(proms); + const oneSuccess = {status: 'fulfilled', value: undefined}; + assert.deepStrictEqual(results, [oneSuccess, oneSuccess, oneSuccess]); + }); + + it('should trigger Promise failures on grpc errors', async () => { + const messages = [fakeMessage(), fakeMessage(), fakeMessage()]; + + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + fakeError.errorInfoMetadata = { + // These should be routed by the errorInfo resolver. + [messages[0].ackId]: 'TRANSIENT_CAT_ATE_HOMEWORK', + }; + + messages.forEach(m => ackQueue.add(m)); + + sandbox.stub(fakeSubscriber.client, 'acknowledge').rejects(fakeError); + const proms = ackQueue.requests.map( + (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, + ); + void proms.shift(); + await ackQueue.flush('test'); + + const results = await Promise.allSettled(proms); + assert.strictEqual(results[0].status, 'rejected'); + assert.strictEqual(results[0].reason?.errorCode, 'OTHER'); + assert.strictEqual(results[1].status, 'rejected'); + assert.strictEqual(results[1].reason?.errorCode, 'OTHER'); + + // Make sure the one handled by errorInfo was retried. + assert.strictEqual(ackQueue.numInRetryRequests, 1); + }); + + it('should correctly handle a mix of errors and successes', async () => { + const messages = [fakeMessage(), fakeMessage(), fakeMessage()]; + + const fakeError = new Error('Err.') as GoogleError; + delete fakeError.code; + fakeError.errorInfoMetadata = { + [messages[0].ackId]: 'PERMANENT_FAILURE_INVALID_ACK_ID', + [messages[1].ackId]: 'TRANSIENT_CAT_ATE_HOMEWORK', + }; + + messages.forEach(m => ackQueue.add(m)); + + sandbox.stub(fakeSubscriber.client, 'acknowledge').rejects(fakeError); + + const proms = [ + ackQueue.requests[0].responsePromise!.promise, + ackQueue.requests[2].responsePromise!.promise, + ]; + await ackQueue.flush('test'); + + const results = await Promise.allSettled(proms); + assert.strictEqual(results[0].status, 'rejected'); + assert.strictEqual(results[0].reason?.errorCode, 'INVALID'); + + // Since there's no RPC error, the last one should've succeeded. + const oneSuccess = {status: 'fulfilled', value: undefined}; + assert.deepStrictEqual(results[1], oneSuccess); + + // Make sure the transient one was retried. + assert.strictEqual(ackQueue.numInRetryRequests, 1); + }); + + // This is separate because the retry mechanism itself could fail, and + // we want to make sure that transients actually make it back into the + // queue for retry. + // + // This doesn't need to be duplicated down to modAck because it's just + // testing common code. + it('should retry transient failures', async () => { + const clock = TestUtils.useFakeTimers(sandbox); + sandbox.stub(global.Math, 'random').returns(0.5); + + const message = fakeMessage(); + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + fakeError.errorInfoMetadata = { + // These should be routed by the errorInfo resolver. + [message.ackId]: 'TRANSIENT_CAT_ATE_HOMEWORK', + }; + + sandbox.stub(fakeSubscriber.client, 'acknowledge').rejects(fakeError); + void ackQueue.add(message); + await ackQueue.flush('test'); + + // Make sure the one handled by errorInfo was retried. + assert.strictEqual(ackQueue.numInRetryRequests, 1); + + // And wait for a second attempt. + clock.tick(1000); + + assert.strictEqual(ackQueue.requests.length, 1); + assert.strictEqual(ackQueue.requests[0].message.ackId, message.ackId); + assert.strictEqual(ackQueue.numInRetryRequests, 0); + assert.strictEqual(ackQueue.numPendingRequests, 1); + }); + }); + + it('should appropriately resolve result promises', async () => { + const stub = sandbox + .stub(fakeSubscriber.client, 'acknowledge') + .resolves(); + + const message = new FakeMessage() as Message; + const completion = ackQueue.add(message); + await ackQueue.flush('test'); + assert.strictEqual(stub.callCount, 1); + await completion; + }); + + it('should appropriately reject result promises', async () => { + const stub = sandbox + .stub(fakeSubscriber.client, 'acknowledge') + .resolves(); + + const message = new FakeMessage() as Message; + const completion = ackQueue.add(message); + await ackQueue.flush('test'); + assert.strictEqual(stub.callCount, 1); + await completion; + }); + }); + + describe('ModAckQueue', () => { + let modAckQueue: ModAckQueue; + + beforeEach(() => { + modAckQueue = new ModAckQueue(subscriber); + }); + + it('should send batches via Client#modifyAckDeadline', async () => { + const deadline = 600; + const messages = [ + new FakeMessage(), + new FakeMessage(), + new FakeMessage(), + ]; + + const stub = sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .resolves(); + + const expectedReqOpts = { + subscription: subscriber.name, + ackDeadlineSeconds: deadline, + ackIds: messages.map(({ackId}) => ackId), + }; + + messages.forEach(message => + modAckQueue.add(message as Message, deadline), + ); + await modAckQueue.flush('test'); + + const [reqOpts] = stub.lastCall.args; + assert.deepStrictEqual(reqOpts, expectedReqOpts); + }); + + it('should make a log message about batch sends', async () => { + const messages = [new FakeMessage()]; + + sandbox.stub(fakeSubscriber.client, 'modifyAckDeadline').resolves(); + const fakeLog = new FakeLog(messageTypes.logs.ackBatch); + + messages.forEach(message => modAckQueue.add(message as Message)); + await modAckQueue.flush('logtest'); + + fakeLog.remove(); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'logtest'); + }); + + it('should group ackIds by deadline', async () => { + const deadline1 = 600; + const deadline2 = 1000; + + const messages1 = [ + new FakeMessage(), + new FakeMessage(), + new FakeMessage(), + ]; + const messages2 = [ + new FakeMessage(), + new FakeMessage(), + new FakeMessage(), + ]; + + const stub = sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .resolves(); + + const expectedReqOpts1 = { + subscription: subscriber.name, + ackDeadlineSeconds: deadline1, + ackIds: messages1.map(({ackId}) => ackId), + }; + + const expectedReqOpts2 = { + subscription: subscriber.name, + ackDeadlineSeconds: deadline2, + ackIds: messages2.map(({ackId}) => ackId), + }; + + messages1.forEach(message => + modAckQueue.add(message as Message, deadline1), + ); + messages2.forEach(message => + modAckQueue.add(message as Message, deadline2), + ); + await modAckQueue.flush('test'); + + const [reqOpts1] = stub.getCall(0).args; + assert.deepStrictEqual(reqOpts1, expectedReqOpts1); + + const [reqOpts2] = stub.getCall(1).args; + assert.deepStrictEqual(reqOpts2, expectedReqOpts2); + }); + + it('should send call options', async () => { + const fakeCallOptions = {timeout: 10000}; + const stub = sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .resolves(); + + modAckQueue.setOptions({callOptions: fakeCallOptions}); + await modAckQueue.add(new FakeMessage() as Message, 10); + await modAckQueue.flush('test'); + + const [, callOptions] = stub.lastCall.args; + assert.strictEqual(callOptions, fakeCallOptions); + }); + + it('should throw a BatchError on "debug" if unable to modAck due to gRPC error', done => { + const messages = [ + new FakeMessage(), + new FakeMessage(), + new FakeMessage(), + ]; + + const ackIds = messages.map(message => message.ackId); + + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + + // Since this runs without EOS enabled, we should get the old error handling. + const expectedMessage = + 'Failed to "modAck" for 3 message(s). Reason: Err.'; + + sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .rejects(fakeError); + + subscriber.on('debug', (msg: DebugMessage) => { + try { + assert.strictEqual(msg.message, expectedMessage); + const batchError = msg.error! as unknown as BatchError; + assert.strictEqual(batchError.message, expectedMessage); + assert.deepStrictEqual(batchError.ackIds, ackIds); + assert.strictEqual(batchError.code, fakeError.code); + done(); + } catch (e) { + // I'm unsure why Mocha's regular handler doesn't work here, + // but manually throw the exception from asserts. + done(e); + } + }); + + messages.forEach(message => modAckQueue.add(message as Message)); + void modAckQueue.flush('test'); + }); + + describe('handle modAck responses when !isExactlyOnceDelivery', () => { + it('should appropriately resolve result promises when !isExactlyOnceDelivery', async () => { + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + + const stub = sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .rejects(fakeError); + + const message = new FakeMessage() as Message; + const completion = modAckQueue.add(message); + await modAckQueue.flush('test'); + assert.strictEqual(stub.callCount, 1); + await assert.doesNotReject(completion); + }); + }); + + // The analogous ack version is very similar, so please sync changes. + describe('handle modAck responses for exactly-once delivery', () => { + beforeEach(() => { + fakeSubscriber.iEOS = true; + }); + + it('should trigger Promise resolves on no errors', async () => { + const messages = [fakeMessage(), fakeMessage(), fakeMessage()]; + messages.forEach(m => modAckQueue.add(m)); + + sandbox.stub(fakeSubscriber.client, 'modifyAckDeadline').resolves(); + const proms = modAckQueue.requests.map( + (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, + ); + await modAckQueue.flush('test'); + const results = await Promise.allSettled(proms); + const oneSuccess = {status: 'fulfilled', value: undefined}; + assert.deepStrictEqual(results, [oneSuccess, oneSuccess, oneSuccess]); + }); + + it('should trigger Promise failures on grpc errors', async () => { + const messages = [fakeMessage(), fakeMessage(), fakeMessage()]; + + const fakeError = new Error('Err.') as GoogleError; + fakeError.code = Status.DATA_LOSS; + fakeError.errorInfoMetadata = { + // These should be routed by the errorInfo resolver. + [messages[0].ackId]: 'TRANSIENT_CAT_ATE_HOMEWORK', + }; + + messages.forEach(m => modAckQueue.add(m)); + + sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .rejects(fakeError); + const proms = modAckQueue.requests.map( + (r: messageTypes.QueuedMessage) => r.responsePromise!.promise, + ); + void proms.shift(); + await modAckQueue.flush('test'); + + const results = await Promise.allSettled(proms); + assert.strictEqual(results[0].status, 'rejected'); + assert.strictEqual(results[0].reason?.errorCode, 'OTHER'); + assert.strictEqual(results[1].status, 'rejected'); + assert.strictEqual(results[1].reason?.errorCode, 'OTHER'); + + // Make sure the one handled by errorInfo was retried. + assert.strictEqual(modAckQueue.numInRetryRequests, 1); + }); + + it('should correctly handle a mix of errors and successes', async () => { + const messages = [fakeMessage(), fakeMessage(), fakeMessage()]; + + const fakeError = new Error('Err.') as GoogleError; + delete fakeError.code; + fakeError.errorInfoMetadata = { + [messages[0].ackId]: 'PERMANENT_FAILURE_INVALID_ACK_ID', + [messages[1].ackId]: 'TRANSIENT_CAT_ATE_HOMEWORK', + }; + + messages.forEach(m => modAckQueue.add(m)); + + sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .rejects(fakeError); + + const proms = [ + modAckQueue.requests[0].responsePromise!.promise, + modAckQueue.requests[2].responsePromise!.promise, + ]; + await modAckQueue.flush('test'); + + const results = await Promise.allSettled(proms); + assert.strictEqual(results[0].status, 'rejected'); + assert.strictEqual(results[0].reason?.errorCode, 'INVALID'); + + // Since there's no RPC error, the last one should've succeeded. + const oneSuccess = {status: 'fulfilled', value: undefined}; + assert.deepStrictEqual(results[1], oneSuccess); + + // Make sure the transient one was retried. + assert.strictEqual(modAckQueue.numInRetryRequests, 1); + }); + }); + + it('should appropriately resolve result promises', async () => { + const stub = sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .resolves(); + + const message = new FakeMessage() as Message; + const completion = modAckQueue.add(message); + await modAckQueue.flush('test'); + assert.strictEqual(stub.callCount, 1); + await completion; + }); + + it('should appropriately reject result promises', async () => { + const stub = sandbox + .stub(fakeSubscriber.client, 'modifyAckDeadline') + .resolves(); + + const message = new FakeMessage() as Message; + const completion = modAckQueue.add(message); + await modAckQueue.flush('test'); + assert.strictEqual(stub.callCount, 1); + await completion; + }); + }); +}); diff --git a/handwritten/pubsub/test/message-stream.ts b/handwritten/pubsub/test/message-stream.ts new file mode 100644 index 00000000000..2463d17eb50 --- /dev/null +++ b/handwritten/pubsub/test/message-stream.ts @@ -0,0 +1,558 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import {grpc} from 'google-gax'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import {Duplex, PassThrough} from 'stream'; +import * as uuid from 'uuid'; +import * as defer from 'p-defer'; +import {promisify} from 'util'; + +import * as messageTypes from '../src/message-stream'; +import {Subscriber} from '../src/subscriber'; +import {defaultOptions} from '../src/default-options'; +import {Duration} from '../src/temporal'; +import {TestUtils} from './test-utils'; + +const FAKE_STREAMING_PULL_TIMEOUT = 123456789; +const FAKE_CLIENT_CONFIG = { + interfaces: { + 'google.pubsub.v1.Subscriber': { + methods: { + StreamingPull: { + timeout_millis: FAKE_STREAMING_PULL_TIMEOUT, + }, + }, + }, + }, +}; + +interface StreamState { + highWaterMark: number; +} + +interface StreamOptions { + objectMode?: boolean; + highWaterMark?: number; +} + +interface StreamingPullOptions { + deadline: number; +} + +class FakePassThrough extends PassThrough { + options: StreamOptions; + constructor(options: StreamOptions) { + super(options); + this.options = options; + } +} + +interface AccessReadableState { + _readableState: StreamState; +} + +class FakeGrpcStream extends Duplex { + options: StreamingPullOptions; + constructor(options: StreamingPullOptions) { + super({objectMode: true}); + this.options = options; + } + + get readableState(): StreamState { + return (this as unknown as AccessReadableState)._readableState; + } + + cancel(): void { + const status = { + code: 1, + details: 'Canceled.', + metadata: new grpc.Metadata(), + }; + + process.nextTick(() => { + this.emit('status', status); + this.end(); + }); + } + _write(chunk: object, encoding: string, callback: Function): void { + callback(); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _read(size: number): void {} +} + +class FakeGaxClient { + client: FakeGrpcClient; + subscriberStub: Promise; + constructor() { + this.client = new FakeGrpcClient(); + this.subscriberStub = this.getSubscriberStub(); + } + initialize() { + return this.subscriberStub; + } + async getSubscriberStub(): Promise { + return this.client; + } +} + +class FakeGrpcClient { + deadline?: number; + streams = [] as FakeGrpcStream[]; + streamingPull(options: StreamingPullOptions): FakeGrpcStream { + const stream = new FakeGrpcStream(options); + this.streams.push(stream); + return stream; + } + waitForReady(deadline: number, callback: (err?: Error) => void): void { + this.deadline = deadline; + callback(); + } +} + +class FakeSubscriber { + name: string; + ackDeadline: number; + maxMessages: number; + maxBytes: number; + client: FakeGaxClient; + constructor(client: FakeGaxClient) { + this.name = uuid.v4(); + this.ackDeadline = Math.floor(Math.random() * 600); + this.maxMessages = 20; + this.maxBytes = 4000; + this.client = client; + } + async getClient(): Promise { + return this.client; + } +} + +describe('MessageStream', () => { + const sandbox = sinon.createSandbox(); + + let client: FakeGrpcClient; + let subscriber: Subscriber; + + // tslint:disable-next-line variable-name + let MessageStream: typeof messageTypes.MessageStream; + let messageStream: messageTypes.MessageStream; + + let now: number; + + before(() => { + MessageStream = proxyquire('../src/message-stream.js', { + stream: {PassThrough: FakePassThrough}, + './v1/subscriber_client_config.json': FAKE_CLIENT_CONFIG, + }).MessageStream; + }); + + beforeEach(async () => { + now = Date.now(); + TestUtils.useFakeTimers(sandbox, now); + + const gaxClient = new FakeGaxClient(); + client = gaxClient.client; // we hit the grpc client directly + subscriber = new FakeSubscriber(gaxClient) as {} as Subscriber; + messageStream = new MessageStream(subscriber); + await messageStream.start(); + }); + + afterEach(() => { + messageStream.destroy(); + sandbox.clock.restore(); + sandbox.restore(); + }); + + describe('initialization', () => { + it('should create an object mode stream', () => { + const expectedOptions = { + objectMode: true, + highWaterMark: 0, + }; + assert.deepStrictEqual( + (messageStream as {} as FakePassThrough).options, + expectedOptions, + ); + }); + + it('should respect the highWaterMark option', () => { + const highWaterMark = 3; + const ms = new MessageStream(subscriber, {highWaterMark}); + + const expectedOptions = { + objectMode: true, + highWaterMark, + }; + + assert.deepStrictEqual( + (ms as {} as FakePassThrough).options, + expectedOptions, + ); + }); + + it('should set destroyed to false', () => { + assert.strictEqual(messageStream.destroyed, false); + }); + + describe('options', () => { + describe('defaults', () => { + it('should default highWaterMark to 0', () => { + client.streams.forEach(stream => { + assert.strictEqual(stream.readableState.highWaterMark, 0); + }); + }); + + it('should default maxStreams', () => { + assert.strictEqual( + client.streams.length, + defaultOptions.subscription.maxStreams, + ); + }); + + it('should pull pullTimeouts default from config file', () => { + const expectedDeadline = now + FAKE_STREAMING_PULL_TIMEOUT; + + client.streams.forEach(stream => { + const deadline = stream.options.deadline; + assert.strictEqual(deadline, expectedDeadline); + }); + }); + + it('should default timeout to 5 minutes', () => { + const expectedTimeout = now + 60000 * 5; + + // Floating point calcuations in Duration might make this a few + // microseconds off. + assert.ok(Math.abs(client.deadline! - expectedTimeout) < 10); + }); + }); + + describe('user options', () => { + beforeEach(() => { + messageStream.destroy(); + client.streams.length = 0; + delete client.deadline; + }); + + it('should respect the highWaterMark option', async () => { + const highWaterMark = 3; + + messageStream = new MessageStream(subscriber, {highWaterMark}); + await messageStream.start(); + + await promisify(process.nextTick)(); + + assert.strictEqual( + client.streams.length, + defaultOptions.subscription.maxStreams, + ); + + client.streams.forEach(stream => { + assert.strictEqual( + stream.readableState.highWaterMark, + highWaterMark, + ); + }); + }); + + it('should respect the maxStreams option', async () => { + const maxStreams = 3; + + messageStream = new MessageStream(subscriber, {maxStreams}); + await messageStream.start(); + + await promisify(process.nextTick)(); + assert.strictEqual(client.streams.length, maxStreams); + }); + + it('should respect the timeout option', async () => { + const timeout = 12345; + messageStream = new MessageStream(subscriber, {timeout}); + await messageStream.start(); + + await promisify(process.nextTick)(); + assert.strictEqual(client.deadline, now + timeout); + }); + }); + }); + }); + + describe('destroy', () => { + it('should noop if already destroyed', done => { + messageStream.on('close', done); + + messageStream.destroy(); + messageStream.destroy(); + }); + + it('should set destroyed to true', () => { + messageStream.destroy(); + assert.strictEqual(messageStream.destroyed, true); + }); + + it('should stop keeping the streams alive', () => { + const frequency = 30000; + const stubs = client.streams.map(stream => { + return sandbox.stub(stream, 'write').throws(); + }); + + messageStream.destroy(); + sandbox.clock.tick(frequency * 2); // for good measure + + stubs.forEach(stub => { + assert.strictEqual(stub.callCount, 0); + }); + }); + + it('should unpipe and cancel all underlying streams', () => { + const stubs = [ + ...client.streams.map(stream => { + return sandbox.stub(stream, 'unpipe').withArgs(messageStream); + }), + ...client.streams.map(stream => { + return sandbox.stub(stream, 'cancel'); + }), + ]; + + messageStream.destroy(); + + stubs.forEach(stub => { + assert.strictEqual(stub.callCount, 1); + }); + }); + }); + + describe('pull stream lifecycle', () => { + describe('initialization', () => { + it('should pipe to the message stream', done => { + const fakeResponses = [{}, {}, {}, {}, {}]; + const received: object[] = []; + + messageStream + .on('data', (chunk: Buffer) => received.push(chunk)) + .on('end', () => { + assert.deepStrictEqual(received, fakeResponses); + done(); + }); + + client.streams.forEach((stream, i) => stream.push(fakeResponses[i])); + process.nextTick(() => messageStream.end()); + }); + + it('should not end the message stream', done => { + messageStream + .on('data', () => {}) + .on('end', () => { + done(new Error('Should not be called.')); + }); + + client.streams.forEach(stream => stream.push(null)); + process.nextTick(done); + }); + }); + + describe('on error', () => { + it('should destroy the stream if unable to get client', async () => { + const fakeError = new Error('err'); + + sandbox.stub(subscriber, 'getClient').rejects(fakeError); + + const ms = new MessageStream(subscriber); + + const prom = defer(); + ms.on('error', err => { + assert.strictEqual(err, fakeError); + assert.strictEqual(ms.destroyed, true); + prom.resolve(); + }); + + await ms.start(); + await prom.promise; + }); + + it('should destroy the stream if unable to connect to channel', async () => { + const stub = sandbox.stub(client, 'waitForReady'); + const ms = new MessageStream(subscriber); + const fakeError = new Error('err'); + const expectedMessage = 'Failed to connect to channel. Reason: err'; + + const prom = defer(); + ms.on('error', (err: grpc.ServiceError) => { + assert.strictEqual(err.code, 2); + assert.strictEqual(err.message, expectedMessage); + assert.strictEqual(ms.destroyed, true); + prom.resolve(); + }); + + stub.callsFake((_, callback) => { + _; + process.nextTick(() => callback(fakeError)); + }); + + await ms.start(); + + await prom.promise; + }); + + it('should give a deadline error if waitForReady times out', async () => { + const stub = sandbox.stub(client, 'waitForReady'); + const ms = new MessageStream(subscriber); + const fakeError = new Error('Failed to connect before the deadline'); + + const prom = defer(); + ms.on('error', (err: grpc.ServiceError) => { + assert.strictEqual(err.code, 4); + prom.resolve(); + }); + + stub.callsFake((_, callback) => { + _; + process.nextTick(() => callback(fakeError)); + }); + + await ms.start(); + await prom.promise; + }); + + it('should emit non-status errors', done => { + const fakeError = new Error('err'); + + messageStream.on('error', err => { + assert.strictEqual(err, fakeError); + done(); + }); + + client.streams[0].emit('error', fakeError); + }); + + it('should ignore status errors', done => { + const [stream] = client.streams; + const status = {code: 0}; + + messageStream.on('error', done); + stream.emit('error', status); + stream.emit('status', status); + + process.nextTick(done); + }); + + it('should ignore errors that come in after the status', done => { + const [stream] = client.streams; + + messageStream.on('error', done); + stream.emit('status', {code: 0}); + stream.emit('error', {code: 2}); + + process.nextTick(done); + }); + }); + + describe('on status', () => { + it('should wait for end to fire before creating a new stream', done => { + const [stream] = client.streams; + const expectedCount = stream.listenerCount('end') + 1; + + messageStream.on('error', done); + + stream.emit('status', {code: 2}); + assert.strictEqual(stream.listenerCount('end'), expectedCount); + + stream.push(null); + process.nextTick(() => { + assert.strictEqual(client.streams.length, 5); + done(); + }); + }); + + it('should create a new stream if stream already ended', done => { + const [stream] = client.streams; + + messageStream.on('error', done); + stream.push(null); + + process.nextTick(() => { + const count = stream.listenerCount('end'); + + stream.emit('status', {code: 2}); + assert.strictEqual(stream.listenerCount('end'), count); + + process.nextTick(() => { + assert.strictEqual(client.streams.length, 5); + done(); + }); + }); + }); + + it('should destroy the msg stream if status is not retryable', done => { + const fakeStatus = { + code: 5, + details: 'Err', + }; + + messageStream.on('error', (err: grpc.ServiceError) => { + assert(err instanceof Error); + assert.strictEqual(err.code, fakeStatus.code); + assert.strictEqual(err.message, fakeStatus.details); + assert.strictEqual(messageStream.destroyed, true); + done(); + }); + + client.streams.forEach(stream => { + stream.emit('status', fakeStatus); + stream.push(null); + }); + }); + }); + + describe('keeping streams alive', () => { + it('should keep the streams alive', () => { + const frequency = 30000; + const stubs = client.streams.map(stream => { + return sandbox.stub(stream, 'write'); + }); + + sandbox.clock.tick(frequency * 1.5); + + stubs.forEach(stub => { + const [data] = stub.lastCall.args; + assert.deepStrictEqual(data, {}); + }); + }); + }); + + it('should allow updating the ack deadline', async () => { + const stubs = client.streams.map(stream => { + return sandbox.stub(stream, 'write'); + }); + + messageStream.setStreamAckDeadline(Duration.from({seconds: 10})); + + const expected = { + streamAckDeadlineSeconds: 10, + }; + + stubs.forEach(stub => { + const [data] = stub.lastCall.args; + assert.deepStrictEqual(data, expected); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/publisher/flow-control.ts b/handwritten/pubsub/test/publisher/flow-control.ts new file mode 100644 index 00000000000..75340518644 --- /dev/null +++ b/handwritten/pubsub/test/publisher/flow-control.ts @@ -0,0 +1,107 @@ +/*! + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it} from 'mocha'; + +import * as fc from '../../src/publisher/flow-control'; + +describe('Flow Controller', () => { + const optionsDefault: fc.FlowControlOptions = { + maxOutstandingMessages: 5, + maxOutstandingBytes: 100, + }; + + it('does basic bookkeeping correctly', async () => { + const flow = new fc.FlowControl(optionsDefault); + await flow.willSend(10, 1); + assert.strictEqual(flow.currentByteCount, 10); + assert.strictEqual(flow.currentMessageCount, 1); + }); + + // This is an internal detail we really don't want to expose even inside + // the library, so this function will get it for us in one place. + function requestQueue(flow: fc.FlowControl) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (flow as any).requests; + } + + it('queues up a promise when bytes are exceeded', async () => { + const flow = new fc.FlowControl(optionsDefault); + const promise = flow.willSend(1000, 1); + const requests = requestQueue(flow); + assert.strictEqual(requests.length, 1); + requests[0].resolve(); + await promise; + }); + + it('queues up a promise when messages are exceeded', async () => { + const flow = new fc.FlowControl(optionsDefault); + const promise = flow.willSend(10, 100); + const requests = requestQueue(flow); + assert.strictEqual(requests.length, 1); + requests[0].resolve(); + await promise; + }); + + it('releases a publisher when space is freed', async () => { + const flow = new fc.FlowControl(optionsDefault); + const promise = flow.willSend(1000, 1); + const requests = requestQueue(flow); + assert.strictEqual(requests.length, 1); + flow.sent(990, 1); + assert.strictEqual(requests.length, 0); + await promise; + }); + + it('releases a publisher only when enough space is freed', async () => { + const flow = new fc.FlowControl(optionsDefault); + const promise = flow.willSend(1000, 2); + const requests = requestQueue(flow); + assert.strictEqual(requests.length, 1); + flow.sent(800, 1); + assert.strictEqual(requests.length, 1); + flow.sent(150, 1); + assert.strictEqual(requests.length, 0); + await promise; + }); + + it('calculates with wouldExceed correctly', () => { + const flowPause = new fc.FlowControl(optionsDefault); + assert.strictEqual(flowPause.wouldExceed(10000, 1), true); + assert.strictEqual(flowPause.wouldExceed(1, 1000), true); + assert.strictEqual(flowPause.wouldExceed(10000, 1000), true); + assert.strictEqual(flowPause.wouldExceed(5, 1), false); + }); + + it('sets options after the fact', () => { + const flowPause = new fc.FlowControl(optionsDefault); + const newOptions = { + maxOutstandingMessages: 100, + }; + flowPause.setOptions(newOptions); + assert.strictEqual(flowPause.options.maxOutstandingMessages, 100); + }); + + it('does not allow nonsensical option values', () => { + const flowPause = new fc.FlowControl(optionsDefault); + const newOptions = { + maxOutstandingBytes: 0, + maxOutstandingMessages: 0, + }; + assert.throws(() => flowPause.setOptions(newOptions)); + }); +}); diff --git a/handwritten/pubsub/test/publisher/flow-publisher.ts b/handwritten/pubsub/test/publisher/flow-publisher.ts new file mode 100644 index 00000000000..0ca59e56783 --- /dev/null +++ b/handwritten/pubsub/test/publisher/flow-publisher.ts @@ -0,0 +1,157 @@ +/*! + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, beforeEach, afterEach} from 'mocha'; +import * as sinon from 'sinon'; +import * as defer from 'p-defer'; + +import { + Publisher, + flowControlDefaults, + PublishOptions, + PubsubMessage, +} from '../../src/publisher'; +import {FlowControl} from '../../src/publisher/flow-control'; +import * as fp from '../../src/publisher/flow-publisher'; +import * as tracing from '../../src/telemetry-tracing'; + +class FakePublisher { + flowControl!: FlowControl; + async publishMessage() {} + setOptions(options: PublishOptions) { + this.flowControl.setOptions(options.flowControlOptions!); + } +} + +describe('Flow control publisher', () => { + let publisher: Publisher; + const sandbox = sinon.createSandbox(); + + beforeEach(() => { + publisher = new FakePublisher() as unknown as Publisher; + publisher.flowControl = new FlowControl(flowControlDefaults); + }); + + afterEach(() => { + sandbox.restore(); + tracing.setGloballyEnabled(false); + }); + + it('should create a flow span if a parent exists', async () => { + tracing.setGloballyEnabled(true); + + const fcp = new fp.FlowControlledPublisher(publisher); + const message = { + data: Buffer.from('foo'), + parentSpan: tracing.PubsubSpans.createPublisherSpan( + {}, + 'projects/foo/topics/topic', + 'tests', + ), + }; + await fcp.publish(message as unknown as PubsubMessage); + assert.strictEqual(!!message.parentSpan, true); + }); + + it('should not create a flow span if no parent exists', async () => { + const fcp = new fp.FlowControlledPublisher(publisher); + const message = {data: Buffer.from('foo'), parentSpan: undefined}; + await fcp.publish(message as unknown as PubsubMessage); + assert.strictEqual(!message.parentSpan, true); + }); + + it('should get no promise if there is flow control space left', async () => { + publisher.setOptions({ + flowControlOptions: { + maxOutstandingMessages: 1, + }, + }); + + const addStub = sandbox.stub(publisher, 'publishMessage').resolves(''); + + const fcp = new fp.FlowControlledPublisher(publisher); + const publishResult = fcp.publish({data: Buffer.from('foo')}); + + assert.strictEqual(addStub.called, true); + assert.strictEqual(publishResult, null); + }); + + it('should get a promise when there is no flow control space left', async () => { + publisher.setOptions({ + flowControlOptions: { + maxOutstandingMessages: 1, + }, + }); + + const deferred = defer(); + const addStub = sandbox + .stub(publisher, 'publishMessage') + .returns(deferred.promise as unknown as void); + + const fcp = new fp.FlowControlledPublisher(publisher); + const firstResult = fcp.publish({data: Buffer.from('foo')}); + assert.strictEqual(addStub.calledOnce, true); + assert.strictEqual(firstResult, null); + + const secondResult = fcp.publish({data: Buffer.from('bar')}); + assert.ok(secondResult); + assert.strictEqual(addStub.calledOnce, true); + publisher.flowControl.sent(3, 1); + await secondResult; + assert.strictEqual(addStub.calledTwice, true); + }); + + it('should still call sent() on send errors', async () => { + const pubStub = sandbox.stub(publisher, 'publishMessage').rejects(); + const sentStub = sandbox.stub(publisher.flowControl, 'sent'); + + const fcp = new fp.FlowControlledPublisher(publisher); + await fcp.publish({data: Buffer.from('foo')}); + + assert.strictEqual(pubStub.called, true); + assert.strictEqual(sentStub.called, true); + }); + + it('should send messages immediately when publishNow is called', () => { + const pubStub = sandbox.stub(publisher, 'publishMessage').resolves(''); + const addStub = sandbox.stub(publisher.flowControl, 'addToCount'); + + const fcp = new fp.FlowControlledPublisher(publisher); + fcp.publishNow({data: Buffer.from('foo')}); + + assert.strictEqual(pubStub.calledOnce, true); + assert.deepStrictEqual(addStub.args[0], [3, 1]); + }); + + it('should calculate the message size if needed, in wait mode', async () => { + sandbox.stub(publisher, 'publishMessage').resolves(); + const fcp = new fp.FlowControlledPublisher(publisher); + const message: PubsubMessage = {data: Buffer.from('test!')}; + await fcp.publish(message); + + assert.strictEqual(message.calculatedSize, 5); + }); + + it('should calculate the message size if needed, in now mode', () => { + sandbox.stub(publisher, 'publishMessage').resolves(); + const fcp = new fp.FlowControlledPublisher(publisher); + const message: PubsubMessage = {data: Buffer.from('test!')}; + fcp.publishNow(message); + + assert.strictEqual(message.calculatedSize, 5); + }); +}); diff --git a/handwritten/pubsub/test/publisher/index.ts b/handwritten/pubsub/test/publisher/index.ts new file mode 100644 index 00000000000..af693c65ebf --- /dev/null +++ b/handwritten/pubsub/test/publisher/index.ts @@ -0,0 +1,503 @@ +/*! + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as pfy from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {describe, it, beforeEach, afterEach} from 'mocha'; +import {EventEmitter} from 'events'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import * as opentelemetry from '@opentelemetry/api'; +import {Topic} from '../../src'; +import * as p from '../../src/publisher'; +import * as q from '../../src/publisher/message-queues'; +import {PublishError} from '../../src/publisher/publish-error'; +import * as util from '../../src/util'; + +import {defaultOptions} from '../../src/default-options'; +import * as tracing from '../../src/telemetry-tracing'; +import {exporter} from '../tracing'; +import {SpanKind} from '@opentelemetry/api'; + +let promisified = false; +const fakeUtil = Object.assign({}, util, { + promisifySome( + class_: Function, + classProtos: object, + methods: string[], + options: pfy.PromisifyAllOptions, + ): void { + if (class_.name === 'Publisher') { + promisified = true; + assert.deepStrictEqual(methods, ['flush', 'publishMessage']); + assert.strictEqual(options.singular, true); + } + // Defeats the method name type check. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + util.promisifySome(class_, classProtos, methods as any, options); + }, +}); + +class FakeQueue extends EventEmitter { + publisher: p.Publisher; + constructor(publisher: p.Publisher) { + super(); + this.publisher = publisher; + } + updateOptions() {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + add(message: p.PubsubMessage, callback: p.PublishCallback): void {} + async publish() { + await this._publish([], []); + } + async publishDrain() { + await this.publish(); + } + async _publish( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + messages: p.PubsubMessage[], + // eslint-disable-next-line @typescript-eslint/no-unused-vars + callbacks: p.PublishCallback[], + ) {} +} + +class FakeOrderedQueue extends FakeQueue { + orderingKey: string; + error?: Error; + constructor(publisher: p.Publisher, key: string) { + super(publisher); + this.orderingKey = key; + } + resumePublishing(): void {} + async publish() { + await this._publish([], []); + } + async publishDrain() { + await this.publish(); + } + async _publish( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + messages: p.PubsubMessage[], + // eslint-disable-next-line @typescript-eslint/no-unused-vars + callbacks: p.PublishCallback[], + ) {} +} + +describe('Publisher', () => { + let sandbox: sinon.SinonSandbox; + let spy: sinon.SinonSpy; + const topicId = 'topic-name'; + const projectId = 'PROJECT_ID'; + const topic = { + name: `projects/${projectId}/topics/${topicId}`, + pubsub: {projectId}, + } as Topic; + + // tslint:disable-next-line variable-name + let Publisher: typeof p.Publisher; + let publisher: p.Publisher; + + beforeEach(() => { + sandbox = sinon.createSandbox(); + spy = sandbox.spy(); + + const mocked = proxyquire('../../src/publisher/index.js', { + '../util': fakeUtil, + './message-queues': { + Queue: FakeQueue, + OrderedQueue: FakeOrderedQueue, + }, + }); + + Publisher = mocked.Publisher; + + publisher = new Publisher(topic); + }); + + afterEach(() => { + sandbox.restore(); + tracing.setGloballyEnabled(false); + }); + + describe('initialization', () => { + it('should promisify some of the things', () => { + assert(promisified); + }); + + it('should capture user options', () => { + const stub = sandbox.stub(Publisher.prototype, 'setOptions'); + + const options = {}; + publisher = new Publisher(topic, options); + + assert.ok(stub.calledWith(options)); + }); + + it('should localize topic instance', () => { + assert.strictEqual(publisher.topic, topic); + }); + + it('should create a message queue', () => { + assert(publisher.queue instanceof FakeQueue); + assert.strictEqual(publisher.queue.publisher, publisher); + }); + + it('should create a map for ordered queues', () => { + assert(publisher.orderedQueues instanceof Map); + }); + }); + + describe('publish', () => { + const buffer = Buffer.from('Hello, world!'); + + it('should call through to publishMessage', () => { + const stub = sandbox.stub(publisher, 'publishMessage'); + + publisher.publish(buffer, spy); + + const [{data}, callback] = stub.lastCall.args; + assert.strictEqual(data, buffer); + assert.strictEqual(callback, spy); + }); + + it('should optionally accept attributes', () => { + const stub = sandbox.stub(publisher, 'publishMessage'); + const attrs = {}; + + publisher.publish(buffer, attrs, spy); + + const [{attributes}, callback] = stub.lastCall.args; + assert.strictEqual(attributes, attrs); + assert.strictEqual(callback, spy); + }); + }); + + describe('OpenTelemetry tracing', () => { + let tracingPublisher: p.Publisher = {} as p.Publisher; + const buffer = Buffer.from('Hello, world!'); + + beforeEach(() => { + exporter.reset(); + }); + + it('export created spans', () => { + tracing.setGloballyEnabled(true); + + // Setup trace exporting + tracingPublisher = new Publisher(topic); + const msg = {data: buffer} as p.PubsubMessage; + void tracingPublisher.publishMessage(msg); + + // publishMessage is only the first part of the process now, + // so we need to manually end the span. + msg.parentSpan?.end(); + + const spans = exporter.getFinishedSpans(); + assert.notStrictEqual(spans.length, 0, 'has span'); + const createdSpan = spans.concat().pop()!; + assert.strictEqual( + createdSpan.status.code, + opentelemetry.SpanStatusCode.UNSET, + ); + assert.strictEqual( + createdSpan.attributes['messaging.system'], + 'gcp_pubsub', + ); + assert.strictEqual( + createdSpan.attributes['messaging.destination.name'], + topicId, + ); + assert.strictEqual(createdSpan.name, `${topicId} create`); + assert.strictEqual( + createdSpan.kind, + SpanKind.PRODUCER, + 'span kind should be PRODUCER', + ); + assert.ok(spans); + }); + }); + + describe('publishMessage', () => { + const data = Buffer.from('hello, world!'); + + it('should throw an error if data is not a Buffer', () => { + const badData = {} as Buffer; + assert.throws( + () => publisher.publishMessage({data: badData}, spy), + /Data must be in the form of a Buffer or Uint8Array\./, + ); + }); + + it('should throw an error if data and attributes are both empty', () => { + assert.throws( + () => publisher.publishMessage({}, spy), + /at least one attribute must be present/, + ); + }); + + it('should allow sending only attributes', () => { + const attributes = {foo: 'bar'} as {}; + assert.doesNotThrow(() => publisher.publishMessage({attributes}, spy)); + }); + + it('should throw an error if attributes are wrong format', () => { + const attributes = {foo: {bar: 'baz'}} as {}; + + assert.throws( + () => publisher.publishMessage({data, attributes}, spy), + /All attributes must be in the form of a string.\n\nInvalid value of type "object" provided for "foo"\./, + ); + }); + + it('should add non-ordered messages to the message queue', done => { + const stub = sandbox.stub(publisher.queue, 'add'); + const fakeMessage = {data}; + + publisher.publishMessage(fakeMessage, done); + + const [message, callback] = stub.lastCall.args; + assert.strictEqual(message, fakeMessage); + + // Because of publisher flow control indirection, we have to test + // the callback this way. + callback(null); + }); + + describe('ordered messages', () => { + const orderingKey = 'foo'; + const fakeMessage = {data, orderingKey}; + + let queue: FakeOrderedQueue; + + beforeEach(() => { + queue = new FakeOrderedQueue(publisher, orderingKey); + publisher.orderedQueues.set( + orderingKey, + queue as unknown as q.OrderedQueue, + ); + }); + + it('should create a new queue for a message if need be', () => { + publisher.orderedQueues.clear(); + publisher.publishMessage(fakeMessage, spy); + + queue = publisher.orderedQueues.get( + orderingKey, + ) as unknown as FakeOrderedQueue; + + assert(queue instanceof FakeOrderedQueue); + assert.strictEqual(queue.publisher, publisher); + assert.strictEqual(queue.orderingKey, orderingKey); + }); + + it('should add the ordered message to the correct queue', done => { + const stub = sandbox.stub(queue, 'add'); + + publisher.publishMessage(fakeMessage, done); + + // Because of publisher flow control indirection, we can't test + // the callback here. + const [message, callback] = stub.lastCall.args; + assert.strictEqual(message, fakeMessage); + + // Because of publisher flow control indirection, we have to test + // the callback this way. + callback(null); + }); + + it('should return an error if the queue encountered an error', done => { + const error = new Error('err') as PublishError; + sandbox + .stub(queue, 'add') + .callsFake((message, callback) => callback(error)); + + publisher.publishMessage(fakeMessage, err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should delete the queue once it is empty', () => { + publisher.orderedQueues.clear(); + publisher.publishMessage(fakeMessage, spy); + + queue = publisher.orderedQueues.get( + orderingKey, + ) as unknown as FakeOrderedQueue; + queue.emit('drain'); + + assert.strictEqual(publisher.orderedQueues.size, 0); + }); + + it('should drain any ordered queues on flush', done => { + // We have to stub out the regular queue as well, so that the flush() operation finishes. + sandbox.stub(FakeQueue.prototype, '_publish').callsFake(async () => { + // Simulate the drain taking longer than the publishes. This can + // happen if more messages are queued during the publish(). + process.nextTick(() => { + publisher.queue.emit('drain'); + }); + }); + + sandbox + .stub(FakeOrderedQueue.prototype, '_publish') + .callsFake(async () => { + const queue = publisher.orderedQueues.get( + orderingKey, + ) as unknown as FakeOrderedQueue; + // Simulate the drain taking longer than the publishes. This can + // happen on some ordered queue scenarios, especially if we have more + // than one queue to empty. + process.nextTick(() => { + queue.emit('drain'); + }); + }); + + publisher.orderedQueues.clear(); + publisher.publishMessage(fakeMessage, spy); + + publisher.flush(err => { + assert.strictEqual(err, null); + assert.strictEqual(publisher.orderedQueues.size, 0); + done(); + }); + }); + }); + }); + + describe('resumePublishing', () => { + it('should resume publishing for the provided ordering key', () => { + const orderingKey = 'foo'; + const queue = new FakeOrderedQueue(publisher, orderingKey); + const stub = sandbox.stub(queue, 'resumePublishing'); + + publisher.orderedQueues.set( + orderingKey, + queue as unknown as q.OrderedQueue, + ); + publisher.resumePublishing(orderingKey); + + assert.strictEqual(stub.callCount, 1); + }); + }); + + describe('setOptions', () => { + it('should apply default values', () => { + publisher.setOptions({}); + + assert.deepStrictEqual(publisher.settings, { + batching: { + maxBytes: defaultOptions.publish.maxOutstandingBytes, + maxMessages: defaultOptions.publish.maxOutstandingMessages, + maxMilliseconds: defaultOptions.publish.maxDelayMillis, + }, + messageOrdering: false, + gaxOpts: { + isBundling: false, + }, + flowControlOptions: { + maxOutstandingBytes: undefined, + maxOutstandingMessages: undefined, + }, + }); + }); + + it('should capture user provided values', () => { + const options = { + batching: { + maxBytes: 10, + maxMessages: 10, + maxMilliseconds: 1, + }, + messageOrdering: true, + gaxOpts: { + isBundling: true, + }, + flowControlOptions: { + maxOutstandingBytes: 500, + maxOutstandingMessages: 50, + }, + }; + + publisher.setOptions(options); + + assert.deepStrictEqual(publisher.settings, options); + }); + + it('should cap maxBytes at 9MB', () => { + publisher.setOptions({ + batching: { + maxBytes: Math.pow(1024, 2) * 10, + }, + }); + + const expected = Math.pow(1024, 2) * 9; + assert.strictEqual(publisher.settings.batching!.maxBytes, expected); + }); + + it('should cap maxMessages at 1000', () => { + publisher.setOptions({ + batching: { + maxMessages: 1001, + }, + }); + assert.strictEqual(publisher.settings.batching!.maxMessages, 1000); + }); + + it('should pass new option values into queues after construction', () => { + // Make sure we have some ordering queues. + publisher.orderedQueues.set('a', new q.OrderedQueue(publisher, 'a')); + publisher.orderedQueues.set('b', new q.OrderedQueue(publisher, 'b')); + + const stubs = [sandbox.stub(publisher.queue, 'updateOptions')]; + assert.deepStrictEqual(publisher.orderedQueues.size, 2); + stubs.push( + ...Array.from(publisher.orderedQueues.values()).map(q => + sandbox.stub(q, 'updateOptions'), + ), + ); + + const newOptions: p.PublishOptions = { + batching: {}, + }; + publisher.setOptions(newOptions); + + stubs.forEach(s => assert.ok(s.calledOnce)); + }); + }); + + describe('flush', () => { + // The ordered queue drain test is above with the ordered queue tests. + it('should drain the main publish queue', done => { + sandbox.stub(publisher.queue, '_publish').callsFake(async () => { + // Simulate the drain taking longer than the publishes. This can + // happen if more messages are queued during the publish(). + process.nextTick(() => { + publisher.queue.emit('drain'); + }); + }); + + publisher.flush(err => { + assert.strictEqual(err, null); + assert.strictEqual( + !publisher.queue.batch || publisher.queue.batch.messages.length === 0, + true, + ); + done(); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/publisher/message-batch.ts b/handwritten/pubsub/test/publisher/message-batch.ts new file mode 100644 index 00000000000..273d4fd0dd8 --- /dev/null +++ b/handwritten/pubsub/test/publisher/message-batch.ts @@ -0,0 +1,219 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, beforeEach, afterEach} from 'mocha'; +import {randomBytes} from 'crypto'; +import * as sinon from 'sinon'; + +import {MessageBatch} from '../../src/publisher/message-batch'; +import {PubsubMessage} from '../../src/publisher'; + +describe('MessageBatch', () => { + let batch: MessageBatch; + + const sandbox = sinon.createSandbox(); + + const options = { + maxBytes: 1000, + maxMessages: 100, + }; + + beforeEach(() => { + batch = new MessageBatch(Object.assign({}, options), 'topicName'); + }); + + afterEach(() => { + sandbox.restore(); + }); + + describe('initialization', () => { + it('should localize options', () => { + assert.deepStrictEqual(batch.options, options); + }); + + it('should create a message array', () => { + assert.deepStrictEqual(batch.messages, []); + }); + + it('should create a callback array', () => { + assert.deepStrictEqual(batch.callbacks, []); + }); + + it('should capture the creation time', () => { + const now = Date.now(); + + sandbox.stub(Date, 'now').returns(now); + batch = new MessageBatch(options, 'topicName'); + + assert.strictEqual(batch.created, now); + }); + + it('should initialize bytes to 0', () => { + assert.strictEqual(batch.bytes, 0); + }); + }); + + describe('add', () => { + const callback = sandbox.spy(); + let message: PubsubMessage; + let messageSize: number; + beforeEach(() => { + message = { + data: Buffer.from('Hello, world!'), + }; + messageSize = message.data!.length; + }); + + it('should add the message to the message array', () => { + batch.add(message, callback); + assert.deepStrictEqual(batch.messages, [message]); + }); + + it('should add the callback to the callback array', () => { + batch.add(message, callback); + assert.deepStrictEqual(batch.callbacks, [callback]); + }); + + it('should adjust the byte count', () => { + batch.add(message, callback); + assert.strictEqual(batch.bytes, messageSize); + }); + }); + + describe('canFit', () => { + let message: PubsubMessage; + let messageSize: number; + beforeEach(() => { + message = { + data: Buffer.from('Hello, world!'), + }; + messageSize = message.data!.length; + }); + + it('should return false if too many messages', () => { + batch.options.maxMessages = 0; + const canFit = batch.canFit(message); + assert.strictEqual(canFit, false); + assert.strictEqual(batch.canFitCount(), false); + assert.strictEqual(batch.canFitSize(message), true); + }); + + it('should return false if too many bytes', () => { + batch.options.maxBytes = messageSize - 1; + const canFit = batch.canFit(message); + assert.strictEqual(canFit, false); + assert.strictEqual(batch.canFitCount(), true); + assert.strictEqual(batch.canFitSize(message), false); + }); + + it('should return true if it can fit', () => { + const canFit = batch.canFit(message); + assert.strictEqual(canFit, true); + assert.strictEqual(batch.canFitCount(), true); + assert.strictEqual(batch.canFitSize(message), true); + }); + }); + + describe('isAtMax', () => { + it('should return true if at max message limit', () => { + // tslint:disable-next-line ban + Array(1000) + .fill({ + data: Buffer.from('Hello!'), + }) + .forEach(message => { + batch.add(message, sandbox.spy()); + }); + + const isAtMax = batch.isAtMax(); + assert.strictEqual(isAtMax, true); + }); + + it('should return true if at max byte limit', () => { + const message = { + data: randomBytes(Math.pow(1024, 2) * 9), + }; + + batch.add(message, sandbox.spy()); + + const isAtMax = batch.isAtMax(); + assert.strictEqual(isAtMax, true); + }); + + it('should return false if it is not full', () => { + const message = { + data: randomBytes(500), + }; + + batch.add(message, sandbox.spy()); + + const isAtMax = batch.isAtMax(); + assert.strictEqual(isAtMax, false); + }); + }); + + describe('isFull', () => { + let message: PubsubMessage; + let messageSize: number; + beforeEach(() => { + message = { + data: Buffer.from('Hello, world!'), + }; + messageSize = message.data!.length; + }); + + it('should return true if at max message limit', () => { + batch.options.maxMessages = 1; + batch.add(message, sandbox.spy()); + const isFull = batch.isFull(); + assert.strictEqual(isFull, true); + assert.strictEqual(batch.isFullMessages(), true); + assert.strictEqual(batch.isFullSize(), false); + }); + + it('should return true if at max byte limit', () => { + batch.options.maxBytes = messageSize; + batch.add(message, sandbox.spy()); + const isFull = batch.isFull(); + assert.strictEqual(isFull, true); + assert.strictEqual(batch.isFullMessages(), false); + assert.strictEqual(batch.isFullSize(), true); + }); + + it('should return false if it is not full', () => { + batch.add(message, sandbox.spy()); + const isFull = batch.isFull(); + assert.strictEqual(isFull, false); + assert.strictEqual(batch.isFullMessages(), false); + assert.strictEqual(batch.isFullSize(), false); + }); + }); + + describe('setOptions', () => { + it('updates the options', () => { + const newOptions = {}; + batch.setOptions(newOptions); + assert.strictEqual(newOptions, batch.options); + }); + }); + + it('returns data from end()', () => { + const output = batch.end(); + assert.strictEqual(output.messages, batch.messages); + assert.strictEqual(output.callbacks, batch.callbacks); + }); +}); diff --git a/handwritten/pubsub/test/publisher/message-queues.ts b/handwritten/pubsub/test/publisher/message-queues.ts new file mode 100644 index 00000000000..7c810a9bebd --- /dev/null +++ b/handwritten/pubsub/test/publisher/message-queues.ts @@ -0,0 +1,807 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {loggingUtils, ServiceError} from 'google-gax'; +import * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import {EventEmitter} from 'events'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; + +import {RequestConfig, RequestCallback} from '../../src/pubsub'; +import * as p from '../../src/publisher'; +import * as b from '../../src/publisher/message-batch'; +import * as q from '../../src/publisher/message-queues'; +import {PublishError} from '../../src/publisher/publish-error'; +import {FakeLog, TestUtils} from '../test-utils'; + +class FakeTopic { + name = 'projects/foo/topics/fake-topic'; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + request(config: RequestConfig, callback: RequestCallback): void {} +} + +class FakeFlowControl {} + +class FakePublisher { + topic: FakeTopic; + settings: p.PublishOptions; + flowControl: FakeFlowControl; + constructor(topic: FakeTopic) { + this.topic = topic; + this.settings = { + batching: {}, + }; + this.flowControl = new FakeFlowControl(); + } +} + +class FakeMessageBatch { + callbacks: p.PublishCallback[]; + created: number; + messages: p.PubsubMessage[]; + options: b.BatchPublishOptions; + bytes: number; + topicName: string; + constructor(options = {} as b.BatchPublishOptions, topicName = 'topicName') { + this.callbacks = []; + this.created = Date.now(); + this.messages = []; + this.options = options; + this.topicName = topicName; + this.bytes = 0; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + add(message: p.PubsubMessage, callback: p.PublishCallback): void {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + canFit(message: p.PubsubMessage): boolean { + return true; + } + canFitCount(): boolean { + return true; + } + canFitSize(): boolean { + return true; + } + isAtMax(): boolean { + return false; + } + isFull(): boolean { + return false; + } + isFullMessages(): boolean { + return false; + } + isFullSize(): boolean { + return false; + } + setOptions(options: b.BatchPublishOptions) { + this.options = options; + } + end() { + return { + messages: this.messages, + callbacks: this.callbacks, + bytes: 0, + }; + } +} + +class FakePublishError { + orderingKey: string; + error: ServiceError; + constructor(key: string, error: ServiceError) { + this.orderingKey = key; + this.error = error; + } +} + +describe('Message Queues', () => { + const sandbox = sinon.createSandbox(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let MessageQueue: any; + let Queue: typeof q.Queue; + let OrderedQueue: typeof q.OrderedQueue; + + let topic: FakeTopic; + let publisher: p.Publisher; + + before(() => { + const mocked = proxyquire('../../src/publisher/message-queues.js', { + './message-batch': {MessageBatch: FakeMessageBatch}, + './publish-error': {PublishError: FakePublishError}, + }); + + MessageQueue = mocked.MessageQueue; + Queue = mocked.Queue; + OrderedQueue = mocked.OrderedQueue; + }); + + beforeEach(() => { + topic = new FakeTopic(); + publisher = new FakePublisher(topic) as unknown as p.Publisher; + }); + + afterEach(() => { + sandbox.restore(); + }); + + describe('MessageQueue', () => { + let queue: q.Queue; + + beforeEach(() => { + queue = new MessageQueue(publisher as p.Publisher); + }); + + describe('initialization', () => { + it('should extend EventEmitter', () => { + assert(queue instanceof EventEmitter); + }); + + it('should localize the publisher', () => { + assert.strictEqual(queue.publisher, publisher); + }); + + it('should localize the batch options', () => { + const batching = {maxMessages: 1001}; + publisher.settings = {batching}; + + queue = new MessageQueue(publisher as p.Publisher); + assert.strictEqual(queue.batchOptions, batching); + }); + }); + + describe('_publish', () => { + const messages = [{}, {}, {}]; + const callbacks = messages.map(() => sandbox.spy()); + + it('should make the correct request', () => { + const stub = sandbox.stub(topic, 'request'); + + void queue._publish(messages, callbacks, 0, 'test'); + + const [{client, method, reqOpts}] = stub.lastCall.args; + assert.strictEqual(client, 'PublisherClient'); + assert.strictEqual(method, 'publish'); + assert.deepStrictEqual(reqOpts, {topic: topic.name, messages}); + }); + + it('should make a log message about the publish', () => { + sandbox.stub(topic, 'request'); + const fakeLog = new FakeLog(q.logs.publishBatch); + void queue._publish(messages, callbacks, 0, 'test'); + fakeLog.remove(); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1] as string, 'test'); + }); + + it('should pass along any gax options', () => { + const stub = sandbox.stub(topic, 'request'); + const callOptions = {}; + + publisher.settings.gaxOpts = callOptions; + void queue._publish(messages, callbacks, 0, 'test'); + + const [{gaxOpts}] = stub.lastCall.args; + assert.strictEqual(gaxOpts, callOptions); + }); + + it('should pass back any request errors', async () => { + const error = new Error('err') as ServiceError; + + sandbox.stub(topic, 'request').callsFake((config, callback) => { + callback(error); + }); + + try { + await queue._publish(messages, callbacks, 0, 'test'); + assert.strictEqual(null, error, '_publish did not throw'); + } catch (e) { + const err = e as ServiceError; + + assert.strictEqual(err, error); + + callbacks.forEach(callback => { + const [err] = callback.lastCall.args; + assert.strictEqual(err, error); + }); + } + }); + + it('should pass back message ids', async () => { + const messageIds = messages.map((_, i) => `message${i}`); + + sandbox.stub(topic, 'request').callsFake((config, callback) => { + callback(null, {messageIds}); + }); + + await queue._publish(messages, callbacks, 0, 'test'); + + callbacks.forEach((callback, i) => { + const [, messageId] = callback.lastCall.args; + const expectedId = `message${i}`; + assert.strictEqual(messageId, expectedId); + }); + }); + }); + }); + + describe('Queue', () => { + let queue: q.Queue; + + beforeEach(() => { + queue = new Queue(publisher as p.Publisher); + }); + + describe('initialization', () => { + it('should create a message batch', () => { + assert.ok(queue.batch instanceof FakeMessageBatch); + assert.strictEqual(queue.batch.options, queue.batchOptions); + }); + + it('should propagate batch options to the message batch when updated', () => { + const newConfig = { + batching: {}, + }; + publisher.settings = newConfig; + queue.updateOptions(); + assert.strictEqual(queue.batch.options, newConfig.batching); + }); + }); + + describe('add', () => { + const spy = sandbox.spy(); + const fakeMessage: p.PubsubMessage = {}; + + it('should publish immediately if unable to fit message', done => { + const addStub = sandbox.stub(queue.batch, 'add'); + sandbox.stub(queue.batch, 'canFit').returns(false); + + const publishStub = sandbox.stub(queue, 'publish'); + publishStub.onCall(0).callsFake(async () => { + assert.strictEqual(addStub.callCount, 0); + done(); + }); + publishStub.resolves(); + + queue.add(fakeMessage, spy); + }); + + it('should add the message to the batch', () => { + const stub = sandbox.stub(queue.batch, 'add'); + sandbox.stub(queue, 'publish').resolves(); + + queue.add(fakeMessage, spy); + + const [message, callback] = stub.lastCall.args; + assert.strictEqual(message, fakeMessage); + assert.strictEqual(callback, spy); + }); + + it('should publish immediately if the batch became full', () => { + const stub = sandbox.stub(queue, 'publish').resolves(); + sandbox.stub(queue.batch, 'isFull').returns(true); + + queue.add(fakeMessage, spy); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should set a timeout to publish if need be', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const stub = sandbox.stub(queue, 'publish').resolves(); + const maxMilliseconds = 1234; + + queue.batchOptions = {maxMilliseconds}; + queue.add(fakeMessage, spy); + + assert.strictEqual(stub.callCount, 0); + clock.tick(maxMilliseconds); + assert.strictEqual(stub.callCount, 1); + clock.restore(); + }); + + it('should noop if a timeout is already set', () => { + const clock = TestUtils.useFakeTimers(sandbox); + const stub = sandbox.stub(queue, 'publish').resolves(); + const maxMilliseconds = 1234; + + queue.batchOptions = {maxMilliseconds}; + queue.pending = 1234 as unknown as NodeJS.Timeout; + queue.add(fakeMessage, spy); + + clock.tick(maxMilliseconds); + assert.strictEqual(stub.callCount, 0); + clock.restore(); + }); + }); + + describe('publish', () => { + it('should create a new batch', async () => { + const oldBatch = queue.batch; + + await queue.publish('test'); + + assert.notStrictEqual(oldBatch, queue.batch); + assert.ok(queue.batch instanceof FakeMessageBatch); + assert.strictEqual(queue.batch.options, queue.batchOptions); + }); + + it('should cancel any pending publish calls', async () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const fakeHandle = 1234 as unknown as any; + const stub = sandbox.stub(global, 'clearTimeout').withArgs(fakeHandle); + + queue.pending = fakeHandle; + await queue.publish('test'); + + assert.strictEqual(stub.callCount, 1); + assert.strictEqual(queue.pending, undefined); + }); + + it('should publish the messages', async () => { + const batch = queue.batch; + const stub = sandbox.stub(queue, '_publish'); + + await queue.publish('test'); + + const [messages, callbacks] = stub.lastCall.args; + assert.strictEqual(messages, batch.messages); + assert.strictEqual(callbacks, batch.callbacks); + }); + + describe('publish chaining', () => { + let fakeMessages: p.PubsubMessage[]; + let spies: p.PublishCallback[]; + beforeEach(() => { + fakeMessages = [{}, {}] as p.PubsubMessage[]; + spies = [sandbox.spy(), sandbox.spy()] as p.PublishCallback[]; + }); + + it('should begin another publish(drain) if there are pending batches', done => { + const stub = sandbox.stub(queue, '_publish'); + let once = false; + stub.callsFake(async () => { + if (!once) { + // Drop in a second batch before calling the callback. + const secondBatch = new FakeMessageBatch(); + secondBatch.messages = fakeMessages; + secondBatch.callbacks = spies; + queue.batch = secondBatch; + } + once = true; + }); + + queue.batch = new FakeMessageBatch(); + queue.batch.messages = fakeMessages; + queue.batch.callbacks = spies; + void queue.publishDrain().then(() => { + process.nextTick(() => { + assert.strictEqual(stub.callCount, 2); + done(); + }); + }); + }); + + it('should not begin another publish(non-drain) if there are pending batches', async () => { + const stub = sandbox.stub(queue, '_publish'); + let once = false; + stub.callsFake(async () => { + if (!once) { + // Drop in a second batch before calling the callback. + const secondBatch = new FakeMessageBatch(); + secondBatch.messages = fakeMessages; + secondBatch.callbacks = spies; + queue.batch = secondBatch; + } + once = true; + }); + + queue.batch = new FakeMessageBatch(); + queue.batch.messages = fakeMessages; + queue.batch.callbacks = spies; + await queue.publish('test'); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should emit "drain" if there is nothing left to publish', done => { + const spy = sandbox.spy(); + sandbox.stub(queue, '_publish').callsFake(async () => {}); + + queue.on('drain', spy); + void queue.publish('test').then(() => { + process.nextTick(() => { + assert.strictEqual(spy.callCount, 1); + done(); + }); + }); + }); + }); + }); + }); + + describe('OrderedQueue', () => { + const key = 'abcd'; + let queue: q.OrderedQueue; + + beforeEach(() => { + queue = new OrderedQueue(publisher as p.Publisher, key); + }); + + describe('initialization', () => { + it('should create an array of batches', () => { + assert.deepStrictEqual(queue.batches, []); + }); + + it('should default inFlight ot false', () => { + assert.strictEqual(queue.inFlight, false); + }); + + it('should localize the ordering key', () => { + assert.strictEqual(queue.key, key); + }); + + it('should propagate batch options to all message batches when updated', () => { + const firstBatch = queue.createBatch(); + const secondBatch = queue.createBatch(); + queue.batches.push(firstBatch, secondBatch); + + const newConfig = { + batching: {}, + }; + publisher.settings = newConfig; + queue.updateOptions(); + + assert.strictEqual(firstBatch.options, newConfig.batching); + assert.strictEqual(secondBatch.options, newConfig.batching); + }); + }); + + describe('currentBatch', () => { + it('should return the oldest known batch', () => { + const batches = [ + new FakeMessageBatch(), + new FakeMessageBatch(), + ] as b.MessageBatch[]; + queue.batches.push(...batches); + assert.strictEqual(queue.currentBatch, batches[0]); + }); + + it('should create a new batch if one does not exist', () => { + assert.strictEqual(queue.batches.length, 0); + assert.ok(queue.currentBatch instanceof FakeMessageBatch); + assert.strictEqual(queue.batches.length, 1); + }); + }); + + describe('add', () => { + const fakeMessage: p.PubsubMessage = {}; + const spy = sandbox.spy(); + + let batch: FakeMessageBatch; + + beforeEach(() => { + batch = queue.currentBatch as FakeMessageBatch; + }); + + describe('with batch in flight', () => { + beforeEach(() => { + queue.inFlight = true; + }); + + it('should add the message to current batch', () => { + const stub = sandbox.stub(batch, 'add'); + + queue.add(fakeMessage, spy); + + const [message, callback] = stub.lastCall.args; + assert.strictEqual(message, fakeMessage); + assert.strictEqual(callback, spy); + }); + + it('should create a new batch if current one is at max', () => { + const fakeBatch = new FakeMessageBatch() as b.MessageBatch; + const stub = sandbox.stub(fakeBatch, 'add'); + + sandbox.stub(batch, 'isAtMax').returns(true); + sandbox.stub(queue, 'createBatch').returns(fakeBatch); + + queue.add(fakeMessage, spy); + + assert.deepStrictEqual(queue.batches, [fakeBatch, batch]); + const [message, callback] = stub.lastCall.args; + assert.strictEqual(message, fakeMessage); + assert.strictEqual(callback, spy); + }); + }); + + describe('without a batch in flight', () => { + it('should publish immediately if it cannot fit the message', done => { + const addStub = sandbox.stub(batch, 'add'); + + sandbox.stub(batch, 'canFit').withArgs(fakeMessage).returns(false); + const publishStub = sandbox.stub(queue, 'publish'); + publishStub.onCall(0).callsFake(async () => { + assert.strictEqual(addStub.callCount, 0); + done(); + }); + publishStub.resolves(); + + queue.add(fakeMessage, spy); + }); + + it('should add the message to the current batch', () => { + const stub = sandbox.stub(batch, 'add'); + + queue.add(fakeMessage, spy); + + const [message, callback] = stub.lastCall.args; + assert.strictEqual(message, fakeMessage); + assert.strictEqual(callback, spy); + }); + + it('should noop after adding if a publish was triggered', () => { + const publishStub = sandbox.stub(queue, 'publish').resolves(); + const beginPublishStub = sandbox.stub(queue, 'beginNextPublish'); + + sandbox.stub(batch, 'canFit').returns(false); + + publishStub.onCall(0).callsFake(async () => { + queue.inFlight = true; + }); + + queue.add(fakeMessage, spy); + + assert.strictEqual(publishStub.callCount, 1); + assert.strictEqual(beginPublishStub.callCount, 0); + }); + + it('should publish immediately if the batch is full', () => { + const stub = sandbox.stub(queue, 'publish').resolves(); + + sandbox.stub(batch, 'isFull').returns(true); + queue.add(fakeMessage, spy); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should schedule a publish if one is not pending', () => { + const stub = sandbox.stub(queue, 'beginNextPublish'); + + queue.add(fakeMessage, spy); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should noop after adding if a publish is already pending', () => { + const stub = sandbox.stub(queue, 'beginNextPublish'); + + queue.pending = 1234 as unknown as NodeJS.Timeout; + queue.add(fakeMessage, spy); + + assert.strictEqual(stub.callCount, 0); + }); + }); + }); + + describe('beginNextPublish', () => { + const maxMilliseconds = 10000; + let clock: sinon.SinonFakeTimers; + + beforeEach(() => { + queue.batchOptions = {maxMilliseconds}; + clock = TestUtils.useFakeTimers(sandbox); + }); + + afterEach(() => { + clock.restore(); + }); + + it('should set a timeout that will call publish', done => { + sandbox.stub(queue, 'publish').callsFake(async () => done()); + queue.beginNextPublish(); + clock.tick(maxMilliseconds); + }); + + it('should factor in the time the batch has been sitting', done => { + const halfway = maxMilliseconds / 2; + sandbox.stub(queue, 'publish').callsFake(async () => done()); + queue.currentBatch.created = Date.now() - halfway; + queue.beginNextPublish(); + clock.tick(halfway); + }); + + it('should not set a timeout with a negative number', () => { + const stub = sandbox.stub(global, 'setTimeout'); + + queue.currentBatch.created = Date.now() - maxMilliseconds * 2; + queue.beginNextPublish(); + + const [, delay] = stub.lastCall.args; + assert.strictEqual(delay, 0); + }); + }); + + describe('createBatch', () => { + it('should create a batch with the correct options', () => { + const batchOptions = {}; + queue.batchOptions = batchOptions; + const batch = queue.createBatch(); + + assert.ok(batch instanceof FakeMessageBatch); + assert.strictEqual(batch.options, batchOptions); + }); + }); + + describe('handlePublishFailure', () => { + const error = new Error('err') as ServiceError; + + it('should localize the publish error', () => { + queue.handlePublishFailure(error); + + assert.ok(queue.error instanceof FakePublishError); + assert.strictEqual(queue.error!.orderingKey, key); + assert.strictEqual(queue.error!.error, error); + }); + + it('should pass the error to call pending callbacks', () => { + const spies = [sandbox.spy(), sandbox.spy()]; + + queue.currentBatch.callbacks = spies; + queue.handlePublishFailure(error); + + assert.strictEqual(queue.batches.length, 0); + + spies.forEach(spy => { + assert.ok(spy.calledWith(error)); + }); + }); + }); + + describe('publish', () => { + const fakeMessages = [{}, {}] as p.PubsubMessage[]; + const spies = [sandbox.spy(), sandbox.spy()] as p.PublishCallback[]; + + beforeEach(() => { + queue.currentBatch.messages = fakeMessages; + queue.currentBatch.callbacks = spies; + }); + + it('should set inFlight to true', () => { + void queue.publish('test'); + assert.strictEqual(queue.inFlight, true); + }); + + it('should cancel any pending publishes', () => { + const fakeHandle = 1234 as unknown as NodeJS.Timeout; + const stub = sandbox.stub(global, 'clearTimeout'); + + queue.pending = fakeHandle; + void queue.publish('test'); + + const [handle] = stub.lastCall.args; + assert.strictEqual(handle, fakeHandle); + assert.strictEqual(queue.pending, undefined); + }); + + it('should remove the oldest batch from the batch list', () => { + const oldestBatch = queue.currentBatch; + + void queue.publish('test'); + + assert.notStrictEqual(queue.currentBatch, oldestBatch); + }); + + it('should publish the batch', async () => { + const stub = sandbox.stub(queue, '_publish'); + + await queue.publish('test'); + + const [messages, callbacks] = stub.lastCall.args; + assert.strictEqual(messages, fakeMessages); + assert.strictEqual(callbacks, spies); + }); + + it('should set inFlight to false after publishing', async () => { + sandbox.stub(queue, '_publish').resolves(); + + await queue.publish('test'); + + assert.strictEqual(queue.inFlight, false); + }); + + it('should handle any publish failures', async () => { + const error = new Error('err') as ServiceError; + const stub = sandbox.stub(queue, 'handlePublishFailure'); + + sandbox.stub(queue, '_publish').rejects(error); + + await queue.publish('test'); + + const [err] = stub.lastCall.args; + assert.strictEqual(err, error); + }); + + it('should begin another publish if there are pending batches', async () => { + const stub = sandbox.stub(queue, 'beginNextPublish'); + sandbox.stub(queue, '_publish').resolves(); + + const secondBatch = new FakeMessageBatch(); + secondBatch.messages = fakeMessages; + secondBatch.callbacks = spies; + + queue.batches.push(secondBatch as b.MessageBatch); + await queue.publish('test'); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should emit "drain" if there is nothing left to publish', async () => { + const spy = sandbox.spy(); + sandbox.stub(queue, '_publish').resolves(); + + queue.on('drain', spy); + await queue.publish('test'); + + assert.strictEqual(spy.callCount, 1); + }); + + it('should emit "drain" if already empty on publish', async () => { + const spy = sandbox.spy(); + sandbox.stub(queue, '_publish').resolves(); + + queue.on('drain', spy); + await queue.publish('test'); + await queue.publish('test'); + + assert.strictEqual(spy.callCount, 2); + }); + }); + + describe('resumePublishing', () => { + const error = new Error('err') as PublishError; + + beforeEach(() => { + queue.error = error; + }); + + it('should delete the cached publish error', () => { + queue.resumePublishing(); + assert.strictEqual(queue.error, undefined); + }); + + it('should emit the drain event if there are no more batches', done => { + queue.on('drain', done); + queue.resumePublishing(); + }); + + it('should not emit the drain event if publishing continues', done => { + queue.on('drain', () => done(new Error('Should not be called.'))); + queue.resumePublishing(); + + assert.ok(queue.currentBatch); + process.nextTick(() => done()); + }); + }); + }); +}); diff --git a/handwritten/pubsub/test/publisher/publish-error.ts b/handwritten/pubsub/test/publisher/publish-error.ts new file mode 100644 index 00000000000..f7502beb5de --- /dev/null +++ b/handwritten/pubsub/test/publisher/publish-error.ts @@ -0,0 +1,62 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, beforeEach} from 'mocha'; +import {grpc} from 'google-gax'; +import {PublishError} from '../../src/publisher/publish-error'; + +describe('PublishError', () => { + let error: PublishError; + + const orderingKey = 'abcd'; + const fakeError = new Error('Oh noes') as grpc.ServiceError; + + fakeError.code = 1; + fakeError.details = 'Something went wrong!'; + fakeError.metadata = new grpc.Metadata(); + + beforeEach(() => { + error = new PublishError(orderingKey, fakeError); + }); + + it('should give a helpful message', () => { + assert.strictEqual( + error.message, + `Unable to publish for key "${orderingKey}". Reason: ${fakeError.message}`, + ); + }); + + it('should capture the error code', () => { + assert.strictEqual(error.code, fakeError.code); + }); + + it('should capture the error details', () => { + assert.strictEqual(error.details, fakeError.details); + }); + + it('should capture the error metadata', () => { + assert.strictEqual(error.metadata, fakeError.metadata); + }); + + it('should capture the ordering key', () => { + assert.strictEqual(error.orderingKey, orderingKey); + }); + + it('should capture the original error', () => { + assert.strictEqual(error.error, fakeError); + }); +}); diff --git a/handwritten/pubsub/test/publisher/pubsub-message.ts b/handwritten/pubsub/test/publisher/pubsub-message.ts new file mode 100644 index 00000000000..e2eff60f011 --- /dev/null +++ b/handwritten/pubsub/test/publisher/pubsub-message.ts @@ -0,0 +1,73 @@ +/*! + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it} from 'mocha'; + +import {PubsubMessage} from '../../src/publisher'; +import * as pm from '../../src/publisher/pubsub-message'; + +describe('PubsubMessage', () => { + it('should calculate properly for blank messages', () => { + const blank: PubsubMessage = {}; + const size = pm.calculateMessageSize(blank); + assert.strictEqual(size, 0); + assert.strictEqual(blank.calculatedSize, size); + }); + + it('should calculate properly for a data only message', () => { + const dataOnly: PubsubMessage = {data: Buffer.from('test')}; + const size = pm.calculateMessageSize(dataOnly); + assert.strictEqual(size, 4); + assert.strictEqual(dataOnly.calculatedSize, size); + }); + + it('should calculate properly for an attr only message', () => { + const attrOnly: PubsubMessage = { + attributes: { + foo: 'bar', + }, + }; + const size = pm.calculateMessageSize(attrOnly); + assert.strictEqual(size, 6); + assert.strictEqual(attrOnly.calculatedSize, size); + }); + + it('should calculate properly for a both message', () => { + const both: PubsubMessage = { + data: Buffer.from('test'), + attributes: { + foo: 'bar', + baz: 'quux', + }, + }; + const size = pm.calculateMessageSize(both); + assert.strictEqual(size, 17); + assert.strictEqual(both.calculatedSize, size); + }); + + // This isn't really part of the spec, but it might happen. + it('should handle undefined attributes', () => { + const weird: PubsubMessage = { + attributes: { + foo: undefined as unknown as string, + }, + }; + const size = pm.calculateMessageSize(weird); + assert.strictEqual(size, 3); + assert.strictEqual(weird.calculatedSize, size); + }); +}); diff --git a/handwritten/pubsub/test/pubsub.ts b/handwritten/pubsub/test/pubsub.ts new file mode 100644 index 00000000000..facc216299c --- /dev/null +++ b/handwritten/pubsub/test/pubsub.ts @@ -0,0 +1,1869 @@ +// Copyright 2014 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as pjy from '@google-cloud/projectify'; +import arrify = require('arrify'); +import * as assert from 'assert'; +import {describe, it, before, beforeEach, after, afterEach} from 'mocha'; +import * as gax from 'google-gax'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import defer = require('p-defer'); + +import {google} from '../protos/protos'; +import * as pubsubTypes from '../src/pubsub'; +import {Snapshot} from '../src/snapshot'; +import * as subby from '../src/subscription'; +import * as tracing from '../src/telemetry-tracing'; +import {Topic} from '../src/topic'; +import * as util from '../src/util'; +import {Schema, SchemaTypes, ISchema, SchemaViews} from '../src/schema'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const PKG = require('../../package.json'); +const sandbox = sinon.createSandbox(); + +const fakeCreds = {} as gax.grpc.ChannelCredentials; + +const subscriptionCached = subby.Subscription; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +let subscriptionOverride: any; + +function Subscription( + pubsub: pubsubTypes.PubSub, + name: string, + options: subby.SubscriptionOptions, +) { + const overrideFn = subscriptionOverride || subscriptionCached; + return new overrideFn(pubsub, name, options); +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +(Subscription as any).formatName_ = (): string => { + return 'formatted'; +}; + +let promisified = false; +const fakeUtil = Object.assign({}, util, { + promisifySome( + class_: Function, + classProtos: object, + methods: string[], + ): void { + if (class_.name === 'PubSub') { + promisified = true; + assert.deepStrictEqual(methods, [ + 'close', + 'createSubscription', + 'createTopic', + 'detachSubscription', + 'getSnapshots', + 'getSubscriptions', + 'getTopics', + ]); + } + // Defeats the method name type check. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + util.promisifySome(class_, classProtos, methods as any); + }, +}); + +let pjyOverride: Function; +function fakePjy(...args: Array<{}>) { + return (pjyOverride || pjy.replaceProjectIdToken)(...args); +} + +class FakeSnapshot { + calledWith_: Array<{}>; + constructor(...args: Array<{}>) { + this.calledWith_ = args; + } +} + +class FakeTopic { + calledWith_: Array<{}>; + getSubscriptions?: Function; + constructor(...args: Array<{}>) { + this.calledWith_ = args; + } + + // Simulate the on-demand name getter for Topic, unless a test + // explicitly sets one. + setName?: string; + get name() { + if (this.setName) { + return this.setName; + } + const pubsub = this.calledWith_[0] as pubsubTypes.PubSub; + return pubsub.projectId + '/foo'; + } + set name(val: string) { + this.setName = val; + } + + static formatName_(): string { + return 'foo'; + } +} + +let extended = false; +const fakePaginator = { + // tslint:disable-next-line variable-name + extend(Class: typeof pubsubTypes.PubSub, methods: string[]) { + if (Class.name !== 'PubSub') { + return; + } + + methods = arrify(methods); + assert.strictEqual(Class.name, 'PubSub'); + assert.deepStrictEqual(methods, [ + 'getSnapshots', + 'getSubscriptions', + 'getTopics', + ]); + + extended = true; + }, + streamify(methodName: string) { + return methodName; + }, +}; + +let googleAuthOverride: Function | null; +function fakeGoogleAuth(...args: Array<{}>) { + return (googleAuthOverride || util.noop)(...args); +} + +const v1Override = {}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +let v1ClientOverrides: any = {}; + +function defineOverridableClient(clientName: string) { + class DefaultClient { + static scopes = [] as string[]; + fakeMethod() {} + } + + Object.defineProperty(v1Override, clientName, { + get() { + return v1ClientOverrides[clientName] || DefaultClient; + }, + }); +} + +defineOverridableClient('FakeClient'); +defineOverridableClient('PublisherClient'); +defineOverridableClient('SubscriberClient'); + +describe('PubSub', () => { + // tslint:disable-next-line variable-name + let PubSub: typeof pubsubTypes.PubSub; + const PROJECT_ID = 'test-project'; + + let pubsub: Partial; + const OPTIONS = { + projectId: PROJECT_ID, + } as pubsubTypes.ClientConfig; + + const PUBSUB_EMULATOR_HOST = process.env.PUBSUB_EMULATOR_HOST; + + before(() => { + delete process.env.PUBSUB_EMULATOR_HOST; + PubSub = proxyquire('../src/pubsub', { + '@google-cloud/paginator': { + paginator: fakePaginator, + }, + '@google-cloud/projectify': { + replaceProjectIdToken: fakePjy, + }, + 'google-auth-library': { + GoogleAuth: fakeGoogleAuth, + }, + grpc: gax.grpc, + './snapshot': {Snapshot: FakeSnapshot}, + './subscription': {Subscription}, + './topic': {Topic: FakeTopic}, + './v1': v1Override, + './util': fakeUtil, + }).PubSub; + }); + + after(() => { + if (PUBSUB_EMULATOR_HOST) { + process.env.PUBSUB_EMULATOR_HOST = PUBSUB_EMULATOR_HOST; + } + }); + + beforeEach(() => { + v1ClientOverrides = {}; + googleAuthOverride = null; + pubsub = new PubSub(OPTIONS); + pubsub.projectId = PROJECT_ID; + sandbox.stub(gax.grpc.credentials, 'createInsecure').returns(fakeCreds); + }); + + afterEach(() => { + sandbox.restore(); + }); + + describe('instantiation', () => { + const maxMetadataSizeKey = 'grpc.max_metadata_size'; + const keepaliveTimeKey = 'grpc.keepalive_time_ms'; + const keepaliveTimeoutKey = 'grpc.keepalive_timeout_ms'; + + const DEFAULT_OPTIONS = { + libName: 'gccl', + libVersion: PKG.version, + scopes: [], + [maxMetadataSizeKey]: 4 * 1024 * 1024, + [keepaliveTimeKey]: 300000, + [keepaliveTimeoutKey]: 20000, + }; + + it('should extend the correct methods', () => { + assert(extended); // See `fakePaginator.extend` + }); + + it('should streamify the correct methods', () => { + assert.strictEqual(pubsub.getSnapshotsStream, 'getSnapshots'); + assert.strictEqual(pubsub.getSubscriptionsStream, 'getSubscriptions'); + assert.strictEqual(pubsub.getTopicsStream, 'getTopics'); + }); + + it('should promisify some of the things', () => { + assert(promisified); + }); + + it('should return an instance', () => { + assert(new PubSub() instanceof PubSub); + }); + + it('should augment the gRPC options', () => { + let pubsub = new PubSub(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let optionsAny: any = pubsub.options; + assert.strictEqual(optionsAny[maxMetadataSizeKey], 4 * 1024 * 1024); + assert.strictEqual(optionsAny[keepaliveTimeKey], 300000); + assert.strictEqual(optionsAny[keepaliveTimeoutKey], 20000); + + optionsAny = { + [maxMetadataSizeKey]: 1 * 1024 * 1024, + [keepaliveTimeKey]: 30, + [keepaliveTimeoutKey]: 100, + }; + pubsub = new PubSub(optionsAny); + optionsAny = pubsub.options; + assert.strictEqual(optionsAny[maxMetadataSizeKey], 1 * 1024 * 1024); + assert.strictEqual(optionsAny[keepaliveTimeKey], 30); + assert.strictEqual(optionsAny[keepaliveTimeoutKey], 100); + }); + + it('should combine all required scopes', () => { + v1ClientOverrides.SubscriberClient = {}; + v1ClientOverrides.SubscriberClient.scopes = ['a', 'b', 'c']; + + v1ClientOverrides.PublisherClient = {}; + v1ClientOverrides.PublisherClient.scopes = ['b', 'c', 'd', 'e']; + + const pubsub = new PubSub({}); + const options = {scopes: ['a', 'b', 'c', 'd', 'e']}; + const expectedOptions = Object.assign({}, DEFAULT_OPTIONS, options); + assert.deepStrictEqual(pubsub.options, expectedOptions); + }); + + it('should attempt to determine the service path and port', () => { + const determineBaseUrl_ = PubSub.prototype.determineBaseUrl_; + let called = false; + + PubSub.prototype.determineBaseUrl_ = () => { + PubSub.prototype.determineBaseUrl_ = determineBaseUrl_; + called = true; + }; + + // tslint:disable-next-line no-unused-expression + new PubSub({}); + assert(called); + }); + + it('should initialize the API object', () => { + assert.deepStrictEqual(pubsub.api, {}); + }); + + it('should default to the opened state', () => { + assert.strictEqual(pubsub.isOpen, true); + }); + + it('should enable OpenTelemetry if requested', () => { + const options: pubsubTypes.ClientConfig = { + enableOpenTelemetryTracing: true, + }; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const pubsub = new PubSub(options); + assert.strictEqual( + tracing.isEnabled(), + tracing.OpenTelemetryLevel.Modern, + ); + }); + + it('should not be in the opened state after close()', async () => { + await pubsub.close?.(); + assert.strictEqual(pubsub.isOpen, false); + }); + + it('should cache a local google-auth-library instance', () => { + const fakeGoogleAuthInstance = {}; + const options = { + a: 'b', + c: 'd', + } as pubsubTypes.ClientConfig; + const expectedOptions = Object.assign({}, DEFAULT_OPTIONS, options); + + googleAuthOverride = (options_: pubsubTypes.ClientConfig) => { + assert.deepStrictEqual(options_, expectedOptions); + return fakeGoogleAuthInstance; + }; + + const pubsub = new PubSub(options); + assert.strictEqual(pubsub.auth, fakeGoogleAuthInstance); + }); + + it('should localize the options provided', () => { + const expectedOptions = Object.assign({}, DEFAULT_OPTIONS, OPTIONS); + + assert.deepStrictEqual(pubsub.options, expectedOptions); + }); + + it('should set the projectId', () => { + assert.strictEqual(pubsub.projectId, PROJECT_ID); + }); + + it('should default the projectId to the token', () => { + const pubsub = new PubSub({}); + assert.strictEqual(pubsub.projectId, '{{projectId}}'); + }); + + it('should set isEmulator to false by default', () => { + assert.strictEqual(pubsub.isEmulator, false); + }); + + describe('tracing', () => { + beforeEach(() => { + tracing.setGloballyEnabled(false); + }); + afterEach(() => { + tracing.setGloballyEnabled(false); + }); + it('should not enable OTel when tracing is disabled', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _pubsub = new PubSub({}); + assert.strictEqual( + tracing.isEnabled(), + tracing.OpenTelemetryLevel.None, + ); + }); + + it('should enable OTel when tracing is enabled through constructor', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _pubsub = new PubSub({ + enableOpenTelemetryTracing: true, + }); + assert.strictEqual( + tracing.isEnabled(), + tracing.OpenTelemetryLevel.Modern, + ); + }); + }); + }); + + describe('createSubscription', () => { + const TOPIC_NAME = 'topic'; + pubsub = new pubsubTypes.PubSub({}); + const TOPIC = Object.assign(new FakeTopic(), { + name: 'projects/' + PROJECT_ID + '/topics/' + TOPIC_NAME, + }) as {} as Topic; + + const SUB_NAME = 'subscription'; + const SUBSCRIPTION = { + name: 'projects/' + PROJECT_ID + '/subscriptions/' + SUB_NAME, + }; + + const apiResponse = { + name: 'subscription-name', + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const subClass = Subscription as any; + + beforeEach(() => { + subClass.formatMetadata_ = (metadata: {}) => { + return Object.assign({}, metadata); + }; + }); + + it('should throw if no Topic is provided', async () => { + await assert.rejects(async () => { + await pubsub.createSubscription?.(undefined!, undefined!); + }, /A Topic is required for a new subscription\./); + }); + + it('should throw if no subscription name is provided', async () => { + await assert.rejects(async () => { + await pubsub.createSubscription?.(TOPIC_NAME, undefined!); + }, /A subscription name is required./); + }); + + it('should not require configuration options', done => { + pubsub.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + + pubsub.createSubscription?.(TOPIC, SUB_NAME, done); + }); + + it('should allow undefined/optional configuration options', done => { + pubsub.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (pubsub as any).createSubscription(TOPIC, SUB_NAME, undefined, done); + }); + + it('should create a Subscription', done => { + const opts = {a: 'b', c: 'd'} as subby.CreateSubscriptionOptions; + + pubsub.request = util.noop; + + pubsub.subscription = (subName, options) => { + assert.strictEqual(subName, SUB_NAME); + assert.deepStrictEqual(options, opts); + setImmediate(done); + return SUBSCRIPTION as subby.Subscription; + }; + pubsub.createSubscription?.(TOPIC, SUB_NAME, opts, assert.ifError); + }); + + it('should create a Topic object from a string', done => { + pubsub.request = util.noop; + + pubsub.topic = topicName => { + assert.strictEqual(topicName, TOPIC_NAME); + setImmediate(done); + return TOPIC; + }; + + pubsub.createSubscription?.(TOPIC_NAME, SUB_NAME, assert.ifError); + }); + + it('should send correct request', done => { + const options = { + gaxOpts: {}, + }; + + pubsub.topic = topicName => { + return { + name: topicName, + } as Topic; + }; + pubsub.subscription = subName => { + return { + name: subName, + } as subby.Subscription; + }; + + const reqOpts = {topic: TOPIC.name, name: SUB_NAME}; + + pubsub.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'createSubscription'); + assert.deepStrictEqual(config.reqOpts, reqOpts); + assert.deepStrictEqual(config.gaxOpts, options.gaxOpts); + done(); + }; + + pubsub.createSubscription?.(TOPIC, SUB_NAME, options, assert.ifError); + }); + + it('should pass options to the api request', done => { + const options = { + retainAckedMessages: true, + pushEndpoint: 'https://domain/push', + }; + + const expectedBody = Object.assign( + {topic: TOPIC.name, name: SUB_NAME}, + options, + ); + + pubsub.topic = () => { + return { + name: TOPIC_NAME, + } as Topic; + }; + + pubsub.subscription = () => { + return { + name: SUB_NAME, + } as subby.Subscription; + }; + + pubsub.request = config => { + assert.notStrictEqual(config.reqOpts, options); + assert.deepStrictEqual(config.reqOpts, expectedBody); + done(); + }; + + pubsub.createSubscription?.(TOPIC, SUB_NAME, options, assert.ifError); + }); + + it('should discard flow control options', done => { + const options = { + flowControl: {}, + }; + + const expectedBody = { + topic: TOPIC.name, + name: SUB_NAME, + }; + + pubsub.topic = () => { + return { + name: TOPIC_NAME, + } as Topic; + }; + + pubsub.subscription = () => { + return { + name: SUB_NAME, + } as subby.Subscription; + }; + + pubsub.request = config => { + assert.notStrictEqual(config.reqOpts, options); + assert.deepStrictEqual(config.reqOpts, expectedBody); + done(); + }; + + pubsub.createSubscription?.(TOPIC, SUB_NAME, options, assert.ifError); + }); + + it('should format the metadata', done => { + const fakeMetadata = {}; + const formatted = { + a: 'a', + }; + + subClass.formatMetadata_ = (metadata: {}) => { + assert.deepStrictEqual(metadata, fakeMetadata); + return formatted; + }; + + pubsub.request = (config: pubsubTypes.RequestConfig) => { + assert.strictEqual(config.reqOpts, formatted); + done(); + }; + + pubsub.createSubscription?.( + TOPIC, + SUB_NAME, + fakeMetadata, + assert.ifError, + ); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {name: SUB_NAME}; + + beforeEach(() => { + pubsub.request = (config, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should return error & API response to the callback', done => { + pubsub.request = (config, callback: Function) => { + callback(error, apiResponse); + }; + + function callback( + err?: Error | null, + sub?: subby.Subscription | null, + resp?: google.pubsub.v1.ISubscription | null, + ) { + assert.strictEqual(err, error); + assert.strictEqual(sub, null); + assert.strictEqual(resp, apiResponse); + done(); + } + + pubsub.createSubscription?.(TOPIC_NAME, SUB_NAME, callback); + }); + }); + + describe('success', () => { + const apiResponse = {name: SUB_NAME}; + + beforeEach(() => { + pubsub.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + }); + + it('should return Subscription & resp to the callback', done => { + const subscription = {}; + sandbox.stub(pubsub, 'subscription').callsFake(() => { + return subscription as subby.Subscription; + }); + + sandbox + .stub(pubsub, 'request') + .callsFake((config, callback: Function) => { + callback(null, apiResponse); + }); + + function callback( + err?: Error | null, + sub?: subby.Subscription | null, + resp?: google.pubsub.v1.ISubscription | null, + ) { + assert.ifError(err); + assert.strictEqual(sub, subscription); + assert.strictEqual(resp, apiResponse); + done(); + } + + pubsub.createSubscription?.(TOPIC_NAME, SUB_NAME, callback); + }); + + it('should fill the subscription object name if projectId was empty', async () => { + // Simulate the project ID not being resolved. + pubsub.projectId = '{{projectId}}'; + + sandbox + .stub(pubsub, 'request') + .callsFake((config, callback: Function) => { + pubsub.projectId = 'something'; + callback(null, apiResponse); + }); + + const [sub, resp] = await pubsub.createSubscription!( + TOPIC_NAME, + SUB_NAME, + )!; + assert.strictEqual(sub.name.includes('{{'), false); + assert.strictEqual(resp, apiResponse); + }); + }); + }); + + describe('createTopic', () => { + it('should make the correct API request', done => { + const pubsub = new pubsubTypes.PubSub(); + const topicName = 'new-topic-name'; + const formattedName = 'formatted-name'; + const gaxOpts = {}; + + pubsub.topic = name => { + assert.strictEqual(name, topicName); + + return { + name: formattedName, + } as Topic; + }; + + pubsub.request = config => { + assert.strictEqual(config.client, 'PublisherClient'); + assert.strictEqual(config.method, 'createTopic'); + assert.deepStrictEqual(config.reqOpts, {name: formattedName}); + assert.deepStrictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + pubsub.createTopic(topicName, gaxOpts, () => {}); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {}; + + beforeEach(() => { + pubsub.request = (config, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should return an error & API response', done => { + pubsub.createTopic?.('new-topic', (err, topic, apiResponse_) => { + assert.strictEqual(err, error); + assert.strictEqual(topic, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + }); + + describe('success', () => { + const apiResponse = { + name: 'new-topic', + }; + + // Types changed, so this is needed instead of `unknown`. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let requestStub: sinon.SinonStub; + + beforeEach(() => { + requestStub = sandbox + .stub(pubsub, 'request') + .callsFake((config, callback: Function) => { + callback(null, apiResponse); + }); + }); + + it('should return a Topic object', done => { + const topicName = 'new-topic'; + const topicInstance = {}; + + pubsub.topic = name => { + assert.strictEqual(name, topicName); + return topicInstance as Topic; + }; + + pubsub.createTopic?.(topicName, (err, topic) => { + assert.ifError(err); + assert.strictEqual(topic, topicInstance); + done(); + }); + }); + + it('should pass apiResponse to callback', done => { + pubsub.createTopic?.('new-topic', (err, topic, apiResponse_) => { + assert.ifError(err); + assert.strictEqual(apiResponse_, apiResponse); + done(); + }); + }); + + it('should fill the topic object name if projectId was empty', async () => { + const topicName = 'new-topic'; + + // Simulate the project ID not being resolved. + pubsub.projectId = '{{projectId}}'; + + requestStub.restore(); + sandbox + .stub(pubsub, 'request') + .callsFake((config, callback: Function) => { + pubsub.projectId = 'projectId'; + callback(null, apiResponse); + }); + + const [topic, resp] = await pubsub.createTopic!(topicName)!; + assert.strictEqual(topic.name.includes('{{'), false); + assert.strictEqual(resp, apiResponse); + }); + }); + }); + + describe('detachSubscription', () => { + pubsub = new pubsubTypes.PubSub({}); + const SUB_NAME = 'subscription'; + const SUBSCRIPTION = { + name: 'projects/' + PROJECT_ID + '/subscriptions/' + SUB_NAME, + }; + const apiResponse = 'responseToCheck'; + + it('should throw if no subscription name is provided', async () => { + await assert.rejects(async () => { + await pubsub.detachSubscription?.(undefined!); + }, /A subscription name is required./); + }); + + it('should not require configuration options', done => { + sandbox + .stub(pubsub, 'request') + .callsArgOnWith(1, undefined, undefined, apiResponse); + + pubsub.detachSubscription?.(SUB_NAME, (err, response) => { + assert.strictEqual(response, apiResponse); + done(); + }); + }); + + it('should allow undefined/optional configuration options', done => { + sandbox + .stub(pubsub, 'request') + .callsArgOnWith(1, undefined, undefined, apiResponse); + + pubsub.detachSubscription?.(SUB_NAME, undefined!, (_err, _response) => { + assert.strictEqual(_response, apiResponse); + done(); + }); + }); + + it('should detach a Subscription from a string', async () => { + sandbox.stub(pubsub, 'request').callsArg(1); + sandbox.stub(pubsub, 'subscription').callsFake(subName => { + assert.strictEqual(subName, SUB_NAME); + return SUBSCRIPTION as subby.Subscription; + }); + + await pubsub.detachSubscription?.(SUB_NAME); + }); + + it('should send correct request', done => { + const options = {}; + + sandbox.stub(pubsub, 'subscription').callsFake(subName => { + assert.strictEqual(subName, SUB_NAME); + return SUBSCRIPTION as subby.Subscription; + }); + + const reqOpts = {subscription: SUBSCRIPTION.name}; + + sandbox.stub(pubsub, 'request').callsFake(config => { + assert.strictEqual(config.client, 'PublisherClient'); + assert.strictEqual(config.method, 'detachSubscription'); + assert.deepStrictEqual(config.reqOpts, reqOpts); + assert.deepStrictEqual(config.gaxOpts, options); + done(); + }); + + pubsub.detachSubscription?.(SUB_NAME, options, assert.ifError); + }); + + it('should pass options to the api request', done => { + const options = { + pageSize: 5, + maxResults: 10, + }; + + sandbox.stub(pubsub, 'subscription').returns({ + name: SUB_NAME, + } as subby.Subscription); + + sandbox.stub(pubsub, 'request').callsFake(config => { + assert.notStrictEqual(config.reqOpts, options); + assert.deepStrictEqual(config.gaxOpts, options); + done(); + }); + + pubsub.detachSubscription?.(SUB_NAME, options, assert.ifError); + }); + }); + + describe('determineBaseUrl_', () => { + function setHost(host: string) { + process.env.PUBSUB_EMULATOR_HOST = host; + } + + function setSdkUrl(url: string) { + process.env.CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB = url; + } + + function unsetVariables() { + delete process.env.PUBSUB_EMULATOR_HOST; + delete process.env.CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB; + } + + beforeEach(() => { + unsetVariables(); + }); + + it('should do nothing if correct options are not set', () => { + pubsub.determineBaseUrl_?.(); + + assert.strictEqual(pubsub.options?.servicePath, undefined); + assert.strictEqual(pubsub.options?.port, undefined); + }); + + it('should use the apiEndpoint option', () => { + const defaultBaseUrl_ = 'defaulturl'; + const testingUrl = 'localhost:8085'; + + setHost(defaultBaseUrl_); + pubsub!.options!.apiEndpoint = testingUrl; + pubsub.determineBaseUrl_?.(); + + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, 8085); + assert.strictEqual(pubsub.options.sslCreds, fakeCreds); + assert.strictEqual(pubsub.isEmulator, true); + }); + + it('should allow overriding fake cred mode (on)', () => { + pubsub!.options!.apiEndpoint = 'something.googleapis.com'; + pubsub!.options!.emulatorMode = true; + pubsub.determineBaseUrl_?.(); + + assert.strictEqual(pubsub.options!.sslCreds, fakeCreds); + assert.strictEqual(pubsub.isEmulator, true); + }); + + it('should allow overriding fake cred mode (off)', () => { + const defaultBaseUrl_ = 'defaulturl'; + const testingUrl = 'localhost:8085'; + + setHost(defaultBaseUrl_); + pubsub!.options!.apiEndpoint = testingUrl; + pubsub!.options!.emulatorMode = false; + pubsub.determineBaseUrl_?.(); + + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, 8085); + assert.ok(pubsub.options.sslCreds === undefined); + assert.strictEqual(pubsub.isEmulator, false); + }); + + it('should remove slashes from the baseUrl', () => { + setHost('localhost:8080/'); + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, 8080); + + setHost('localhost:8081//'); + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, 8081); + }); + + it('should set the port to undefined if not set', () => { + setHost('localhost'); + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, undefined); + }); + + it('should set the port to 80 for http with no port specified', () => { + setHost('http://localhost/'); + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options?.port, 80); + }); + + it('should set the port to 443 for https with no port specified', () => { + setHost('https://localhost/'); + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, 443); + }); + + it('should create credentials from local grpc if present', () => { + const fakeCredentials = {}; + const fakeGrpc = { + credentials: { + createInsecure: () => fakeCredentials, + }, + }; + + setHost('localhost'); + pubsub!.options!.grpc = fakeGrpc as unknown as typeof gax.grpc; + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.sslCreds, fakeCredentials); + }); + + // This tests both the EMULATOR environment variable and detecting + // an emulator URL. + describe('with PUBSUB_EMULATOR_HOST environment variable', () => { + const PUBSUB_EMULATOR_HOST = 'localhost:9090'; + + beforeEach(() => { + setHost(PUBSUB_EMULATOR_HOST); + }); + + after(() => { + unsetVariables(); + }); + + it('should use the PUBSUB_EMULATOR_HOST env var', () => { + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.servicePath, 'localhost'); + assert.strictEqual(pubsub.options.port, 9090); + assert.strictEqual(pubsub.isEmulator, true); + }); + }); + + // This tests both the CLOUDSDK environment variable and detecting + // a non-emulator URL. + describe('with CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB environment variable', () => { + const server = 'some.test.server.googleapis.com'; + const apiUrl = `https://${server}/`; + + beforeEach(() => { + setSdkUrl(apiUrl); + }); + + after(() => { + unsetVariables(); + }); + + it('should use the CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB env var', () => { + pubsub.determineBaseUrl_?.(); + assert.strictEqual(pubsub.options?.servicePath, server); + assert.strictEqual(pubsub.options?.port, 443); + assert.strictEqual(pubsub.isEmulator, false); + assert.strictEqual(pubsub.options.sslCreds, undefined); + }); + }); + }); + + describe('getSnapshots', () => { + const SNAPSHOT_NAME = 'fake-snapshot'; + const apiResponse = {snapshots: [{name: SNAPSHOT_NAME}]}; + + beforeEach(() => { + pubsub.request = (config, callback: Function) => { + callback(null, apiResponse.snapshots, {}, apiResponse); + }; + }); + + it('should accept a query and a callback', done => { + pubsub.getSnapshots?.({}, done); + }); + + it('should accept just a callback', done => { + pubsub.getSnapshots?.(done); + }); + + it('should build the right request', done => { + const options = { + a: 'b', + c: 'd', + gaxOpts: { + e: 'f', + }, + autoPaginate: false, + } as {} as pubsubTypes.PageOptions; + + const expectedOptions = Object.assign({}, options, { + project: 'projects/' + pubsub.projectId, + }); + + const expectedGaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + delete expectedOptions.gaxOpts; + delete expectedOptions.autoPaginate; + + pubsub.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'listSnapshots'); + assert.deepStrictEqual(config.reqOpts, expectedOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + + pubsub.getSnapshots?.(options, assert.ifError); + }); + + it('should return Snapshot instances with metadata', done => { + const snapshot = {}; + + sandbox.stub(pubsub, 'snapshot').callsFake(name => { + assert.strictEqual(name, SNAPSHOT_NAME); + return snapshot as Snapshot; + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pubsub.getSnapshots?.((err: any, snapshots: any) => { + assert.ifError(err); + assert.strictEqual(snapshots![0], snapshot); + assert.strictEqual( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (snapshots![0] as any).metadata, + apiResponse.snapshots[0], + ); + done(); + }); + }); + + it('should pass back all parameters', done => { + const err_ = new Error('abc'); + const snapshots_ = undefined; + const nextQuery_ = {}; + const apiResponse_ = {}; + + pubsub.request = (config, callback: Function) => { + callback(err_, snapshots_, nextQuery_, apiResponse_); + }; + + pubsub.getSnapshots?.((err, snapshots, apiResponse) => { + assert.strictEqual(err, err_); + assert.deepStrictEqual(snapshots, snapshots_); + assert.strictEqual(apiResponse, nextQuery_); + done(); + }); + }); + }); + + describe('getSubscriptions', () => { + const apiResponse = {subscriptions: [{name: 'fake-subscription'}]}; + + beforeEach(() => { + pubsub.request = (config, callback: Function) => { + callback(null, apiResponse.subscriptions, {}, apiResponse); + }; + }); + + it('should accept a query and a callback', done => { + pubsub.getSubscriptions?.({}, done); + }); + + it('should accept just a callback', done => { + pubsub.getSubscriptions?.(done); + }); + + it('should pass the correct arguments to the API', done => { + const options = { + gaxOpts: { + a: 'b', + }, + autoPaginate: false, + } as {} as pubsubTypes.GetSubscriptionsOptions; + + const expectedGaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + const project = 'projects/' + pubsub.projectId; + + pubsub.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'listSubscriptions'); + assert.deepStrictEqual(config.reqOpts, {project}); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + + pubsub.getSubscriptions?.(options, assert.ifError); + }); + + it('should pass options to API request', done => { + const opts = {pageSize: 10, pageToken: 'abc'}; + + pubsub.request = config => { + const reqOpts = config.reqOpts; + const expectedOptions = Object.assign({}, opts, { + project: 'projects/' + pubsub.projectId, + }); + assert.deepStrictEqual(reqOpts, expectedOptions); + done(); + }; + + pubsub.getSubscriptions?.(opts, assert.ifError); + }); + + it('should return Subscription instances', done => { + pubsub.getSubscriptions?.( + ( + err: gax.grpc.ServiceError | null, + subscriptions?: subby.Subscription[] | null, + ) => { + assert.ifError(err); + assert(subscriptions![0] instanceof subscriptionCached); + done(); + }, + ); + }); + + it('should pass back all params', done => { + const err_ = new Error('err'); + const subs_ = undefined; + const nextQuery_ = {}; + const apiResponse_ = {}; + + pubsub.request = (config, callback: Function) => { + callback(err_, subs_, nextQuery_, apiResponse_); + }; + + pubsub.getSubscriptions?.( + ( + err: gax.grpc.ServiceError | null, + subs?: subby.Subscription[] | null, + apiResponse?: google.pubsub.v1.IListSubscriptionsResponse | null, + ) => { + assert.strictEqual(err, err_); + assert.deepStrictEqual(subs, subs_); + assert.strictEqual(apiResponse, nextQuery_); + done(); + }, + ); + }); + + describe('with topic', () => { + const TOPIC_NAME = 'topic-name'; + + it('should call topic.getSubscriptions', done => { + const topic = new FakeTopic(); + + const opts = { + topic, + } as {} as pubsubTypes.GetSubscriptionsOptions; + + topic.getSubscriptions = (options: pubsubTypes.PageOptions) => { + assert.strictEqual(options, opts); + done(); + }; + + pubsub.getSubscriptions?.(opts, assert.ifError); + }); + + it('should create a topic instance from a name', done => { + const opts = { + topic: TOPIC_NAME, + } as {} as pubsubTypes.GetSubscriptionsOptions; + + const fakeTopic = { + getSubscriptions(options: pubsubTypes.PageOptions) { + assert.strictEqual(options, opts); + done(); + }, + }; + + pubsub.topic = (name: string) => { + assert.strictEqual(name, TOPIC_NAME); + return fakeTopic as Topic; + }; + + pubsub.getSubscriptions?.(opts, assert.ifError); + }); + }); + }); + + describe('getTopics', () => { + const topicName = 'fake-topic'; + const apiResponse = {topics: [{name: topicName}]}; + + beforeEach(() => { + pubsub.request = (config, callback: Function) => { + callback(null, apiResponse.topics, {}, apiResponse); + }; + }); + + it('should accept a query and a callback', done => { + pubsub.getTopics?.({}, done); + }); + + it('should accept just a callback', done => { + pubsub.getTopics?.(done); + }); + + it('should build the right request', done => { + const options = { + a: 'b', + c: 'd', + gaxOpts: { + e: 'f', + }, + autoPaginate: false, + } as {} as pubsubTypes.PageOptions; + + const expectedOptions = Object.assign({}, options, { + project: 'projects/' + pubsub.projectId, + }); + + const expectedGaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + delete expectedOptions.gaxOpts; + delete expectedOptions.autoPaginate; + + pubsub.request = config => { + assert.strictEqual(config.client, 'PublisherClient'); + assert.strictEqual(config.method, 'listTopics'); + assert.deepStrictEqual(config.reqOpts, expectedOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + + pubsub.getTopics?.(options, assert.ifError); + }); + + it('should return Topic instances with metadata', done => { + const topic = {}; + + pubsub.topic = name => { + assert.strictEqual(name, topicName); + return topic as Topic; + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pubsub.getTopics?.((err: any, topics: any) => { + assert.ifError(err); + assert.strictEqual(topics![0], topic); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((topics![0] as any).metadata, apiResponse.topics[0]); + done(); + }); + }); + + it('should pass back all params', done => { + const err_ = new Error('err'); + const topics_ = undefined; + const nextQuery_ = {}; + const apiResponse_ = {}; + + pubsub.request = (config, callback: Function) => { + callback(err_, topics_, nextQuery_, apiResponse_); + }; + + pubsub.getTopics?.((err, topics, apiResponse) => { + assert.strictEqual(err, err_); + assert.deepStrictEqual(topics, topics_); + assert.strictEqual(apiResponse, nextQuery_); + done(); + }); + }); + }); + + describe('request', () => { + const CONFIG = { + client: 'PublisherClient', + method: 'fakeMethod', + reqOpts: {a: 'a'}, + gaxOpts: {b: 'b'}, + } as pubsubTypes.RequestConfig; + + beforeEach(() => { + delete pubsub.projectId; + afterEach(() => sandbox.restore()); + + sandbox.stub(pubsub, 'auth').value({ + getProjectId: () => Promise.resolve(PROJECT_ID), + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pjyOverride = (reqOpts: any) => { + return reqOpts; + }; + }); + + it('should throw if the PubSub is already closed', done => { + pubsub.close?.((err: Error | null) => { + assert.strictEqual(err, null); + + pubsub.request?.(CONFIG, (errInner: Error | null) => { + assert.notStrictEqual(errInner, null); + assert.strictEqual( + errInner!.message.indexOf('closed PubSub object') >= 0, + true, + ); + done(); + }); + }); + }); + + it('should call getClient_ with the correct config', done => { + pubsub.getClient_ = config => { + assert.strictEqual(config, CONFIG); + done(); + }; + + pubsub.request?.(CONFIG, assert.ifError); + }); + + it('should return error from getClient_', done => { + const expectedError = new Error('some error'); + pubsub.getClient_ = (config, callback: Function) => { + callback(expectedError); + }; + + pubsub.request?.(CONFIG, (err: gax.grpc.ServiceError | null) => { + assert.strictEqual(expectedError, err); + done(); + }); + }); + + it('should call client method with correct options', done => { + const fakeClient = {}; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (fakeClient as any).fakeMethod = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + reqOpts: any, + gaxOpts: gax.CallOptions, + ) => { + assert.deepStrictEqual(CONFIG.reqOpts, reqOpts); + assert.deepStrictEqual(CONFIG.gaxOpts, gaxOpts); + done(); + }; + pubsub.getClient_ = (config, callback: Function) => { + callback(null, fakeClient); + }; + pubsub.request?.(CONFIG, assert.ifError); + }); + + it('should replace the project id token on reqOpts', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pjyOverride = (reqOpts: any, projectId: string) => { + assert.deepStrictEqual(reqOpts, CONFIG.reqOpts); + assert.strictEqual(projectId, PROJECT_ID); + done(); + }; + pubsub.request?.(CONFIG, assert.ifError); + }); + }); + + describe('getClientAsync_', () => { + const FAKE_CLIENT_INSTANCE = class { + close() {} + }; + const CONFIG = { + client: 'FakeClient', + } as {} as pubsubTypes.GetClientConfig; + + beforeEach(() => { + sandbox.stub(pubsub, 'auth').value({getProjectId: () => util.noop}); + v1ClientOverrides.FakeClient = FAKE_CLIENT_INSTANCE; + }); + + afterEach(() => sandbox.restore()); + + describe('closeAllClients_', () => { + it('should close out any open client', async () => { + // Create a client that we'll close. + const client = await pubsub!.getClientAsync_!(CONFIG); + + // Stub out its close method, and verify it gets called. + const stub = sandbox.stub(client, 'close').resolves(); + await pubsub.closeAllClients_?.(); + + assert.strictEqual(stub.called, true); + }); + }); + + describe('project ID', () => { + beforeEach(() => { + delete pubsub.projectId; + pubsub.isEmulator = false; + }); + + it('should get and cache the project ID', async () => { + sandbox.stub(pubsub!.auth!, 'getProjectId').resolves(PROJECT_ID); + + await pubsub.getClientAsync_?.(CONFIG); + + assert.strictEqual(pubsub.projectId, PROJECT_ID); + assert.strictEqual(pubsub.options?.projectId, PROJECT_ID); + }); + + it('should get the project ID if placeholder', async () => { + pubsub.projectId = '{{projectId}}'; + sandbox.stub(pubsub!.auth!, 'getProjectId').resolves(PROJECT_ID); + + await pubsub.getClientAsync_?.(CONFIG); + + assert.strictEqual(pubsub.projectId, PROJECT_ID); + }); + + it('should return auth errors that occur', async () => { + const error = new Error('err'); + sandbox.stub(pubsub!.auth!, 'getProjectId').rejects(error); + + try { + await pubsub.getClientAsync_?.(CONFIG); + throw new Error('getClientAsync_ should have thrown an error'); + } catch (e) { + assert.strictEqual(e, error); + } + }); + + it('should ignore auth errors when using the emulator', async () => { + pubsub.isEmulator = true; + + const error = new Error('err'); + sandbox.stub(pubsub!.auth!, 'getProjectId').rejects(error); + + await pubsub.getClientAsync_?.(CONFIG); + assert.strictEqual(pubsub.projectId, ''); + }); + + it('should not get the project ID if already known', async () => { + pubsub.projectId = PROJECT_ID; + + const error = new Error('getProjectId should not be called.'); + sandbox.stub(pubsub!.auth!, 'getProjectId').rejects(error); + + await pubsub.getClientAsync_?.(CONFIG); + }); + }); + + it('should cache the client', async () => { + delete pubsub.api?.fakeClient; + + let numTimesFakeClientInstantiated = 0; + + // tslint:disable-next-line only-arrow-functions + v1ClientOverrides.FakeClient = function () { + numTimesFakeClientInstantiated++; + return FAKE_CLIENT_INSTANCE; + }; + + await pubsub.getClientAsync_?.(CONFIG); + assert.strictEqual(pubsub.api?.FakeClient, FAKE_CLIENT_INSTANCE); + + await pubsub.getClientAsync_?.(CONFIG); + assert.strictEqual(numTimesFakeClientInstantiated, 1); + }); + + it('should return the correct client', async () => { + // tslint:disable-next-line only-arrow-functions no-any + v1ClientOverrides.FakeClient = function ( + options: pubsubTypes.ClientConfig, + ) { + assert.strictEqual(options, pubsub.options); + return FAKE_CLIENT_INSTANCE; + }; + + const client = await pubsub.getClientAsync_?.(CONFIG); + assert.strictEqual(client, FAKE_CLIENT_INSTANCE); + }); + }); + + describe('getClient_', () => { + const FAKE_CLIENT_INSTANCE = {} as unknown as gax.ClientStub; + const CONFIG = { + client: 'FakeClient', + } as {} as pubsubTypes.GetClientConfig; + + it('should get the client', done => { + sandbox + .stub(pubsub, 'getClientAsync_') + .withArgs(CONFIG) + .resolves(FAKE_CLIENT_INSTANCE); + + pubsub.getClient_?.(CONFIG, (err, client) => { + assert.ifError(err); + assert.strictEqual(client, FAKE_CLIENT_INSTANCE); + done(); + }); + }); + + it('should pass back any errors', done => { + const error = new Error('err'); + sandbox.stub(pubsub, 'getClientAsync_').rejects(error); + + pubsub.getClient_?.(CONFIG, err => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('request', () => { + const CONFIG = { + client: 'SubscriberClient', + method: 'fakeMethod', + reqOpts: {a: 'a'}, + gaxOpts: {}, + } as pubsubTypes.RequestConfig; + + const FAKE_CLIENT_INSTANCE = { + [CONFIG.method]: util.noop, + }; + + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pjyOverride = (reqOpts: any) => { + return reqOpts; + }; + + pubsub.getClient_ = (config, callback: Function) => { + callback(null, FAKE_CLIENT_INSTANCE); + }; + }); + afterEach(() => sandbox.restore()); + it('should get the client', done => { + pubsub.getClient_ = config => { + assert.strictEqual(config, CONFIG); + done(); + }; + + pubsub.request?.(CONFIG, assert.ifError); + }); + + it('should return error from getting the client', done => { + const error = new Error('Error.'); + + pubsub.getClient_ = (config, callback) => { + callback(error); + }; + + pubsub.request?.(CONFIG, (err: gax.ServiceError | null) => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should replace the project id token on reqOpts', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pjyOverride = (reqOpts: any, projectId: string) => { + assert.deepStrictEqual(reqOpts, CONFIG.reqOpts); + assert.strictEqual(projectId, PROJECT_ID); + done(); + }; + + pubsub.request?.(CONFIG, assert.ifError); + }); + + it('should call the client method correctly', done => { + const CONFIG = { + client: 'FakeClient', + method: 'fakeMethod', + reqOpts: {a: 'a'}, + gaxOpts: {}, + } as {} as pubsubTypes.RequestConfig; + + const replacedReqOpts = {}; + + pjyOverride = () => { + return replacedReqOpts; + }; + + const fakeClient = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + fakeMethod(reqOpts: any, gaxOpts: gax.CallOptions) { + assert.strictEqual(reqOpts, replacedReqOpts); + assert.strictEqual(gaxOpts, CONFIG.gaxOpts); + done(); + }, + }; + + pubsub.getClient_ = (config, callback: Function) => { + callback(null, fakeClient); + }; + + pubsub.request?.(CONFIG, assert.ifError); + }); + }); + + describe('snapshot', () => { + it('should throw if a name is not provided', () => { + assert.throws(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (pubsub as any).snapshot(); + }, /You must supply a valid name for the snapshot\./); + }); + + it('should return a Snapshot object', () => { + const SNAPSHOT_NAME = 'new-snapshot'; + const snapshot = pubsub.snapshot?.(SNAPSHOT_NAME); + const args = (snapshot as {} as FakeSnapshot).calledWith_; + + assert(snapshot instanceof FakeSnapshot); + assert.strictEqual(args[0], pubsub); + assert.strictEqual(args[1], SNAPSHOT_NAME); + }); + }); + + describe('subscription', () => { + const SUB_NAME = 'new-sub-name'; + const CONFIG = {}; + + it('should return a Subscription object', () => { + // tslint:disable-next-line only-arrow-functions + subscriptionOverride = function () {}; + const subscription = pubsub.subscription?.(SUB_NAME, {}); + assert(subscription instanceof subscriptionOverride); + }); + + it('should pass specified name to the Subscription', done => { + // tslint:disable-next-line only-arrow-functions + subscriptionOverride = function ( + pubsub: pubsubTypes.PubSub, + name: string, + ) { + assert.strictEqual(name, SUB_NAME); + done(); + }; + pubsub.subscription?.(SUB_NAME); + }); + + it('should honor settings', done => { + // tslint:disable-next-line only-arrow-functions + subscriptionOverride = function ( + pubsub: pubsubTypes.PubSub, + name: string, + options: subby.SubscriptionOptions, + ) { + assert.strictEqual(options, CONFIG); + done(); + }; + pubsub.subscription?.(SUB_NAME, CONFIG); + }); + + it('should throw if a name is not provided', () => { + assert.throws(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (pubsub as any).subscription(); + }, /A name must be specified for a subscription\./); + }); + }); + + describe('topic', () => { + it('should throw if a name is not provided', () => { + assert.throws(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (pubsub as any).topic(); + }, /A name must be specified for a topic\./); + }); + + it('should return a Topic object', () => { + assert(pubsub.topic?.('new-topic') instanceof FakeTopic); + }); + + it('should pass the correct args', () => { + const fakeName = 'with-options'; + const fakeOptions = {}; + const topic = pubsub.topic?.(fakeName, fakeOptions); + + const [ps, name, options] = (topic as {} as FakeTopic).calledWith_; + + assert.strictEqual(ps, pubsub); + assert.strictEqual(name, fakeName); + assert.strictEqual(options, fakeOptions); + }); + }); + + describe('schema', () => { + function* toAsync(arr: T[]) { + for (const i of arr) { + yield i; + } + } + + it('should close the schema client when it has been opened', async () => { + // Force it to create a client. + const client = await pubsub.getSchemaClient?.(); + sandbox.stub(client!, 'close').resolves(); + await pubsub.close?.(); + }); + + // I feel like this ought to be a test, but something in getSchemaClient_() + // is trying to talk to auth services, so I'm skipping it for now. + /* it('getSchemaClient_ creates a schema client', async () => { + const client = await pubsub.getSchemaClient_(); + assert.notStrictEqual(client, undefined); + assert.notStrictEqual(client, null); + await pubsub.close(); + }); */ + + it('calls down to createSchema correctly', async () => { + const schemaId = 'id'; + const type = SchemaTypes.Avro; + const definition = 'def'; + const name = Schema.formatName_(pubsub.projectId!, schemaId); + + // Grab the schema client it'll be using so we can stub it. + const client = await pubsub.getSchemaClient!(); + const def = defer(); + sandbox.stub(client, 'createSchema').callsFake(req => { + assert.strictEqual(req.parent, pubsub.name); + assert.strictEqual(req.schemaId, schemaId); + assert.strictEqual(req.schema!.name, name); + assert.strictEqual(req.schema!.type, type); + assert.strictEqual(req.schema!.definition, definition); + def.resolve(); + }); + const result = await Promise.all([ + pubsub.createSchema!(schemaId, type, definition), + def, + ]); + assert.strictEqual(result[0].id, schemaId); + }); + + it('calls down to listSchemas correctly', async () => { + // Grab the schema client it'll be using so we can stub it. + const client = await pubsub.getSchemaClient!(); + + sandbox.stub(client, 'listSchemasAsync').callsFake((req, gaxOpts) => { + assert.strictEqual(req!.parent, pubsub.name); + assert.strictEqual(req!.view, 'BASIC'); + assert.deepStrictEqual(gaxOpts, {}); + return toAsync([ + { + name: 'foo1', + }, + { + name: 'foo2', + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ]) as any; + }); + + const ids = [] as string[]; + for await (const s of pubsub.listSchemas!(SchemaViews.Basic, {})) { + ids.push(s.name!); + } + + const expectedIds = ['foo1', 'foo2']; + assert.deepStrictEqual(ids, expectedIds); + }); + + it('defaults to BASIC for listSchemas', async () => { + // Grab the schema client it'll be using so we can stub it. + const client = await pubsub.getSchemaClient?.(); + + sandbox.stub(client!, 'listSchemasAsync').callsFake(req => { + assert.strictEqual(req!.view, 'BASIC'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return toAsync([]) as any; + }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + for await (const s of pubsub.listSchemas!()) { + break; + } + }); + + it('returns a proper Schema object from schema()', async () => { + const schema = pubsub.schema?.('foo'); + assert.strictEqual(schema!.id, 'foo'); + + const name = await schema!.getName(); + assert.strictEqual(name, Schema.formatName_(pubsub!.projectId!, 'foo')); + }); + + it('calls validateSchema() on the client when validateSchema() is called', async () => { + const client = await pubsub.getSchemaClient!(); + const ischema: ISchema = { + name: 'test', + type: SchemaTypes.Avro, + definition: 'foo', + }; + + let called = false; + sandbox + .stub(client, 'validateSchema') + .callsFake(async (params, gaxOpts) => { + assert.strictEqual(params.parent, pubsub.name); + assert.deepStrictEqual(params.schema, ischema); + assert.ok(gaxOpts); + called = true; + }); + + await pubsub.validateSchema!(ischema, {}); + assert.ok(called); + }); + }); +}); diff --git a/handwritten/pubsub/test/pull-retry.ts b/handwritten/pubsub/test/pull-retry.ts new file mode 100644 index 00000000000..b2f6a711862 --- /dev/null +++ b/handwritten/pubsub/test/pull-retry.ts @@ -0,0 +1,80 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import * as sinon from 'sinon'; +import {describe, it, beforeEach, afterEach} from 'mocha'; +import {grpc} from 'google-gax'; +import {PullRetry} from '../src/pull-retry'; + +describe('PullRetry', () => { + const sandbox = sinon.createSandbox(); + + beforeEach(() => {}); + + afterEach(() => { + sandbox.restore(); + }); + + describe('retry', () => { + it('should return true for retryable errors', () => { + [ + grpc.status.DEADLINE_EXCEEDED, + grpc.status.RESOURCE_EXHAUSTED, + grpc.status.ABORTED, + grpc.status.INTERNAL, + grpc.status.UNAVAILABLE, + ].forEach((code: grpc.status) => { + const shouldRetry = PullRetry.retry({code} as grpc.StatusObject); + assert.strictEqual(shouldRetry, true); + }); + + const serverShutdown = PullRetry.retry({ + code: grpc.status.UNAVAILABLE, + details: 'Server shutdownNow invoked', + } as grpc.StatusObject); + assert.strictEqual(serverShutdown, true); + }); + + it('should return false for non-retryable errors', () => { + [ + grpc.status.INVALID_ARGUMENT, + grpc.status.NOT_FOUND, + grpc.status.PERMISSION_DENIED, + grpc.status.FAILED_PRECONDITION, + grpc.status.OUT_OF_RANGE, + grpc.status.UNIMPLEMENTED, + ].forEach((code: grpc.status) => { + const shouldRetry = PullRetry.retry({code} as grpc.StatusObject); + assert.strictEqual(shouldRetry, false); + }); + }); + + it('should reset the failure count on OK', () => { + assert.ok( + PullRetry.resetFailures({ + code: grpc.status.OK, + } as grpc.StatusObject), + ); + }); + + it('should reset the failure count on DEADLINE_EXCEEDED', () => { + assert.ok( + PullRetry.resetFailures({ + code: grpc.status.DEADLINE_EXCEEDED, + } as grpc.StatusObject), + ); + }); + }); +}); diff --git a/handwritten/pubsub/test/schema.ts b/handwritten/pubsub/test/schema.ts new file mode 100644 index 00000000000..d1e6294640e --- /dev/null +++ b/handwritten/pubsub/test/schema.ts @@ -0,0 +1,188 @@ +// 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it, beforeEach, afterEach} from 'mocha'; +import * as sinon from 'sinon'; +import {google} from '../protos/protos'; +import {PubSub} from '../src/pubsub'; +import {ISchema, Schema, SchemaTypes, SchemaViews} from '../src/schema'; +import {SchemaServiceClient} from '../src/v1'; + +const sandbox = sinon.createSandbox(); + +describe('Schema', () => { + let pubsub: PubSub; + let schema: Schema; + let schemaClient: SchemaServiceClient; + const projectId = 'testProject'; + const projectName = `projects/${projectId}`; + const schemaId = 'testSchema'; + const schemaName = `projects/${projectId}/schemas/${schemaId}`; + const ischema: ISchema = { + name: schemaName, + type: SchemaTypes.Avro, + definition: 'foo', + }; + const encoding = google.pubsub.v1.Encoding.JSON; + + beforeEach(async () => { + pubsub = new PubSub({ + projectId: 'testProject', + }); + sandbox.stub(pubsub, 'getClientConfig').callsFake(async () => { + pubsub.projectId = projectId; + pubsub.name = projectName; + return {}; + }); + + // These depend on the create-on-first-call structure in PubSub. + // If that changes, this will also need to be updated. + schemaClient = await pubsub.getSchemaClient(); + schema = pubsub.schema(schemaName); + }); + + afterEach(async () => { + // Sadly I think it's not worthwhile to get this full pipeline + // to work for unit tests - the plan is to test the autoclose in + // the system tests. + // + // await pubsub.close(); + // Private member access: + // eslint-disable-next-line @typescript-eslint/no-explicit-any + // assert.strictEqual((schemaClient as any)._terminated, true); + + sandbox.reset(); + }); + + it('properly sets its id', () => { + assert.strictEqual(schema.id, schemaId); + }); + + it('properly sets its name', async () => { + const name = await schema.getName(); + assert.strictEqual(name, schemaName); + }); + + it('calls PubSub.createSchema() when create() is called', async () => { + let called = false; + sandbox + .stub(pubsub, 'createSchema') + .callsFake(async (name, type, def, gaxOpts) => { + assert.strictEqual(name, schemaName); + assert.strictEqual(type, SchemaTypes.Avro); + assert.strictEqual(def, 'definition'); + assert.ok(gaxOpts); + called = true; + return new Schema(pubsub, name); + }); + + await schema.create(SchemaTypes.Avro, 'definition', {}); + assert.ok(called); + }); + + it('calls getSchema() on the client when get() is called', async () => { + let called = false; + sandbox + .stub(schemaClient, 'getSchema') + .callsFake(async (params, gaxOpts) => { + const name = await schema.getName(); + assert.strictEqual(params.name, name); + assert.strictEqual(params.view, 'FULL'); + assert.deepStrictEqual(gaxOpts, {}); + called = true; + return [ischema]; + }); + + const result = await schema.get(SchemaViews.Full, {}); + assert.ok(called); + assert.strictEqual(result.name, schemaName); + assert.strictEqual(result.type, SchemaTypes.Avro); + assert.strictEqual(result.definition, 'foo'); + }); + + it('defaults to FULL when get() is called', async () => { + let called = false; + sandbox.stub(schemaClient, 'getSchema').callsFake(async params => { + assert.strictEqual(params.view, 'FULL'); + called = true; + return [ischema]; + }); + + await schema.get(); + assert.ok(called); + }); + + it('calls deleteSchema() on the client when delete() is called', async () => { + let called = false; + sandbox + .stub(schemaClient, 'deleteSchema') + .callsFake(async (params, gaxOpts) => { + assert.strictEqual(params.name, schemaName); + assert.ok(gaxOpts); + called = true; + }); + + await schema.delete({}); + assert.ok(called); + }); + + it('calls validateMessage() on the client when validateMessage() is called on the wrapper', async () => { + let called = false; + sandbox + .stub(schemaClient, 'validateMessage') + .callsFake(async (params, gaxOpts) => { + const name = await schema.getName(); + assert.strictEqual(params.parent, pubsub.name); + assert.strictEqual(params.name, name); + assert.strictEqual(params.schema, undefined); + assert.strictEqual(params.message, 'foo'); + assert.strictEqual(params.encoding, encoding); + assert.ok(gaxOpts); + called = true; + }); + + await schema.validateMessage('foo', encoding, {}); + assert.ok(called); + }); + + it('resolves a missing project ID', async () => { + pubsub = new PubSub(); + schema = pubsub.schema(schemaId); + assert.strictEqual(pubsub.isIdResolved, false); + assert.strictEqual(schema.name_, undefined); + sandbox.stub(pubsub, 'getClientConfig').callsFake(async () => { + pubsub.projectId = projectId; + pubsub.name = projectName; + return {}; + }); + const name = await schema.getName(); + assert.strictEqual(pubsub.isIdResolved, true); + assert.strictEqual(name, schemaName); + }); + + it('loads metadata from a received message', () => { + const testAttrs = { + googclient_schemaencoding: 'JSON', + googclient_schemarevisionid: 'revision', + googclient_schemaname: 'foobar', + }; + const metadata = Schema.metadataFromMessage(testAttrs); + assert.deepStrictEqual(metadata, { + name: 'foobar', + revision: 'revision', + encoding: 'JSON', + }); + }); +}); diff --git a/handwritten/pubsub/test/snapshot.ts b/handwritten/pubsub/test/snapshot.ts new file mode 100644 index 00000000000..5e5da3efec7 --- /dev/null +++ b/handwritten/pubsub/test/snapshot.ts @@ -0,0 +1,239 @@ +// Copyright 2014 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {ServiceError} from 'google-gax'; +import {describe, it, beforeEach, before, after, afterEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; + +import {PubSub, RequestConfig} from '../src/pubsub'; +import * as snapTypes from '../src/snapshot'; +import {Subscription} from '../src/subscription'; +import * as util from '../src/util'; + +let promisified = false; +const fakeUtil = Object.assign({}, util, { + promisifySome( + class_: Function, + classProtos: object, + methods: string[], + ): void { + if (class_.name === 'Snapshot') { + promisified = true; + assert.deepStrictEqual(methods, ['delete', 'create', 'seek']); + } + // Defeats the method name type check. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + util.promisifySome(class_, classProtos, methods as any); + }, +}); + +describe('Snapshot', () => { + // tslint:disable-next-line variable-name + let Snapshot: typeof snapTypes.Snapshot; + + let snapshot: snapTypes.Snapshot; + + const SNAPSHOT_NAME = 'a'; + const PROJECT_ID = 'grape-spaceship-123'; + + const PUBSUB = { + projectId: PROJECT_ID, + } as {} as PubSub; + + const SUBSCRIPTION = { + projectId: PROJECT_ID, + pubsub: PUBSUB, + api: {}, + createSnapshot() {}, + seek() {}, + } as {} as Subscription; + + before(() => { + Snapshot = proxyquire('../src/snapshot', { + './util': fakeUtil, + }).Snapshot; + }); + + const sandbox = sinon.createSandbox(); + beforeEach(() => { + snapshot = new Snapshot(SUBSCRIPTION, SNAPSHOT_NAME); + }); + afterEach(() => sandbox.restore()); + + describe('initialization', () => { + const FULL_SNAPSHOT_NAME = 'a/b/c/d'; + let formatName_: (projectId: string, name: string) => string; + + before(() => { + formatName_ = Snapshot.formatName_; + Snapshot.formatName_ = () => { + return FULL_SNAPSHOT_NAME; + }; + }); + + after(() => { + Snapshot.formatName_ = formatName_; + }); + + it('should promisify some of the things', () => { + assert(promisified); + }); + + it('should localize the parent', () => { + assert.strictEqual(snapshot.parent, SUBSCRIPTION); + }); + + describe('name', () => { + it('should create and cache the full name', () => { + Snapshot.formatName_ = (projectId: string, name: string) => { + assert.strictEqual(projectId, PROJECT_ID); + assert.strictEqual(name, SNAPSHOT_NAME); + return FULL_SNAPSHOT_NAME; + }; + + const snapshot = new Snapshot(SUBSCRIPTION, SNAPSHOT_NAME); + assert.strictEqual(snapshot.name, FULL_SNAPSHOT_NAME); + }); + + it('should pull the projectId from parent object', () => { + Snapshot.formatName_ = (projectId: string, name: string) => { + assert.strictEqual(projectId, PROJECT_ID); + assert.strictEqual(name, SNAPSHOT_NAME); + return FULL_SNAPSHOT_NAME; + }; + + const snapshot = new Snapshot(SUBSCRIPTION, SNAPSHOT_NAME); + assert.strictEqual(snapshot.name, FULL_SNAPSHOT_NAME); + }); + }); + + describe('with Subscription parent', () => { + let pubsub: PubSub; + let subscription: Subscription; + before(() => { + pubsub = new PubSub({projectId: PROJECT_ID}); + subscription = pubsub.subscription('test'); + }); + + describe('create', () => { + beforeEach(() => { + snapshot = new Snapshot(subscription, SNAPSHOT_NAME); + }); + + it('should call createSnapshot', done => { + const fakeOpts = {}; + sandbox + .stub(subscription, 'createSnapshot') + .callsFake((name, options) => { + assert.strictEqual(name, FULL_SNAPSHOT_NAME); + assert.strictEqual(options, fakeOpts); + done(); + }); + + snapshot.create(fakeOpts, assert.ifError); + }); + + it('should return any request errors', done => { + const fakeError = new Error('err'); + const fakeResponse = {}; + const stub = sandbox.stub(subscription, 'createSnapshot'); + + snapshot.create((err, snap, resp) => { + assert.strictEqual(err, fakeError); + assert.strictEqual(snap, null); + assert.strictEqual(resp, fakeResponse); + done(); + }); + + const callback = stub.lastCall.args[2]; + setImmediate(callback, fakeError as ServiceError, null, fakeResponse); + }); + + it('should return the correct snapshot', done => { + const fakeSnapshot = new Snapshot(SUBSCRIPTION, SNAPSHOT_NAME); + const fakeResponse = {}; + const stub = sandbox.stub(subscription, 'createSnapshot'); + + snapshot.create((err, snap, resp) => { + assert.ifError(err); + assert.strictEqual(snap, snapshot); + assert.strictEqual(resp, fakeResponse); + done(); + }); + + const callback = stub.lastCall.args[2]; + setImmediate(callback, null, fakeSnapshot, fakeResponse); + }); + }); + + it('should call the seek method', done => { + sandbox.stub(subscription, 'seek').callsFake(snapshot => { + assert.strictEqual(snapshot, FULL_SNAPSHOT_NAME); + done(); + }); + const snapshot = new Snapshot(subscription, SNAPSHOT_NAME); + snapshot.seek(assert.ifError); + }); + }); + + describe('with PubSub parent', () => { + beforeEach(() => { + snapshot = new Snapshot(PUBSUB, SNAPSHOT_NAME); + }); + + it('should throw on create method', async () => { + await assert.rejects( + () => snapshot.create(), + /This is only available if you accessed this object through Subscription#snapshot/, + ); + }); + + it('should throw on seek method', async () => { + await assert.rejects( + () => snapshot.seek(), + /This is only available if you accessed this object through Subscription#snapshot/, + ); + }); + }); + }); + + describe('formatName_', () => { + const EXPECTED = 'projects/' + PROJECT_ID + '/snapshots/' + SNAPSHOT_NAME; + + it('should format the name', () => { + const name = Snapshot.formatName_(PROJECT_ID, SNAPSHOT_NAME); + assert.strictEqual(name, EXPECTED); + }); + + it('should not re-format the name', () => { + const name = Snapshot.formatName_(PROJECT_ID, EXPECTED); + assert.strictEqual(name, EXPECTED); + }); + }); + + describe('delete', () => { + it('should make the correct request', done => { + snapshot.parent.request = (config: RequestConfig, callback: Function) => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'deleteSnapshot'); + assert.deepStrictEqual(config.reqOpts, {snapshot: snapshot.name}); + callback(); // the done fn + }; + + snapshot.delete(done); + }); + }); +}); diff --git a/handwritten/pubsub/test/subscriber.ts b/handwritten/pubsub/test/subscriber.ts new file mode 100644 index 00000000000..5cf205cfd9b --- /dev/null +++ b/handwritten/pubsub/test/subscriber.ts @@ -0,0 +1,1527 @@ +/*! + * Copyright 2019 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {exporter} from './tracing'; +import * as assert from 'assert'; +import {describe, it, beforeEach, afterEach} from 'mocha'; +import {EventEmitter} from 'events'; +import {common as protobuf} from 'protobufjs'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; +import {PassThrough} from 'stream'; +import * as uuid from 'uuid'; +import * as opentelemetry from '@opentelemetry/api'; +import {google} from '../protos/protos'; +import * as defer from 'p-defer'; + +import {HistogramOptions} from '../src/histogram'; +import {FlowControlOptions, LeaseManager} from '../src/lease-manager'; +import {BatchOptions} from '../src/message-queues'; +import {MessageStreamOptions} from '../src/message-stream'; +import * as s from '../src/subscriber'; +import {Subscription} from '../src/subscription'; +import {SpanKind} from '@opentelemetry/api'; +import {Duration} from '../src'; +import * as tracing from '../src/telemetry-tracing'; +import {FakeLog, TestUtils} from './test-utils'; +import {loggingUtils} from 'google-gax'; + +type PullResponse = google.pubsub.v1.IStreamingPullResponse; + +const stubs = new Map(); + +class FakeClient {} + +interface ClientOptions { + client: string; +} + +interface ClientCallback { + (error: null | Error, client: FakeClient): void; +} + +class FakePubSub { + client = new FakeClient(); + getClient_(options: ClientOptions, callback: ClientCallback): void { + callback(null, this.client); + } +} + +const projectId = uuid.v4(); +const subId = uuid.v4(); + +class FakeSubscription { + name = `projects/${projectId}/subscriptions/${subId}`; + pubsub = new FakePubSub(); +} + +interface PublicInventory { + _inventory: LeaseManager; +} + +class FakeHistogram { + options?: HistogramOptions; + constructor(options?: HistogramOptions) { + this.options = options; + + const key = options ? 'histogram' : 'latencies'; + stubs.set(key, this); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + add(seconds: number): void {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + percentile(percentile: number): number { + return 10; + } +} + +class FakeLeaseManager extends EventEmitter { + options: FlowControlOptions; + constructor(sub: s.Subscriber, options: FlowControlOptions) { + super(); + this.options = options; + stubs.set('inventory', this); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + add(message: s.Message): void {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + setOptions(options: FlowControlOptions): void {} + clear(): s.Message[] { + return []; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + remove(message: s.Message): void {} + + _isEmpty = true; + isEmpty(): boolean { + return this._isEmpty; + } +} + +class FakeQueue { + options: BatchOptions; + numPendingRequests = 0; + numInFlightRequests = 0; + maxMilliseconds = 100; + constructor(sub: s.Subscriber, options: BatchOptions) { + this.options = options; + } + close() {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + async add(message: s.Message, deadline?: number): Promise { + return s.AckResponses.Success; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + setOptions(options: BatchOptions) {} + async flush(): Promise {} + async onFlush(): Promise {} + async onDrain(): Promise {} +} + +class FakeAckQueue extends FakeQueue { + constructor(sub: s.Subscriber, options: BatchOptions) { + super(sub, options); + stubs.set('ackQueue', this); + } +} + +class FakeModAckQueue extends FakeQueue { + constructor(sub: s.Subscriber, options: BatchOptions) { + super(sub, options); + stubs.set('modAckQueue', this); + } +} + +class FakeMessageStream extends PassThrough { + options: MessageStreamOptions; + constructor(sub: s.Subscriber, options: MessageStreamOptions) { + super({objectMode: true}); + this.options = options; + stubs.set('messageStream', this); + } + setStreamAckDeadline(): void {} + _destroy( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _error: Error | null, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _callback: (error: Error | null) => void, + ): void {} + async start() {} +} + +class FakePreciseDate { + value: protobuf.ITimestamp; + constructor(date: protobuf.ITimestamp) { + this.value = date; + } +} + +const RECEIVED_MESSAGE = { + ackId: uuid.v4(), + message: { + attributes: {}, + data: Buffer.from('Hello, world!'), + messageId: uuid.v4(), + orderingKey: 'ordering-key', + publishTime: {seconds: 12, nanos: 32}, + }, +}; + +interface SubInternals { + _stream: FakeMessageStream; + _inventory: FakeLeaseManager; + _onData(response: PullResponse): void; + _discardMessage(message: s.Message): void; + _waitForFlush(timeout?: Duration): Promise; +} + +function getSubInternals(sub: s.Subscriber) { + return sub as unknown as SubInternals; +} + +describe('Subscriber', () => { + let sandbox: sinon.SinonSandbox; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let fakeProjectify: any; + let subscription: Subscription; + + // tslint:disable-next-line variable-name + let Message: typeof s.Message; + let message: s.Message; + // tslint:disable-next-line variable-name + let Subscriber: typeof s.Subscriber; + let subscriber: s.Subscriber; + + let fakeLog: FakeLog | undefined; + + beforeEach(() => { + sandbox = sinon.createSandbox(); + fakeProjectify = { + replaceProjectIdToken: sandbox + .stub() + .callsFake((name: string, projectId: string) => { + if (name.indexOf('/') >= 0) { + return name; + } else { + return `projects/${projectId}/name/${name}`; + } + }), + }; + + const s = proxyquire('../src/subscriber.js', { + '@google-cloud/precise-date': {PreciseDate: FakePreciseDate}, + '@google-cloud/projectify': fakeProjectify, + './histogram': {Histogram: FakeHistogram}, + './lease-manager': {LeaseManager: FakeLeaseManager}, + './message-queues': { + AckQueue: FakeAckQueue, + ModAckQueue: FakeModAckQueue, + }, + './message-stream': {MessageStream: FakeMessageStream}, + }); + + Message = s.Message; + Subscriber = s.Subscriber; + + // Create standard instance + subscription = new FakeSubscription() as {} as Subscription; + subscriber = new Subscriber(subscription); + message = new Message(subscriber, RECEIVED_MESSAGE); + subscriber.open(); + }); + + afterEach(async () => { + fakeLog?.remove(); + fakeLog = undefined; + sandbox.restore(); + await subscriber.close(); + tracing.setGloballyEnabled(false); + }); + + describe('initialization', () => { + it('should default ackDeadline to 10', () => { + assert.strictEqual(subscriber.ackDeadline, 10); + }); + + it('should default maxMessages to 1000', () => { + assert.strictEqual(subscriber.maxMessages, 1000); + }); + + it('should default maxBytes to 100MB', () => { + assert.strictEqual(subscriber.maxBytes, 100 * 1024 * 1024); + }); + + it('should set isOpen to false', () => { + const s = new Subscriber(subscription); + assert.strictEqual(s.isOpen, false); + }); + + it('should set any options passed in', () => { + const options = { + streamingOptions: {}, + }; + const subscriber = new Subscriber(subscription, options); + assert.strictEqual( + subscriber.getOptions().streamingOptions, + options.streamingOptions, + ); + }); + }); + + describe('receive', () => { + it('should add incoming messages to inventory w/o exactly-once', () => { + const sub = new Subscriber(subscription); + sub.isOpen = true; + const subint = getSubInternals(sub); + const modAckStub = sandbox.stub(sub, 'modAck'); + subint._inventory = new FakeLeaseManager(sub, {}); + const addStub = sandbox.stub(subint._inventory, 'add'); + subint._onData({ + subscriptionProperties: { + exactlyOnceDeliveryEnabled: false, + messageOrderingEnabled: false, + }, + receivedMessages: [ + { + ackId: 'ackack', + message: { + data: 'foo', + attributes: {}, + }, + }, + ], + }); + + assert.ok(modAckStub.calledOnce); + assert.ok(addStub.calledOnce); + }); + + it('should add incoming messages to inventory w/exactly-once, success', async () => { + const sub = new Subscriber(subscription); + sub.isOpen = true; + const subint = getSubInternals(sub); + subint._stream = new FakeMessageStream(sub, {}); + subint._inventory = new FakeLeaseManager(sub, {}); + const modAckStub = sandbox.stub(sub, 'modAckWithResponse'); + modAckStub.callsFake(async () => s.AckResponses.Success); + const addStub = sandbox.stub(subint._inventory, 'add'); + const done = defer(); + addStub.callsFake(() => { + assert.ok(modAckStub.calledOnce); + done.resolve(); + }); + subint._onData({ + subscriptionProperties: { + exactlyOnceDeliveryEnabled: true, + messageOrderingEnabled: false, + }, + receivedMessages: [ + { + ackId: 'ackack', + message: { + data: 'foo', + attributes: {}, + }, + }, + ], + }); + + await done.promise; + }); + + it('should add incoming messages to inventory w/exactly-once, permanent failure', async () => { + const sub = new Subscriber(subscription); + sub.isOpen = true; + const subint = getSubInternals(sub); + subint._stream = new FakeMessageStream(sub, {}); + subint._inventory = new FakeLeaseManager(sub, {}); + + const done = defer(); + + const modAckStub = sandbox.stub(sub, 'modAckWithResponse'); + modAckStub.rejects(new s.AckError(s.AckResponses.Invalid)); + const addStub = sandbox.stub(subint._inventory, 'add'); + const discardStub = sandbox.stub(subint, '_discardMessage'); + discardStub.callsFake(() => { + assert.ok(modAckStub.calledOnce); + assert.ok(addStub.notCalled); + done.resolve(); + }); + + subint._onData({ + subscriptionProperties: { + exactlyOnceDeliveryEnabled: true, + messageOrderingEnabled: false, + }, + receivedMessages: [ + { + ackId: 'ackack', + message: { + data: 'foo', + attributes: {}, + }, + }, + ], + }); + + await done.promise; + }); + }); + + describe('modAckLatency', () => { + it('should get the 99th percentile latency', () => { + const latencies: FakeHistogram = stubs.get('latencies'); + const fakeLatency = 234; + + sandbox.stub(latencies, 'percentile').withArgs(99).returns(fakeLatency); + + const maxMilliseconds = stubs.get('modAckQueue').maxMilliseconds; + const expectedLatency = fakeLatency * 1000 + maxMilliseconds; + + assert.strictEqual(subscriber.modAckLatency, expectedLatency); + }); + }); + + describe('name', () => { + it('should replace the project id token', () => { + const fakeName = 'abcd'; + + fakeProjectify.replaceProjectIdToken + .withArgs(subscription.name, subscription.projectId) + .returns(fakeName); + + const name = subscriber.name; + assert.strictEqual(name, fakeName); + }); + + it('should cache the name', () => { + const fakeName = 'abcd'; + const stub = fakeProjectify.replaceProjectIdToken + .withArgs(subscription.name, subscription.projectId) + .returns(fakeName); + + const name = subscriber.name; + assert.strictEqual(name, fakeName); + + const name2 = subscriber.name; + assert.strictEqual(name, name2); + assert.strictEqual(stub.callCount, 1); + }); + }); + + describe('ack', () => { + it('should update the ack histogram/deadline', async () => { + const histogram: FakeHistogram = stubs.get('histogram'); + const now = Date.now(); + + message.received = 23842328; + sandbox.stub(global.Date, 'now').returns(now); + + const expectedSeconds = (now - message.received) / 1000; + const addStub = sandbox.stub(histogram, 'add').withArgs(expectedSeconds); + + const fakeDeadline = 598; + + sandbox.stub(histogram, 'percentile').withArgs(99).returns(fakeDeadline); + + await subscriber.ack(message); + + assert.strictEqual(addStub.callCount, 1); + assert.strictEqual(subscriber.ackDeadline, fakeDeadline); + }); + + it('should log on ack completion', async () => { + fakeLog = new FakeLog(s.logs.ackNack); + + await subscriber.ack(message); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1], message.id); + }); + + it('should log if the ack time is longer than the 99th percentile', async () => { + const histogram: FakeHistogram = stubs.get('histogram'); + TestUtils.useFakeTimers(sandbox, Date.now()); + + message.received = 0; + sandbox.stub(histogram, 'percentile').withArgs(99).returns(10); + fakeLog = new FakeLog(s.logs.slowAck); + + await subscriber.ack(message); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1], message.id); + }); + + it('should bound ack deadlines if min/max are specified', async () => { + const histogram: FakeHistogram = stubs.get('histogram'); + const now = Date.now(); + + message.received = 23842328; + sandbox.stub(global.Date, 'now').returns(now); + + const expectedSeconds = (now - message.received) / 1000; + const addStub = sandbox.stub(histogram, 'add').withArgs(expectedSeconds); + + let fakeDeadline = 312123; + sandbox + .stub(histogram, 'percentile') + .withArgs(99) + .callsFake(() => fakeDeadline); + + subscriber.setOptions({ + maxAckDeadline: Duration.from({seconds: 60}), + }); + await subscriber.ack(message); + + assert.strictEqual(addStub.callCount, 1); + assert.strictEqual(subscriber.ackDeadline, 60); + + subscriber.setOptions({ + minAckDeadline: Duration.from({seconds: 10}), + }); + fakeDeadline = 1; + await subscriber.ack(message); + + assert.strictEqual(subscriber.ackDeadline, 10); + }); + + it('should default to 60s min for exactly-once delivery subscriptions', async () => { + subscriber.setSubscriptionProperties({exactlyOnceDeliveryEnabled: true}); + + const histogram: FakeHistogram = stubs.get('histogram'); + const now = Date.now(); + + message.received = 23842328; + sandbox.stub(global.Date, 'now').returns(now); + + const expectedSeconds = (now - message.received) / 1000; + const addStub = sandbox.stub(histogram, 'add').withArgs(expectedSeconds); + + const fakeDeadline = 10; + sandbox.stub(histogram, 'percentile').withArgs(99).returns(fakeDeadline); + + await subscriber.ack(message); + + assert.strictEqual(addStub.callCount, 1); + assert.strictEqual(subscriber.ackDeadline, 60); + + // Also check that if we set a different min, it's honoured. + subscriber.setOptions({ + minAckDeadline: Duration.from({seconds: 5}), + }); + await subscriber.ack(message); + + assert.strictEqual(subscriber.ackDeadline, 10); + }); + + it('should not update the deadline if user specified', () => { + const histogram: FakeHistogram = stubs.get('histogram'); + const ackDeadline = 543; + const maxMessages = 20; + const maxBytes = 20000; + + sandbox.stub(histogram, 'add').throws(); + sandbox.stub(histogram, 'percentile').throws(); + + const deadlineTime = Duration.from({seconds: ackDeadline}); + subscriber.setOptions({ + minAckDeadline: deadlineTime, + maxAckDeadline: deadlineTime, + flowControl: {maxMessages: maxMessages, maxBytes: maxBytes}, + }); + void subscriber.ack(message); + + assert.strictEqual(subscriber.ackDeadline, ackDeadline); + }); + + it('should add the message to the ack queue', () => { + const ackQueue: FakeAckQueue = stubs.get('ackQueue'); + const stub = sandbox.stub(ackQueue, 'add').withArgs(message); + + void subscriber.ack(message); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should remove the message from inv. after queue flushes', done => { + const ackQueue: FakeAckQueue = stubs.get('ackQueue'); + const inventory: FakeLeaseManager = stubs.get('inventory'); + + const onFlushStub = sandbox.stub(ackQueue, 'onFlush').resolves(); + + sandbox + .stub(inventory, 'remove') + .withArgs(message) + .callsFake(() => { + assert.strictEqual(onFlushStub.callCount, 1); + done(); + }); + + void subscriber.ack(message); + }); + }); + + describe('close', () => { + it('should noop if not open', () => { + const s = new Subscriber(subscription); + const stream: FakeMessageStream = stubs.get('messageStream'); + + sandbox + .stub(stream, 'destroy') + .rejects(new Error('should not be called.')); + + return s.close(); + }); + + it('should set isOpen to false', async () => { + await subscriber.close(); + assert.strictEqual(subscriber.isOpen, false); + }); + + it('should destroy the message stream', async () => { + const stream: FakeMessageStream = stubs.get('messageStream'); + const stub = sandbox.stub(stream, 'destroy'); + + await subscriber.close(); + assert.strictEqual(stub.callCount, 1); + }); + + it('should clear the inventory', async () => { + const message = new Message(subscriber, RECEIVED_MESSAGE); + const shutdownStub = sandbox.stub(tracing.PubsubEvents, 'shutdown'); + const inventory: FakeLeaseManager = stubs.get('inventory'); + const stub = sandbox.stub(inventory, 'clear').returns([message]); + + // The leaser would've immediately called dispatched(). Pretend that + // we're user code. + message.ack(); + + await subscriber.close(); + assert.strictEqual(stub.callCount, 1); + assert.strictEqual(shutdownStub.callCount, 1); + }); + + it('should emit a close event', done => { + subscriber.on('close', done); + void subscriber.close(); + }); + + it('should nack any messages that come in after', async () => { + const stream: FakeMessageStream = stubs.get('messageStream'); + const stub = sandbox.stub(subscriber, 'nack'); + const shutdownStub = sandbox.stub(tracing.PubsubEvents, 'shutdown'); + const pullResponse = {receivedMessages: [RECEIVED_MESSAGE]}; + + await subscriber.close(); + stream.emit('data', pullResponse); + + const [{ackId}] = stub.lastCall.args; + assert.strictEqual(ackId, RECEIVED_MESSAGE.ackId); + assert.strictEqual(shutdownStub.callCount, 1); + }); + + describe('flushing the queues', () => { + it('should wait for any pending acks', async () => { + const ackQueue: FakeAckQueue = stubs.get('ackQueue'); + const ackOnFlush = sandbox.stub(ackQueue, 'onFlush').resolves(); + const acksFlush = sandbox.stub(ackQueue, 'flush').resolves(); + + ackQueue.numPendingRequests = 1; + await subscriber.close(); + + assert.strictEqual(ackOnFlush.callCount, 1); + assert.strictEqual(acksFlush.callCount, 1); + }); + + it('should wait for any pending modAcks', async () => { + const modAckQueue: FakeModAckQueue = stubs.get('modAckQueue'); + const modAckOnFlush = sandbox.stub(modAckQueue, 'onFlush').resolves(); + const modAckFlush = sandbox.stub(modAckQueue, 'flush').resolves(); + + modAckQueue.numPendingRequests = 1; + await subscriber.close(); + + assert.strictEqual(modAckOnFlush.callCount, 1); + assert.strictEqual(modAckFlush.callCount, 1); + }); + + it('should resolve if no messages are pending', async () => { + const ackQueue: FakeAckQueue = stubs.get('ackQueue'); + + sandbox.stub(ackQueue, 'flush').rejects(); + sandbox.stub(ackQueue, 'onFlush').rejects(); + sandbox.stub(ackQueue, 'onDrain').rejects(); + + const modAckQueue: FakeModAckQueue = stubs.get('modAckQueue'); + + sandbox.stub(modAckQueue, 'flush').rejects(); + sandbox.stub(modAckQueue, 'onFlush').rejects(); + + await subscriber.close(); + }); + + it('should wait for in-flight messages to drain', async () => { + const ackQueue: FakeAckQueue = stubs.get('ackQueue'); + const modAckQueue: FakeModAckQueue = stubs.get('modAckQueue'); + const ackOnDrain = sandbox.stub(ackQueue, 'onDrain').resolves(); + const modAckOnDrain = sandbox.stub(modAckQueue, 'onDrain').resolves(); + + ackQueue.numInFlightRequests = 1; + modAckQueue.numInFlightRequests = 1; + await subscriber.close(); + + assert.strictEqual(ackOnDrain.callCount, 1); + assert.strictEqual(modAckOnDrain.callCount, 1); + }); + }); + + describe('close with timeout', () => { + let clock: sinon.SinonFakeTimers; + let inventory: FakeLeaseManager; + let ackQueue: FakeAckQueue; + let modAckQueue: FakeModAckQueue; + let subInternals: SubInternals; + + beforeEach(() => { + clock = sandbox.useFakeTimers(); + inventory = stubs.get('inventory'); + ackQueue = stubs.get('ackQueue'); + modAckQueue = stubs.get('modAckQueue'); + + // Ensure subscriber is open before each test + if (!subscriber.isOpen) { + subscriber.open(); + } + + subInternals = subscriber as unknown as SubInternals; + }); + + afterEach(() => { + clock.restore(); + }); + + it('should do nothing if isOpen = false', async () => { + const destroySpy = sandbox.spy(subInternals._stream, 'destroy'); + subscriber.isOpen = false; + await subscriber.close(); + assert.strictEqual(destroySpy.callCount, 0); + }); + + it('should clear inventory and bail for timeout = 0', async () => { + const clearSpy = sandbox.spy(inventory, 'clear'); + const onSpy = sandbox.spy(inventory, 'on'); + subscriber.setOptions({ + closeOptions: { + timeout: Duration.from({milliseconds: 0}), + }, + }); + await subscriber.close(); + assert.strictEqual(clearSpy.callCount, 1); + assert.strictEqual(onSpy.callCount, 0); + }); + + it('should not wait for an empty inventory in NackImmediately', async () => { + const onSpy = sandbox.spy(inventory, 'on'); + subscriber.setOptions({ + closeOptions: { + behavior: s.SubscriberCloseBehaviors.NackImmediately, + timeout: Duration.from({milliseconds: 100}), + }, + }); + await subscriber.close(); + assert.strictEqual(onSpy.callCount, 0); + }); + + it('should not wait for an empty inventory in WaitForProcessing if empty', async () => { + const onSpy = sandbox.spy(inventory, 'on'); + subscriber.setOptions({ + closeOptions: { + behavior: s.SubscriberCloseBehaviors.WaitForProcessing, + timeout: Duration.from({milliseconds: 100}), + }, + }); + await subscriber.close(); + assert.strictEqual(onSpy.callCount, 0); + }); + + it('should wait for an empty inventory in WaitForProcessing if not empty', async () => { + inventory._isEmpty = false; + const onSpy = sandbox.spy(inventory, 'on'); + subscriber.setOptions({ + closeOptions: { + behavior: s.SubscriberCloseBehaviors.WaitForProcessing, + timeout: Duration.from({seconds: 2}), + }, + }); + const prom = subscriber.close(); + assert.strictEqual(onSpy.callCount, 1); + clock.tick(3000); + await prom; + }); + + it('should nack remaining messages if timeout is non-zero', async () => { + const mockMessages = [ + new Message(subscriber, RECEIVED_MESSAGE), + new Message(subscriber, RECEIVED_MESSAGE), + ]; + sandbox.stub(inventory, 'clear').returns(mockMessages); + const nackSpy = sandbox.spy(subscriber, 'nack'); + + subscriber.setOptions({ + closeOptions: { + timeout: Duration.from({seconds: 5}), + }, + }); + const prom = subscriber.close(); + clock.tick(6000); + await prom; + + assert.strictEqual(nackSpy.callCount, mockMessages.length); + mockMessages.forEach((msg, i) => { + assert.strictEqual(nackSpy.getCall(i).args[0], msg); + }); + }); + + it('should wait for drain promises and respect timeout', async () => { + const ackDrainDeferred = defer(); + const modAckDrainDeferred = defer(); + sandbox.stub(ackQueue, 'onDrain').returns(ackDrainDeferred.promise); + sandbox + .stub(modAckQueue, 'onDrain') + .returns(modAckDrainDeferred.promise); + ackQueue.numInFlightRequests = 1; // Ensure drain is waited for + modAckQueue.numInFlightRequests = 1; + + let closed = false; + subscriber.setOptions({ + closeOptions: { + behavior: s.SubscriberCloseBehaviors.NackImmediately, + timeout: Duration.from({milliseconds: 100}), + }, + }); + const prom = subscriber.close().then(() => { + closed = true; + }); + + // Advance time past the timeout + clock.tick(200); + await prom; + + // Promise should resolve even though drains haven't + assert.strictEqual(closed, true); + + // Resolve drains afterwards to prevent hanging tests if logic fails + ackDrainDeferred.resolve(); + modAckDrainDeferred.resolve(); + }); + + it('should resolve early if drain completes before timeout', async () => { + const ackDrainDeferred = defer(); + const modAckDrainDeferred = defer(); + sandbox.stub(ackQueue, 'onDrain').returns(ackDrainDeferred.promise); + sandbox + .stub(modAckQueue, 'onDrain') + .returns(modAckDrainDeferred.promise); + ackQueue.numInFlightRequests = 1; // Ensure drain is waited for + modAckQueue.numInFlightRequests = 1; + + let closed = false; + subscriber.setOptions({ + closeOptions: { + timeout: Duration.from({milliseconds: 100}), + }, + }); + const prom = subscriber.close().then(() => { + closed = true; + }); + + // Resolve drains quickly + ackDrainDeferred.resolve(); + modAckDrainDeferred.resolve(); + + // Advance time slightly, but less than the timeout + clock.tick(50); + await prom; + + // Promise should resolve. + assert.strictEqual(closed, true); + }); + }); + }); + + describe('getClient', () => { + it('should get a subscriber client', async () => { + const pubsub = subscription.pubsub as {} as FakePubSub; + const spy = sandbox.spy(pubsub, 'getClient_'); + const client = await subscriber.getClient(); + const [options] = spy.lastCall.args; + assert.deepStrictEqual(options, {client: 'SubscriberClient'}); + assert.strictEqual(client, pubsub.client); + }); + }); + + describe('modAck', () => { + const deadline = 600; + + it('should add the message/deadline to the modAck queue', () => { + const modAckQueue: FakeModAckQueue = stubs.get('modAckQueue'); + const stub = sandbox.stub(modAckQueue, 'add').withArgs(message, deadline); + + void subscriber.modAck(message, deadline); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should capture latency after queue flush', async () => { + const modAckQueue: FakeModAckQueue = stubs.get('modAckQueue'); + const latencies: FakeHistogram = stubs.get('latencies'); + + const start = 1232123; + const end = 34838243; + const expectedSeconds = (end - start) / 1000; + + const dateStub = sandbox.stub(global.Date, 'now'); + + dateStub.onCall(0).returns(start); + dateStub.onCall(1).returns(end); + + sandbox.stub(modAckQueue, 'onFlush').resolves(); + const addStub = sandbox.stub(latencies, 'add').withArgs(expectedSeconds); + + await subscriber.modAck(message, deadline); + + assert.strictEqual(addStub.callCount, 1); + }); + }); + + describe('nack', () => { + it('should modAck the message with a 0 deadline', async () => { + const stub = sandbox.stub(subscriber, 'modAck'); + + await subscriber.nack(message); + + const [msg, deadline] = stub.lastCall.args; + + assert.strictEqual(msg, message); + assert.strictEqual(deadline, 0); + }); + + it('should log on ack completion', async () => { + fakeLog = new FakeLog(s.logs.ackNack); + + await subscriber.nack(message); + + assert.strictEqual(fakeLog.called, true); + assert.strictEqual( + fakeLog.fields!.severity, + loggingUtils.LogSeverity.INFO, + ); + assert.strictEqual(fakeLog.args![1], message.id); + }); + + it('should remove the message from the inventory', async () => { + const inventory: FakeLeaseManager = stubs.get('inventory'); + const stub = sandbox.stub(inventory, 'remove').withArgs(message); + + await subscriber.nack(message); + + assert.strictEqual(stub.callCount, 1); + }); + }); + + describe('open', () => { + beforeEach(() => subscriber.close()); + + it('should pass in batching options', () => { + const batching = {maxMessages: 100}; + + subscriber.setOptions({batching}); + subscriber.open(); + + const ackQueue: FakeAckQueue = stubs.get('ackQueue'); + const modAckQueue: FakeAckQueue = stubs.get('modAckQueue'); + + assert.strictEqual(ackQueue.options, batching); + assert.strictEqual(modAckQueue.options, batching); + }); + + it('should pass in flow control options', () => { + const flowControl = {maxMessages: 100}; + + subscriber.setOptions({flowControl}); + subscriber.open(); + + const inventory: FakeLeaseManager = stubs.get('inventory'); + + assert.strictEqual(inventory.options, flowControl); + }); + + it('should pass in streaming options', () => { + const streamingOptions = {maxStreams: 3}; + + subscriber.setOptions({streamingOptions}); + subscriber.open(); + + const stream: FakeMessageStream = stubs.get('messageStream'); + + assert.strictEqual(stream.options, streamingOptions); + }); + + it('should emit stream errors', done => { + subscriber.open(); + + const stream: FakeMessageStream = stubs.get('messageStream'); + const fakeError = new Error('err'); + + subscriber.on('error', err => { + assert.strictEqual(err, fakeError); + done(); + }); + + stream.emit('error', fakeError); + }); + + it('should close the subscriber if stream closes unexpectedly', done => { + const stub = sandbox.stub(subscriber, 'close'); + const stream: FakeMessageStream = stubs.get('messageStream'); + + stream.emit('close'); + + process.nextTick(() => { + assert.strictEqual(stub.callCount, 1); + done(); + }); + }); + + it('should add messages to the inventory', done => { + const message = new Message(subscriber, RECEIVED_MESSAGE); + + subscriber.open(); + + const modAckStub = sandbox.stub(subscriber, 'modAck'); + + const stream: FakeMessageStream = stubs.get('messageStream'); + const pullResponse = {receivedMessages: [RECEIVED_MESSAGE]}; + + const inventory: FakeLeaseManager = stubs.get('inventory'); + const addStub = sandbox.stub(inventory, 'add').callsFake(() => { + const [addMsg] = addStub.lastCall.args; + + // OTel is enabled during tests, so we need to delete the baggage. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [addMsgAny, msgAny] = [addMsg as any, message as any]; + delete addMsgAny.parentSpan; + delete addMsgAny.subSpans; + delete msgAny.parentSpan; + delete msgAny.subSpans; + + // Delete baggage for discovering unprocessed messages. + delete addMsgAny._handledPromise; + delete msgAny._handledPromise; + + assert.deepStrictEqual(addMsg, message); + + // test for receipt + const [modAckMsg, deadline] = modAckStub.lastCall.args; + assert.strictEqual(addMsg, modAckMsg); + assert.strictEqual(deadline, subscriber.ackDeadline); + + done(); + }); + + sandbox.stub(global.Date, 'now').returns(message.received); + stream.emit('data', pullResponse); + }); + + it('should pause the stream when full', () => { + const inventory: FakeLeaseManager = stubs.get('inventory'); + const stream: FakeMessageStream = stubs.get('messageStream'); + + const pauseStub = sandbox.stub(stream, 'pause'); + + inventory.emit('full'); + + assert.strictEqual(pauseStub.callCount, 1); + }); + + it('should resume the stream when not full', () => { + const inventory: FakeLeaseManager = stubs.get('inventory'); + const stream: FakeMessageStream = stubs.get('messageStream'); + + const resumeStub = sandbox.stub(stream, 'resume'); + + inventory.emit('free'); + + assert.strictEqual(resumeStub.callCount, 1); + }); + + it('should set isOpen to false', () => { + subscriber.open(); + assert.strictEqual(subscriber.isOpen, true); + }); + }); + + describe('setOptions', () => { + beforeEach(() => subscriber.close()); + + it('should capture the ackDeadline', () => { + const ackDeadline = Duration.from({seconds: 1232}); + + subscriber.setOptions({ + minAckDeadline: ackDeadline, + maxAckDeadline: ackDeadline, + }); + assert.strictEqual(subscriber.ackDeadline, ackDeadline.totalOf('second')); + }); + + it('should not set maxStreams higher than maxMessages', () => { + const maxMessages = 3; + const flowControl = {maxMessages}; + + subscriber.setOptions({flowControl}); + subscriber.open(); + + const stream: FakeMessageStream = stubs.get('messageStream'); + + assert.strictEqual(stream.options.maxStreams, maxMessages); + }); + + it('should pass through the max extension time', () => { + const maxExtensionTime = Duration.from({seconds: 1232}); + subscriber.setOptions({ + maxExtensionTime, + }); + assert.strictEqual( + subscriber.maxExtensionTime.seconds, + maxExtensionTime.seconds, + ); + }); + }); + + describe('OpenTelemetry tracing', () => { + beforeEach(() => { + exporter.reset(); + }); + + afterEach(async () => { + tracing.setGloballyEnabled(false); + exporter.reset(); + await subscriber.close(); + }); + + it('exports a span once it is created', () => { + tracing.setGloballyEnabled(true); + + subscription = new FakeSubscription() as {} as Subscription; + subscriber = new Subscriber(subscription, {}); + message = new Message(subscriber, RECEIVED_MESSAGE); + subscriber.open(); + + // Construct mock of received message with span context + const parentSpanContext: opentelemetry.SpanContext = { + traceId: 'd4cda95b652f4a1592b449d5929fda1b', + spanId: '6e0c63257de34c92', + traceFlags: opentelemetry.TraceFlags.SAMPLED, + }; + const parentSpan = opentelemetry.trace.getSpan( + tracing.spanContextToContext(parentSpanContext)!, + ); + const messageWithSpanContext = { + ackId: uuid.v4(), + message: { + attributes: { + [tracing.modernAttributeName]: JSON.stringify(parentSpanContext), + }, + data: Buffer.from('Hello, world!'), + messageId: uuid.v4(), + orderingKey: 'ordering-key', + publishTime: {seconds: 12, nanos: 32}, + }, + }; + tracing.injectSpan(parentSpan!, messageWithSpanContext.message); + const pullResponse: s.PullResponse = { + receivedMessages: [messageWithSpanContext], + }; + + const openedSub = subscriber as unknown as PublicInventory; + sandbox.stub(openedSub._inventory, 'add').callsFake((m: s.Message) => { + message = m; + }); + + // Receive message and assert that it was exported + const msgStream = stubs.get('messageStream'); + msgStream.emit('data', pullResponse); + + message.endParentSpan(); + + const spans = exporter.getFinishedSpans(); + assert.strictEqual(spans.length, 1); + assert.strictEqual(spans[0].events.length, 2); + const firstSpan = spans.pop(); + assert.ok(firstSpan); + assert.strictEqual(firstSpan.parentSpanId, parentSpanContext.spanId); + assert.strictEqual( + firstSpan.name, + `${subId} subscribe`, + 'name of span should match', + ); + assert.strictEqual( + firstSpan.kind, + SpanKind.CONSUMER, + 'span kind should be CONSUMER', + ); + }); + + it('exports a span even when a span context is not present on message', () => { + tracing.setGloballyEnabled(true); + + subscriber = new Subscriber(subscription, {}); + subscriber.open(); + + const pullResponse: s.PullResponse = { + receivedMessages: [RECEIVED_MESSAGE], + }; + + const openedSub = subscriber as unknown as PublicInventory; + sandbox.stub(openedSub._inventory, 'add').callsFake((m: s.Message) => { + message = m; + }); + + // Receive message and assert that it was exported + const stream: FakeMessageStream = stubs.get('messageStream'); + stream.emit('data', pullResponse); + + message.endParentSpan(); + assert.strictEqual(exporter.getFinishedSpans().length, 1); + }); + }); + + describe('Message', () => { + describe('initialization', () => { + it('should localize ackId', () => { + assert.strictEqual(message.ackId, RECEIVED_MESSAGE.ackId); + }); + + it('should localize attributes', () => { + assert.strictEqual( + message.attributes, + RECEIVED_MESSAGE.message.attributes, + ); + }); + + it('should localize data', () => { + assert.strictEqual(message.data, RECEIVED_MESSAGE.message.data); + }); + + it('should localize id', () => { + assert.strictEqual(message.id, RECEIVED_MESSAGE.message.messageId); + }); + + it('should localize orderingKey', () => { + assert.strictEqual( + message.orderingKey, + RECEIVED_MESSAGE.message.orderingKey, + ); + }); + + it('should localize publishTime', () => { + const m = new Message(subscriber, RECEIVED_MESSAGE); + const timestamp = m.publishTime as unknown as FakePreciseDate; + + assert(timestamp instanceof FakePreciseDate); + assert.strictEqual( + timestamp.value, + RECEIVED_MESSAGE.message.publishTime, + ); + }); + + it('should localize received time', () => { + const now = Date.now(); + + sandbox.stub(global.Date, 'now').returns(now); + + const m = new Message(subscriber, RECEIVED_MESSAGE); + + assert.strictEqual(m.received, now); + }); + }); + + describe('deliveryAttempt', () => { + it('should store the delivery attempt', () => { + const deliveryAttempt = 10; + const message = Object.assign({deliveryAttempt}, RECEIVED_MESSAGE); + const m = new Message(subscriber, message); + const attempt = m.deliveryAttempt; + assert.strictEqual(attempt, deliveryAttempt); + }); + + it('should default to 0', () => { + const m = new Message(subscriber, RECEIVED_MESSAGE); + const attempt = m.deliveryAttempt; + assert.strictEqual(attempt, 0); + }); + }); + + describe('length', () => { + it('should return the data length', () => { + assert.strictEqual(message.length, message.data.length); + }); + + it('should preserve the original data lenght', () => { + const originalLength = message.data.length; + + message.data = Buffer.from('ohno'); + assert.notStrictEqual(message.length, message.data.length); + assert.strictEqual(message.length, originalLength); + }); + }); + + describe('ack', () => { + it('should ack the message', () => { + const stub = sandbox.stub(subscriber, 'ack'); + + message.ack(); + + const [msg] = stub.lastCall.args; + assert.strictEqual(msg, message); + }); + + it('should ack the message with response', async () => { + subscriber.subscriptionProperties = {exactlyOnceDeliveryEnabled: true}; + const stub = sandbox.stub(subscriber, 'ackWithResponse'); + + stub.resolves(s.AckResponses.Success); + const response = await message.ackWithResponse(); + assert.strictEqual(response, s.AckResponses.Success); + }); + + it('should fail to ack the message with response', async () => { + subscriber.subscriptionProperties = {exactlyOnceDeliveryEnabled: true}; + const stub = sandbox.stub(subscriber, 'ackWithResponse'); + + stub.rejects(new s.AckError(s.AckResponses.Invalid)); + await assert.rejects(message.ackWithResponse()); + + // Should cache the result also. + await assert.rejects(message.ackWithResponse()); + assert.strictEqual(stub.callCount, 1); + }); + + it('should not ack the message if its been handled', () => { + const stub = sandbox.stub(subscriber, 'ack'); + + message.nack(); + message.ack(); + + assert.strictEqual(stub.callCount, 0); + }); + }); + + describe('modAck', () => { + it('should modAck the message', () => { + const fakeDeadline = 10; + const stub = sandbox.stub(subscriber, 'modAck'); + + message.modAck(fakeDeadline); + + const [msg, deadline] = stub.lastCall.args; + assert.strictEqual(msg, message); + assert.strictEqual(deadline, fakeDeadline); + }); + + it('should modAck the message with response', async () => { + subscriber.subscriptionProperties = {exactlyOnceDeliveryEnabled: true}; + const stub = sandbox.stub(subscriber, 'modAckWithResponse'); + + stub.resolves(s.AckResponses.Success); + const response = await message.modAckWithResponse(0); + assert.strictEqual(response, s.AckResponses.Success); + }); + + it('should fail to modAck the message with response', async () => { + subscriber.subscriptionProperties = {exactlyOnceDeliveryEnabled: true}; + const stub = sandbox.stub(subscriber, 'modAckWithResponse'); + + stub.rejects(new s.AckError(s.AckResponses.Invalid)); + await assert.rejects(message.modAckWithResponse(0)); + + // Should cache the result also. + await assert.rejects(message.modAckWithResponse(0)); + assert.strictEqual(stub.callCount, 1); + }); + + it('should not modAck the message if its been handled', () => { + const deadline = 10; + const stub = sandbox.stub(subscriber, 'modAck'); + + message.ack(); + message.modAck(deadline); + + assert.strictEqual(stub.callCount, 0); + }); + }); + + describe('nack', () => { + it('should nack the message', () => { + const stub = sandbox.stub(subscriber, 'modAck'); + + message.nack(); + + const [msg, delay] = stub.lastCall.args; + assert.strictEqual(msg, message); + assert.strictEqual(delay, 0); + }); + + it('should nack the message with response', async () => { + subscriber.subscriptionProperties = {exactlyOnceDeliveryEnabled: true}; + const stub = sandbox.stub(subscriber, 'nackWithResponse'); + + stub.resolves(s.AckResponses.Success); + const response = await message.nackWithResponse(); + assert.strictEqual(response, s.AckResponses.Success); + }); + + it('should fail to nack the message with response', async () => { + subscriber.subscriptionProperties = {exactlyOnceDeliveryEnabled: true}; + const stub = sandbox.stub(subscriber, 'nackWithResponse'); + + stub.rejects(new s.AckError(s.AckResponses.Invalid)); + await assert.rejects(message.nackWithResponse()); + + // Should cache the result also. + await assert.rejects(message.nackWithResponse()); + assert.strictEqual(stub.callCount, 1); + }); + + it('should not nack the message if its been handled', () => { + const stub = sandbox.stub(subscriber, 'modAck'); + + message.ack(); + message.nack(); + + assert.strictEqual(stub.callCount, 0); + }); + }); + }); + + describe('SubscriberSpans', () => { + const message: tracing.MessageWithAttributes = { + attributes: {}, + parentSpan: undefined, + }; + const spans = new s.SubscriberSpans(message); + const fakeSpan = { + end() {}, + } as unknown as opentelemetry.Span; + + it('starts a flow span', () => { + const stub = sandbox + .stub(tracing.PubsubSpans, 'createReceiveFlowSpan') + .returns(fakeSpan); + spans.flowStart(); + assert.strictEqual(stub.calledOnce, true); + assert.strictEqual(stub.args[0][0], message); + spans.flowStart(); + assert.strictEqual(stub.calledOnce, true); + }); + + it('ends a flow span', () => { + sandbox + .stub(tracing.PubsubSpans, 'createReceiveFlowSpan') + .returns(fakeSpan); + spans.flowStart(); + const spy = sandbox.spy(fakeSpan, 'end'); + spans.flowEnd(); + assert.strictEqual(spy.calledOnce, true); + spans.flowEnd(); + assert.strictEqual(spy.calledOnce, true); + }); + + it('fires a modAck start event', () => { + const stub = sandbox.stub(tracing.PubsubEvents, 'modAckStart'); + spans.modAckStart(Duration.from({seconds: 10}), true); + assert.strictEqual(stub.args[0][0], message); + assert.strictEqual(stub.args[0][1].totalOf('second'), 10); + assert.strictEqual(stub.args[0][2], true); + assert.strictEqual(stub.calledOnce, true); + }); + + it('fires a modAck end event', () => { + const stub = sandbox.stub(tracing.PubsubEvents, 'modAckEnd'); + spans.modAckEnd(); + assert.strictEqual(stub.args[0][0], message); + assert.strictEqual(stub.calledOnce, true); + }); + + it('starts a scheduler span', () => { + const stub = sandbox + .stub(tracing.PubsubSpans, 'createReceiveSchedulerSpan') + .returns(fakeSpan); + spans.schedulerStart(); + assert.strictEqual(stub.args[0][0], message); + assert.strictEqual(stub.calledOnce, true); + spans.schedulerStart(); + assert.strictEqual(stub.calledOnce, true); + }); + + it('ends a scheduler span', () => { + sandbox + .stub(tracing.PubsubSpans, 'createReceiveSchedulerSpan') + .returns(fakeSpan); + spans.schedulerStart(); + const spy = sandbox.spy(fakeSpan, 'end'); + spans.schedulerEnd(); + assert.strictEqual(spy.calledOnce, true); + spans.schedulerEnd(); + assert.strictEqual(spy.calledOnce, true); + }); + + it('starts a processing span', () => { + const stub = sandbox + .stub(tracing.PubsubSpans, 'createReceiveProcessSpan') + .returns(fakeSpan); + const subName = 'foozle'; + spans.processingStart(subName); + assert.strictEqual(stub.args[0][0], message); + assert.strictEqual(stub.args[0][1], subName); + assert.strictEqual(stub.calledOnce, true); + spans.processingStart('boo'); + assert.strictEqual(stub.calledOnce, true); + }); + + it('ends a processing span', () => { + sandbox + .stub(tracing.PubsubSpans, 'createReceiveSchedulerSpan') + .returns(fakeSpan); + spans.processingStart('foozle'); + const spy = sandbox.spy(fakeSpan, 'end'); + spans.processingEnd(); + assert.strictEqual(spy.calledOnce, true); + spans.processingEnd(); + assert.strictEqual(spy.calledOnce, true); + }); + }); +}); diff --git a/handwritten/pubsub/test/subscription.ts b/handwritten/pubsub/test/subscription.ts new file mode 100644 index 00000000000..aee0a9f90cf --- /dev/null +++ b/handwritten/pubsub/test/subscription.ts @@ -0,0 +1,1043 @@ +// Copyright 2014 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import {EventEmitter} from 'events'; +import {ServiceError} from 'google-gax'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; + +import {PubSub, RequestConfig} from '../src/pubsub'; +import {Snapshot} from '../src/snapshot'; +import {Message, SubscriberOptions} from '../src/subscriber'; +import * as subby from '../src/subscription'; +import * as util from '../src/util'; +import {DebugMessage} from '../src/debug'; + +let promisified = false; +const fakeUtil = Object.assign({}, util, { + promisifySome( + class_: Function, + classProtos: object, + methods: string[], + ): void { + if (class_.name === 'Subscription') { + promisified = true; + assert.deepStrictEqual(methods, [ + 'close', + 'create', + 'createSnapshot', + 'delete', + 'detached', + 'exists', + 'get', + 'getMetadata', + 'modifyPushConfig', + 'seek', + 'setMetadata', + ]); + } + // Defeats the method name type check. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + util.promisifySome(class_, classProtos, methods as any); + }, +}); + +class FakeIAM { + calledWith_: IArguments; + constructor() { + // eslint-disable-next-line prefer-rest-params + this.calledWith_ = arguments; + } +} + +class FakeSnapshot { + calledWith_: IArguments; + static formatName_?: Function; + constructor() { + // eslint-disable-next-line prefer-rest-params + this.calledWith_ = arguments; + } +} + +let subscriber: FakeSubscriber; + +class FakeSubscriber extends EventEmitter { + calledWith_: IArguments; + isOpen = false; + constructor() { + super(); + // eslint-disable-next-line prefer-rest-params + this.calledWith_ = arguments; + // eslint-disable-next-line @typescript-eslint/no-this-alias + subscriber = this; + } + open(): void { + this.isOpen = true; + } + async close(): Promise { + this.isOpen = false; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + setOptions(options: SubscriberOptions): void {} +} + +describe('Subscription', () => { + // tslint:disable-next-line variable-name + let Subscription: typeof subby.Subscription; + let subscription: Partial; + + const PROJECT_ID = 'test-project'; + const SUB_NAME = 'test-subscription'; + const SUB_FULL_NAME = 'projects/' + PROJECT_ID + '/subscriptions/' + SUB_NAME; + + const PUBSUB = { + projectId: PROJECT_ID, + request: util.noop, + createSubscription: util.noop, + } as {} as PubSub; + + before(() => { + Subscription = proxyquire('../src/subscription.js', { + './util': fakeUtil, + './iam.js': {IAM: FakeIAM}, + './snapshot.js': {Snapshot: FakeSnapshot}, + './subscriber.js': {Subscriber: FakeSubscriber}, + }).Subscription; + }); + + const sandbox = sinon.createSandbox(); + beforeEach(() => { + PUBSUB.request = util.noop; + subscription = new Subscription(PUBSUB, SUB_NAME); + }); + + afterEach(() => sandbox.restore()); + + describe('initialization', () => { + it('should promisify some of the things', () => { + assert(promisified); + }); + + it('should localize the pubsub object', () => { + assert.strictEqual(subscription.pubsub, PUBSUB); + }); + + it('should localize the project id', () => { + assert.strictEqual(subscription.projectId, PROJECT_ID); + }); + + it('should localize pubsub request method', done => { + PUBSUB.request = () => { + done(); + }; + + const subscription = new Subscription(PUBSUB, SUB_NAME); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (subscription as any).request(assert.ifError); + }); + + it('should format the sub name', () => { + const formattedName = 'a/b/c/d'; + const formatName = Subscription.formatName_; + + Subscription.formatName_ = (projectId: string, name: string) => { + assert.strictEqual(projectId, PROJECT_ID); + assert.strictEqual(name, SUB_NAME); + + Subscription.formatName_ = formatName; + + return formattedName; + }; + + const subscription = new Subscription(PUBSUB, SUB_NAME); + assert.strictEqual(subscription.name, formattedName); + }); + + it('should create an IAM object', () => { + assert(subscription.iam instanceof FakeIAM); + const args = (subscription.iam as {} as FakeIAM).calledWith_; + assert.strictEqual(args[0], PUBSUB); + assert.strictEqual(args[1], subscription); + }); + + it('should create a Subscriber', () => { + const options = {}; + const subscription = new Subscription(PUBSUB, SUB_NAME, options); + + const [sub, opts] = subscriber.calledWith_; + assert.strictEqual(sub, subscription); + assert.strictEqual(opts, options); + }); + + it('should open the subscriber when a listener is attached', () => { + const stub = sandbox.stub(subscriber, 'open'); + + subscription.on?.('message', () => {}); + assert.strictEqual(stub.callCount, 1); + }); + + it('should close the subscriber when no listeners are attached', () => { + const stub = sandbox.stub(subscriber, 'close'); + const cb = () => {}; + + subscription.on?.('message', cb); + subscription.removeListener?.('message', cb); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should emit messages', done => { + const message = { + subSpans: { + processingStart() {}, + processingEnd() {}, + }, + }; + + subscription.on?.('message', (msg: Message) => { + assert.strictEqual(msg, message); + done(); + }); + + subscriber.emit('message', message); + }); + + it('should emit errors', done => { + const error = new Error('err'); + + subscription.on?.('error', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + + subscriber.emit('error', error); + }); + + it('should emit close events', done => { + subscription.on?.('close', done); + subscriber.emit('close'); + }); + }); + + describe('formatMetadata_', () => { + it('should make a copy of the metadata', () => { + const metadata = {a: 'a'} as subby.SubscriptionMetadata; + const formatted = Subscription.formatMetadata_(metadata); + + assert.deepStrictEqual(metadata, formatted); + assert.notStrictEqual(metadata, formatted); + }); + + it('should format messageRetentionDuration', () => { + const threeDaysInSeconds = 3 * 24 * 60 * 60; + + const metadata = { + messageRetentionDuration: threeDaysInSeconds, + }; + + const formatted = Subscription.formatMetadata_(metadata); + + assert.strictEqual(formatted.messageRetentionDuration!.nanos, 0); + + assert.strictEqual( + formatted.messageRetentionDuration!.seconds, + threeDaysInSeconds, + ); + }); + + it('should format pushEndpoint', () => { + const pushEndpoint = 'http://noop.com/push'; + + const metadata = { + pushEndpoint, + }; + + const formatted = Subscription.formatMetadata_(metadata); + + assert.strictEqual(formatted.pushConfig!.pushEndpoint, pushEndpoint); + assert.strictEqual( + (formatted as subby.SubscriptionMetadata).pushEndpoint, + undefined, + ); + }); + + it('should format oidcToken', () => { + const oidcToken = { + serviceAccount: 'pubsub-test@appspot.gserviceaccount.com', + audience: 'audience', + }; + + const metadata = { + oidcToken, + }; + + const formatted = Subscription.formatMetadata_(metadata); + + assert.strictEqual(formatted.pushConfig!.oidcToken, oidcToken); + assert.strictEqual( + (formatted as subby.SubscriptionMetadata).oidcToken, + undefined, + ); + }); + + it('should format both pushEndpoint and oidcToken', () => { + const pushEndpoint = 'http://noop.com/push'; + + const oidcToken = { + serviceAccount: 'pubsub-test@appspot.gserviceaccount.com', + audience: 'audience', + }; + + const metadata = { + pushEndpoint, + oidcToken, + }; + + const formatted = Subscription.formatMetadata_(metadata); + + assert.strictEqual(formatted.pushConfig!.pushEndpoint, pushEndpoint); + assert.strictEqual( + (formatted as subby.SubscriptionMetadata).pushEndpoint, + undefined, + ); + + assert.strictEqual(formatted.pushConfig!.oidcToken, oidcToken); + assert.strictEqual( + (formatted as subby.SubscriptionMetadata).oidcToken, + undefined, + ); + }); + }); + + describe('formatName_', () => { + it('should format name', () => { + const formattedName = Subscription.formatName_(PROJECT_ID, SUB_NAME); + assert.strictEqual(formattedName, SUB_FULL_NAME); + }); + + it('should format name when given a complete name', () => { + const formattedName = Subscription.formatName_(PROJECT_ID, SUB_FULL_NAME); + assert.strictEqual(formattedName, SUB_FULL_NAME); + }); + }); + + describe('close', () => { + it('should call the success callback', done => { + sandbox.stub(subscriber, 'close').resolves(); + subscription.close?.(done); + }); + + it('should pass back any errors that occurs', done => { + const fakeErr = new Error('err'); + + sandbox.stub(subscriber, 'close').rejects(fakeErr); + + subscription!.close!((err: Error | undefined) => { + assert.strictEqual(err, fakeErr); + done(); + }); + }); + }); + + describe('create', () => { + const TOPIC_NAME = 'hi-ho-silver'; + + beforeEach(() => { + subscription.topic = TOPIC_NAME; + }); + + it('should throw an error if there is no topic', async () => { + const expectedError = + /Subscriptions can only be created when accessed through Topics/; + delete subscription.topic; + await assert.rejects(subscription.create!(), expectedError); + }); + + it('should pass the correct params', () => { + const fakeOptions = {}; + const stub = sandbox.stub(PUBSUB, 'createSubscription'); + + subscription.create?.(fakeOptions, assert.ifError); + + const [topic, name, options] = stub.lastCall.args; + assert.strictEqual(topic, TOPIC_NAME); + assert.strictEqual(name, SUB_NAME); + assert.strictEqual(options, fakeOptions); + }); + + it('should optionally accept options', () => { + const stub = sandbox.stub(PUBSUB, 'createSubscription'); + + subscription.create?.(assert.ifError); + + const options = stub.lastCall.args[2]; + assert.deepStrictEqual(options, {}); + }); + + it('should return any request errors', done => { + const fakeErr = new Error('err'); + const fakeResponse = {}; + const stub = sandbox.stub(PUBSUB, 'createSubscription'); + + subscription.create?.((err, sub, resp) => { + assert.strictEqual(err, fakeErr); + assert.strictEqual(sub, null); + assert.strictEqual(resp, fakeResponse); + done(); + }); + + const callback = stub.lastCall.args[3]; + setImmediate(callback, fakeErr as ServiceError, null, fakeResponse); + }); + + it('should update the subscription', done => { + const stub = sandbox.stub(PUBSUB, 'createSubscription'); + const fakeSub = new Subscription(PUBSUB, SUB_FULL_NAME); + const fakeResponse = {}; + + subscription.create?.(err => { + assert.ifError(err); + assert.strictEqual(subscription.metadata, fakeResponse); + done(); + }); + + const callback = stub.lastCall.args[3]; + fakeSub.metadata = fakeResponse; + setImmediate(callback, null, fakeSub, fakeResponse); + }); + + it('should pass back all the things', done => { + const fakeResponse = {}; + const stub = sandbox.stub(PUBSUB, 'createSubscription'); + + subscription.create?.((err, sub, resp) => { + assert.ifError(err); + assert.strictEqual(sub, subscription); + assert.strictEqual(resp, fakeResponse); + done(); + }); + + const callback = stub.lastCall.args[3]; + setImmediate(callback, null, null, fakeResponse); + }); + }); + + describe('createSnapshot', () => { + const SNAPSHOT_NAME = 'test-snapshot'; + + beforeEach(() => { + subscription.snapshot = (name: string) => { + return { + name, + } as Snapshot; + }; + }); + + it('should throw an error if a snapshot name is not found', async () => { + await assert.rejects(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (subscription as any).createSnapshot(); + }, /A name is required to create a snapshot\./); + }); + + it('should make the correct request', done => { + subscription.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'createSnapshot'); + assert.deepStrictEqual(config.reqOpts, { + name: SNAPSHOT_NAME, + subscription: subscription.name, + }); + done(); + }; + + subscription.createSnapshot?.(SNAPSHOT_NAME, assert.ifError); + }); + + it('should optionally accept gax options', done => { + const gaxOpts = {}; + + subscription.request = config => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + subscription.createSnapshot?.(SNAPSHOT_NAME, gaxOpts, assert.ifError); + }); + + it('should pass back any errors to the callback', done => { + const error = new Error('err'); + const apiResponse = {}; + + subscription.request = (config, callback: Function) => { + callback(error, apiResponse); + }; + + subscription.createSnapshot?.(SNAPSHOT_NAME, (err, snapshot, resp) => { + assert.strictEqual(err, error); + assert.strictEqual(snapshot, null); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + + it('should return a snapshot object with metadata', done => { + const apiResponse = {}; + const fakeSnapshot = {}; + + subscription.snapshot = () => { + return fakeSnapshot as Snapshot; + }; + + subscription.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + + subscription.createSnapshot?.(SNAPSHOT_NAME, (err, snapshot, resp) => { + assert.ifError(err); + assert.strictEqual(snapshot, fakeSnapshot); + assert.strictEqual(snapshot!.metadata, apiResponse); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + }); + + describe('debug', () => { + const error = new Error('err') as ServiceError; + const msg = new DebugMessage(error.message, error); + + beforeEach(() => { + subscription.request = (config, callback) => { + callback(error); + }; + }); + + it('should return the debug events to the callback', done => { + subscription.on?.('debug', (msg: DebugMessage) => { + assert.strictEqual(msg.error, error); + done(); + }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (subscription as any)._subscriber.emit('debug', msg); + }); + }); + + describe('delete', () => { + beforeEach(() => { + sandbox.stub(subscription, 'removeAllListeners').yields(util.noop); + sandbox.stub(subscription, 'close').yields(util.noop); + }); + + it('should make the correct request', done => { + subscription.request = (config: RequestConfig) => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'deleteSubscription'); + assert.deepStrictEqual(config.reqOpts, { + subscription: subscription.name, + }); + done(); + }; + + subscription.delete?.(assert.ifError); + }); + + it('should optionally accept gax options', done => { + const gaxOpts = {}; + + subscription.request = (config: RequestConfig) => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + subscription.delete?.(gaxOpts, assert.ifError); + }); + + describe('success', () => { + const apiResponse = {}; + + beforeEach(() => { + subscription.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + }); + + it('should return the api response', done => { + subscription.delete?.((err, resp) => { + assert.ifError(err); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + + it('should close the subscriber if open', done => { + const stub = sandbox.stub(subscriber, 'close'); + + subscription.open?.(); + + subscription.delete?.(err => { + assert.ifError(err); + assert.strictEqual(stub.callCount, 1); + done(); + }); + }); + }); + + describe('error', () => { + const error = new Error('err') as ServiceError; + + beforeEach(() => { + subscription.request = (config, callback) => { + callback(error); + }; + }); + + it('should return the error to the callback', done => { + subscription.delete?.(err => { + assert.strictEqual(err, error); + done(); + }); + }); + + it('should not remove all the listeners', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (subscription as any).removeAllListeners = () => { + done(new Error('Should not be called.')); + }; + + subscription.delete?.(() => { + done(); + }); + }); + + it('should not close the subscription', done => { + subscription.close = async () => { + done(new Error('Should not be called.')); + }; + + subscription.delete?.(() => { + done(); + }); + }); + }); + }); + + describe('exists', () => { + it('should return true if it finds metadata', done => { + sandbox.stub(subscription, 'getMetadata').yields(null, {}); + + subscription.exists?.((err, exists) => { + assert.ifError(err); + assert(exists); + done(); + }); + }); + + it('should return false if a not found error occurs', done => { + const error = {code: 5} as ServiceError; + sandbox.stub(subscription, 'getMetadata').yields(error); + + subscription.exists?.((err, exists) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should pass back any other type of error', done => { + const error = {code: 4} as ServiceError; + sandbox.stub(subscription, 'getMetadata').yields(error); + + subscription.exists?.((err, exists) => { + assert.strictEqual(err, error); + assert.strictEqual(exists, undefined); + done(); + }); + }); + }); + + describe('get', () => { + it('should delete the autoCreate option', done => { + const options = { + autoCreate: true, + a: 'a', + }; + sandbox.stub(subscription, 'getMetadata').callsFake(gaxOpts => { + assert.strictEqual(gaxOpts, options); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((gaxOpts as typeof options).autoCreate, undefined); + done(); + }); + + subscription.get?.(options, assert.ifError); + }); + + describe('success', () => { + const fakeMetadata = {}; + + it('should call through to getMetadata', done => { + sandbox + .stub(subscription, 'getMetadata') + .callsFake((gaxOpts, callback) => { + callback(null, fakeMetadata); + }); + + subscription.get?.((err, sub, resp) => { + assert.ifError(err); + assert.strictEqual(sub, subscription); + assert.strictEqual(resp, fakeMetadata); + done(); + }); + }); + + it('should optionally accept options', done => { + const options = {}; + sandbox + .stub(subscription, 'getMetadata') + .callsFake((gaxOpts, callback) => { + assert.strictEqual(gaxOpts, options); + callback(null); // the done fn + }); + + subscription.get?.(options, done); + }); + }); + + describe('error', () => { + it('should pass back errors when not auto-creating', done => { + const error = {code: 4} as ServiceError; + const apiResponse = {}; + sandbox + .stub(subscription, 'getMetadata') + .callsArgWith(1, error, apiResponse); + + subscription.get?.((err, sub, resp) => { + assert.strictEqual(err, error); + assert.strictEqual(sub, null); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + + it('should pass back 404 errors if autoCreate is false', done => { + const error = {code: 5} as ServiceError; + const apiResponse = {}; + sandbox + .stub(subscription, 'getMetadata') + .callsArgWith(1, error, apiResponse); + + subscription.get?.((err, sub, resp) => { + assert.strictEqual(err, error); + assert.strictEqual(sub, null); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + + it('should pass back 404 errors if create doesnt exist', done => { + const error = {code: 5} as ServiceError; + const apiResponse = {}; + sandbox + .stub(subscription, 'getMetadata') + .callsArgWith(1, error, apiResponse); + + delete subscription.create; + + subscription.get?.((err, sub, resp) => { + assert.strictEqual(err, error); + assert.strictEqual(sub, null); + assert.strictEqual(resp, apiResponse); + done(); + }); + }); + + it('should create the sub if 404 + autoCreate is true', done => { + const error = {code: 5} as ServiceError; + const apiResponse = {}; + + const fakeOptions = { + autoCreate: true, + }; + sandbox + .stub(subscription, 'getMetadata') + .callsArgWith(1, error, apiResponse); + + sandbox.stub(subscription, 'create').callsFake(options => { + assert.strictEqual(options.gaxOpts, fakeOptions); + done(); + }); + + subscription.topic = 'hi-ho-silver'; + subscription.get?.(fakeOptions, assert.ifError); + }); + }); + }); + + describe('getMetadata', () => { + it('should make the correct request', done => { + subscription.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'getSubscription'); + assert.deepStrictEqual(config.reqOpts, { + subscription: subscription.name, + }); + done(); + }; + + subscription.getMetadata?.(assert.ifError); + }); + + it('should optionally accept gax options', done => { + const gaxOpts = {}; + + subscription.request = config => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + subscription.getMetadata?.(gaxOpts, assert.ifError); + }); + + it('should pass back any errors that occur', done => { + const error = new Error('err'); + const apiResponse = {}; + + subscription.request = (config, callback: Function) => { + callback(error, apiResponse); + }; + + subscription.getMetadata?.((err, metadata) => { + assert.strictEqual(err, error); + assert.strictEqual(metadata, apiResponse); + done(); + }); + }); + + it('should set the metadata if no error occurs', done => { + const apiResponse = {}; + + subscription.request = (config, callback: Function) => { + callback(null, apiResponse); + }; + + subscription.getMetadata?.((err, metadata) => { + assert.ifError(err); + assert.strictEqual(metadata, apiResponse); + assert.strictEqual(subscription.metadata, apiResponse); + done(); + }); + }); + }); + + describe('modifyPushConfig', () => { + const fakeConfig = {}; + + it('should make the correct request', done => { + subscription.request = config => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'modifyPushConfig'); + assert.deepStrictEqual(config.reqOpts, { + subscription: subscription.name, + pushConfig: fakeConfig, + }); + done(); + }; + + subscription.modifyPushConfig?.(fakeConfig, assert.ifError); + }); + + it('should optionally accept gaxOpts', done => { + const gaxOpts = {}; + + subscription.request = config => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + subscription.modifyPushConfig?.(fakeConfig, gaxOpts, assert.ifError); + }); + }); + + describe('open', () => { + it('should open the subscriber', () => { + const stub = sandbox.stub(subscriber, 'open'); + + subscription.open?.(); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should noop if already open', () => { + const spy = sandbox.spy(subscriber, 'open'); + + subscription.open?.(); + subscription.open?.(); + + assert.strictEqual(spy.callCount, 1); + }); + }); + + describe('seek', () => { + const FAKE_SNAPSHOT_NAME = 'a'; + const FAKE_FULL_SNAPSHOT_NAME = 'a/b/c/d'; + + beforeEach(() => { + FakeSnapshot.formatName_ = () => { + return FAKE_FULL_SNAPSHOT_NAME; + }; + }); + + it('should throw if a name or date is not provided', async () => { + await assert.rejects(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (subscription as any).seek(); + }, /Either a snapshot name or Date is needed to seek to\./); + }); + + it('should make the correct api request', done => { + FakeSnapshot.formatName_ = (projectId: string, name: string) => { + assert.strictEqual(projectId, PROJECT_ID); + assert.strictEqual(name, FAKE_SNAPSHOT_NAME); + return FAKE_FULL_SNAPSHOT_NAME; + }; + + subscription.request = (config: RequestConfig) => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'seek'); + assert.deepStrictEqual(config.reqOpts, { + subscription: subscription.name, + snapshot: FAKE_FULL_SNAPSHOT_NAME, + }); + done(); + }; + + subscription.seek?.(FAKE_SNAPSHOT_NAME, assert.ifError); + }); + + it('should optionally accept a Date object', done => { + const date = new Date(); + const reqOpts = { + subscription: SUB_FULL_NAME, + time: { + seconds: Math.floor(date.getTime() / 1000), + nanos: Math.floor(date.getTime() % 1000) * 1000, + }, + }; + subscription.request = (config: RequestConfig) => { + assert.deepStrictEqual(config.reqOpts, reqOpts); + done(); + }; + + subscription.seek?.(date, assert.ifError); + }); + + it('should optionally accept gax options', done => { + const gaxOpts = {}; + + subscription.request = (config: RequestConfig) => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + + subscription.seek?.(FAKE_SNAPSHOT_NAME, gaxOpts, assert.ifError); + }); + }); + + describe('setMetadata', () => { + const METADATA = { + pushEndpoint: 'http://noop.com/push', + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const subClass = subby.Subscription as any; + + beforeEach(() => { + subClass.formatMetadata_ = (metadata: {}) => { + return Object.assign({}, metadata); + }; + }); + + it('should make the correct request', done => { + const formattedMetadata = { + pushConfig: { + pushEndpoint: METADATA.pushEndpoint, + }, + }; + + const expectedBody = Object.assign( + { + name: SUB_FULL_NAME, + }, + formattedMetadata, + ); + + Subscription.formatMetadata_ = metadata => { + assert.strictEqual(metadata, METADATA); + return formattedMetadata; + }; + + const reqOpts = { + subscription: expectedBody, + updateMask: { + paths: ['push_config'], + }, + }; + + subscription.request = (config: RequestConfig) => { + assert.strictEqual(config.client, 'SubscriberClient'); + assert.strictEqual(config.method, 'updateSubscription'); + assert.deepStrictEqual(config.reqOpts, reqOpts); + done(); + }; + + subscription.setMetadata?.(METADATA, done); + }); + + it('should optionally accept gax options', done => { + const gaxOpts = {}; + + subscription.request = (config: RequestConfig) => { + assert.strictEqual(config.gaxOpts, gaxOpts); + done(); + }; + subscription.setMetadata?.(METADATA, gaxOpts, done); + }); + }); + + describe('setOptions', () => { + it('should pass the options to the subscriber', () => { + const options = {}; + const stub = sandbox.stub(subscriber, 'setOptions').withArgs(options); + subscription.setOptions?.(options); + assert.strictEqual(stub.callCount, 1); + }); + }); + + describe('snapshot', () => { + const SNAPSHOT_NAME = 'a'; + + it('should call through to pubsub.snapshot', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (PUBSUB as any).snapshot = function (name: string) { + assert.strictEqual(this, subscription); + assert.strictEqual(name, SNAPSHOT_NAME); + done(); + }; + + subscription.snapshot?.(SNAPSHOT_NAME); + }); + }); +}); diff --git a/handwritten/pubsub/test/telemetry-tracing.ts b/handwritten/pubsub/test/telemetry-tracing.ts new file mode 100644 index 00000000000..4ef42f10557 --- /dev/null +++ b/handwritten/pubsub/test/telemetry-tracing.ts @@ -0,0 +1,485 @@ +/*! + * Copyright 2020-2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 * as assert from 'assert'; +import {describe, it, beforeEach} from 'mocha'; + +import * as trace from '@opentelemetry/sdk-trace-base'; +import * as otel from '../src/telemetry-tracing'; +import {exporter} from './tracing'; +import {SpanKind} from '@opentelemetry/api'; +import sinon = require('sinon'); +import {PubsubMessage} from '../src/publisher'; +import {Duration} from '../src/temporal'; + +describe('OpenTelemetryTracer', () => { + beforeEach(() => { + exporter.reset(); + otel.setGloballyEnabled(true); + }); + afterEach(() => { + exporter.reset(); + otel.setGloballyEnabled(false); + }); + + describe('project parser', () => { + it('parses subscription info', () => { + const name = 'projects/project-name/subscriptions/sub-name'; + const info = otel.getSubscriptionInfo(name); + assert.strictEqual(info.subName, name); + assert.strictEqual(info.projectId, 'project-name'); + assert.strictEqual(info.subId, 'sub-name'); + assert.strictEqual(info.topicId, undefined); + assert.strictEqual(info.topicName, undefined); + }); + + it('parses topic info', () => { + const name = 'projects/project-name/topics/topic-name'; + const info = otel.getTopicInfo(name); + assert.strictEqual(info.topicName, name); + assert.strictEqual(info.projectId, 'project-name'); + assert.strictEqual(info.topicId, 'topic-name'); + assert.strictEqual(info.subId, undefined); + assert.strictEqual(info.subName, undefined); + }); + + it('parses broken subscription info', () => { + const name = 'projec/foo_foo/subs/sub_sub'; + const info = otel.getSubscriptionInfo(name); + assert.strictEqual(info.subName, name); + assert.strictEqual(info.projectId, undefined); + assert.strictEqual(info.subId, undefined); + assert.strictEqual(info.topicId, undefined); + assert.strictEqual(info.topicName, undefined); + }); + + it('parses broken topic info', () => { + const name = 'projec/foo_foo/tops/top_top'; + const info = otel.getTopicInfo(name); + assert.strictEqual(info.subName, undefined); + assert.strictEqual(info.projectId, undefined); + assert.strictEqual(info.subId, undefined); + assert.strictEqual(info.topicId, undefined); + assert.strictEqual(info.topicName, name); + }); + }); + + describe('basic span creation', () => { + it('creates a span', () => { + const message: PubsubMessage = {}; + const span = otel.PubsubSpans.createPublisherSpan( + message, + 'projects/test/topics/topicfoo', + 'tests', + ) as trace.Span; + span.end(); + + const spans = exporter.getFinishedSpans(); + assert.notStrictEqual(spans.length, 0); + const exportedSpan = spans.concat().pop()!; + + assert.strictEqual(exportedSpan.name, 'topicfoo create'); + assert.strictEqual(exportedSpan.kind, SpanKind.PRODUCER); + }); + + it('injects a trace context', () => { + const message: PubsubMessage = { + attributes: {}, + }; + const span = otel.PubsubSpans.createPublisherSpan( + message, + 'projects/test/topics/topicfoo', + 'tests', + ) as trace.Span; + + otel.injectSpan(span, message); + + assert.strictEqual( + Object.getOwnPropertyNames(message.attributes).includes( + otel.modernAttributeName, + ), + true, + ); + }); + }); + + describe('context propagation', () => { + it('injects a trace context', () => { + const message: PubsubMessage = { + attributes: {}, + }; + const span = otel.PubsubSpans.createPublisherSpan( + message, + 'projects/test/topics/topicfoo', + 'tests', + ); + assert.ok(span); + + otel.injectSpan(span, message); + + assert.strictEqual( + Object.getOwnPropertyNames(message.attributes).includes( + otel.modernAttributeName, + ), + true, + ); + }); + + it('should issue a warning if OpenTelemetry span context key is set', () => { + const message: PubsubMessage = { + attributes: { + [otel.modernAttributeName]: 'bazbar', + }, + }; + const span = otel.PubsubSpans.createPublisherSpan( + message, + 'projects/test/topics/topicfoo', + 'tests', + ); + assert.ok(span); + + const warnSpy = sinon.spy(console, 'warn'); + try { + otel.injectSpan(span, message); + assert.strictEqual(warnSpy.callCount, 1); + } finally { + warnSpy.restore(); + } + }); + + it('should be able to determine if attributes are present', () => { + let message: otel.MessageWithAttributes; + + message = { + attributes: { + [otel.modernAttributeName]: 'foobar', + }, + }; + assert.strictEqual(otel.containsSpanContext(message), true); + + message = {}; + assert.strictEqual(otel.containsSpanContext(message), false); + }); + + it('extracts a trace context', () => { + const message = { + attributes: { + [otel.modernAttributeName]: + '00-d4cda95b652f4a1592b449d5929fda1b-553964cd9101a314-01', + }, + }; + + const childSpan = otel.extractSpan( + message, + 'projects/test/subscriptions/subfoo', + ); + assert.strictEqual( + childSpan!.spanContext().traceId, + 'd4cda95b652f4a1592b449d5929fda1b', + ); + }); + }); + + describe('attribute creation', () => { + it('creates attributes for publish', () => { + const topicInfo: otel.AttributeParams = { + topicName: 'projects/foo/topics/top', + topicId: 'top', + projectId: 'foo', + }; + const message: PubsubMessage = { + data: Buffer.from('test'), + attributes: {}, + calculatedSize: 1234, + orderingKey: 'key', + isExactlyOnceDelivery: true, + ackId: 'ackack', + }; + + const topicAttrs = otel.PubsubSpans.createAttributes( + topicInfo, + message, + 'tests', + 'create', + ); + assert.deepStrictEqual(topicAttrs, { + 'messaging.system': 'gcp_pubsub', + 'messaging.destination.name': topicInfo.topicId, + 'gcp.project_id': topicInfo.projectId, + 'messaging.message.envelope.size': message.calculatedSize, + 'messaging.gcp_pubsub.message.ordering_key': message.orderingKey, + 'messaging.gcp_pubsub.message.exactly_once_delivery': + message.isExactlyOnceDelivery, + 'messaging.gcp_pubsub.message.ack_id': message.ackId, + 'messaging.operation': 'create', + 'code.function': 'tests', + }); + + // Check again with no calculated size and other parameters missing. + delete message.calculatedSize; + delete message.orderingKey; + delete message.isExactlyOnceDelivery; + delete message.ackId; + + const topicAttrs2 = otel.PubsubSpans.createAttributes( + topicInfo, + message, + 'tests', + 'create', + ); + assert.deepStrictEqual(topicAttrs2, { + 'messaging.system': 'gcp_pubsub', + 'messaging.destination.name': topicInfo.topicId, + 'messaging.operation': 'create', + 'gcp.project_id': topicInfo.projectId, + 'messaging.message.envelope.size': message.data?.length, + 'code.function': 'tests', + }); + }); + }); + + describe('specialized span creation', () => { + const tests = { + topicInfo: { + topicName: 'projects/foo/topics/top', + topicId: 'top', + projectId: 'foo', + } as otel.AttributeParams, + subInfo: { + subName: 'projects/foo/subscriptions/sub', + subId: 'sub', + projectId: 'foo', + } as otel.AttributeParams, + message: { + data: Buffer.from('test'), + attributes: {}, + calculatedSize: 1234, + orderingKey: 'key', + isExactlyOnceDelivery: true, + ackId: 'ackack', + } as PubsubMessage, + }; + + it('creates publisher spans', () => { + const span = otel.PubsubSpans.createPublisherSpan( + tests.message, + tests.topicInfo.topicName!, + 'tests', + ); + assert.ok(span); + span.end(); + + const spans = exporter.getFinishedSpans(); + assert.strictEqual(spans.length, 1); + + const firstSpan = spans.pop(); + assert.ok(firstSpan); + assert.strictEqual(firstSpan.name, `${tests.topicInfo.topicId} create`); + assert.strictEqual(firstSpan.attributes['messaging.operation'], 'create'); + assert.strictEqual( + firstSpan.attributes['messaging.destination.name'], + tests.topicInfo.topicId, + ); + assert.strictEqual(firstSpan.attributes['messaging.operation'], 'create'); + assert.strictEqual( + firstSpan.attributes['messaging.system'], + 'gcp_pubsub', + ); + }); + + it('updates publisher topic names', () => { + const span = otel.PubsubSpans.createPublisherSpan( + tests.message, + tests.topicInfo.topicName!, + 'tests', + ); + assert.ok(span); + otel.PubsubSpans.updatePublisherTopicName( + span, + 'projects/foo/topics/other', + ); + span.end(); + + const spans = exporter.getFinishedSpans(); + assert.strictEqual(spans.length, 1); + + const firstSpan = spans.pop(); + assert.ok(firstSpan); + assert.strictEqual(firstSpan.name, 'other create'); + assert.strictEqual( + firstSpan.attributes['messaging.destination.name'], + 'other', + ); + }); + + it('creates receive spans', () => { + const parentSpan = otel.PubsubSpans.createPublisherSpan( + tests.message, + tests.topicInfo.topicName!, + 'tests', + ); + assert.ok(parentSpan); + const span = otel.PubsubSpans.createReceiveSpan( + tests.message, + tests.subInfo.subName!, + otel.spanContextToContext(parentSpan.spanContext()), + 'tests', + ); + assert.ok(span); + span.end(); + parentSpan.end(); + + const spans = exporter.getFinishedSpans(); + const parentReadSpan = spans.pop(); + const childReadSpan = spans.pop(); + assert.ok(parentReadSpan && childReadSpan); + + assert.strictEqual(childReadSpan.name, 'sub subscribe'); + assert.strictEqual( + childReadSpan.attributes['messaging.operation'], + 'receive', + ); + assert.strictEqual( + childReadSpan.attributes['messaging.destination.name'], + 'sub', + ); + assert.strictEqual( + childReadSpan.attributes['messaging.operation'], + 'receive', + ); + assert.strictEqual(childReadSpan.kind, SpanKind.CONSUMER); + assert.ok(childReadSpan.parentSpanId); + }); + + it('creates publish RPC spans', () => { + const message: PubsubMessage = {}; + const topicName = 'projects/test/topics/topicfoo'; + const span = otel.PubsubSpans.createPublisherSpan( + message, + topicName, + 'test', + ) as trace.Span; + message.parentSpan = span; + span.end(); + + const publishSpan = otel.PubsubSpans.createPublishRpcSpan( + [message], + topicName, + 'test', + ); + + publishSpan?.end(); + const spans = exporter.getFinishedSpans(); + const publishReadSpan = spans.pop(); + const childReadSpan = spans.pop(); + assert.ok(publishReadSpan && childReadSpan); + + assert.strictEqual( + publishReadSpan.attributes['messaging.batch.message_count'], + 1, + ); + assert.strictEqual(publishReadSpan.links.length, 1); + assert.strictEqual(childReadSpan.links.length, 1); + }); + + it('creates ack rpc span', () => { + const message: PubsubMessage = {}; + const topicName = 'projects/test/topics/topicfoo'; + const subName = 'subTest'; + const producerSpan = otel.PubsubSpans.createPublisherSpan( + message, + topicName, + 'test', + ) as trace.Span; + const span = otel.PubsubSpans.createAckRpcSpan( + [producerSpan], + subName, + 'tests', + ); + assert.ok(span); + producerSpan.end(); + span.end(); + + const spans = exporter.getFinishedSpans(); + assert.strictEqual(spans.length, 2); + + const firstSpan = spans.pop(); + assert.ok(firstSpan); + assert.strictEqual(firstSpan.kind, SpanKind.CLIENT); + assert.strictEqual(firstSpan.name, `${subName} ack`); + assert.strictEqual( + firstSpan.attributes['messaging.destination.name'], + subName, + ); + assert.strictEqual( + firstSpan.attributes['messaging.batch.message_count'], + 1, + ); + assert.strictEqual( + firstSpan.attributes['messaging.system'], + 'gcp_pubsub', + ); + }); + + it('creates modack rpc span', () => { + const message: PubsubMessage = {}; + const topicName = 'projects/test/topics/topicfoo'; + const subName = 'subTest'; + const producerSpan = otel.PubsubSpans.createPublisherSpan( + message, + topicName, + 'test', + ) as trace.Span; + const span = otel.PubsubSpans.createModackRpcSpan( + [producerSpan], + subName, + 'modack', + 'test', + Duration.from({seconds: 1}), + true, + ); + assert.ok(span); + producerSpan.end(); + span.end(); + + const spans = exporter.getFinishedSpans(); + assert.strictEqual(spans.length, 2); + + const firstSpan = spans.pop(); + assert.ok(firstSpan); + assert.strictEqual(firstSpan.kind, SpanKind.CLIENT); + assert.strictEqual(firstSpan.name, `${subName} modack`); + assert.strictEqual( + firstSpan.attributes['messaging.destination.name'], + subName, + ); + assert.strictEqual( + firstSpan.attributes[ + 'messaging.gcp_pubsub.message.ack_deadline_seconds' + ], + 1, + ); + assert.strictEqual( + firstSpan.attributes['messaging.gcp_pubsub.is_receipt_modack'], + true, + ); + assert.strictEqual( + firstSpan.attributes['messaging.system'], + 'gcp_pubsub', + ); + }); + }); +}); diff --git a/handwritten/pubsub/test/temporal.ts b/handwritten/pubsub/test/temporal.ts new file mode 100644 index 00000000000..2e906ce3b65 --- /dev/null +++ b/handwritten/pubsub/test/temporal.ts @@ -0,0 +1,94 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {describe, it} from 'mocha'; +import { + Duration, + atLeast as durationAtLeast, + atMost as durationAtMost, +} from '../src/temporal'; +import * as assert from 'assert'; + +describe('temporal', () => { + describe('Duration', () => { + it('can be created from millis', () => { + const duration = Duration.from({milliseconds: 1234}); + assert.strictEqual(duration.seconds, 1.234); + }); + + it('can be created from seconds', () => { + const duration = Duration.from({seconds: 1.234}); + assert.strictEqual(duration.milliseconds, 1234); + }); + + it('can be created from minutes', () => { + const duration = Duration.from({minutes: 30}); + assert.strictEqual(duration.total('hour'), 0.5); + }); + + it('can be created from hours', () => { + const duration = Duration.from({hours: 1.5}); + assert.strictEqual(duration.total('minute'), 90); + }); + + it('can be created from a Duration', () => { + const duration = Duration.from({seconds: 5}); + const second = Duration.from(duration); + assert.strictEqual(duration.milliseconds, second.milliseconds); + }); + + it('adds durations', () => { + const duration = Duration.from({seconds: 10}); + const second = duration.add({milliseconds: 1000}); + assert.strictEqual(second.seconds, 11); + }); + + it('subtracts durations', () => { + const duration = Duration.from({seconds: 10}); + const second = duration.subtract({seconds: 5}); + assert.strictEqual(second.milliseconds, 5000); + }); + + it('compares durations', () => { + const duration = Duration.from({seconds: 10}); + const less = Duration.from({seconds: 5}); + const more = Duration.from({seconds: 15}); + + const minus = Duration.compare(duration, more); + assert.strictEqual(minus, -1); + + const plus = Duration.compare(duration, less); + assert.strictEqual(plus, 1); + + const equal = Duration.compare(duration, duration); + assert.strictEqual(equal, 0); + }); + + it('has working helper functions', () => { + const duration = Duration.from({seconds: 10}); + + const atLeast1 = durationAtLeast(duration, Duration.from({seconds: 5})); + assert.strictEqual(atLeast1.seconds, 10); + + const atLeast2 = durationAtLeast(duration, Duration.from({seconds: 15})); + assert.strictEqual(atLeast2.seconds, 15); + + const atMost1 = durationAtMost(duration, Duration.from({seconds: 5})); + assert.strictEqual(atMost1.seconds, 5); + + const atMost2 = durationAtMost(duration, Duration.from({seconds: 15})); + assert.strictEqual(atMost2.seconds, 10); + }); + }); +}); diff --git a/handwritten/pubsub/test/test-utils.ts b/handwritten/pubsub/test/test-utils.ts new file mode 100644 index 00000000000..f171d468550 --- /dev/null +++ b/handwritten/pubsub/test/test-utils.ts @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {SinonSandbox, SinonFakeTimers} from 'sinon'; +import {loggingUtils} from 'google-gax'; + +type FakeTimersParam = Parameters[0]; +interface FakeTimerConfig { + now?: number; + toFake?: string[]; +} + +/** + * Utilities for unit test code. + * + * @private + */ +export class TestUtils { + /** + * This helper should be used to enable fake timers for Sinon sandbox. + * + * @param sandbox The sandbox + * @param now An optional date to set for "now" + * @returns The clock object from useFakeTimers() + */ + static useFakeTimers(sandbox: SinonSandbox, now?: number): SinonFakeTimers { + const config: FakeTimerConfig = { + toFake: [ + 'setTimeout', + 'clearTimeout', + 'setInterval', + 'clearInterval', + 'Date', + ], + }; + if (now) { + config.now = now; + } + + // The types are screwy in useFakeTimers(). I'm just going to pick one. + return sandbox.useFakeTimers(config as FakeTimersParam); + } +} + +/** + * Wrapper to hook the output of ad-hoc loggers (loggingUtils.AdhocDebugLogFunction), + * because the sandbox will patch the wrong instance of the methods. + * + * @private + */ +export class FakeLog { + fields?: loggingUtils.LogFields; + args?: unknown[]; + called = false; + log: loggingUtils.AdhocDebugLogFunction; + listener: (lf: loggingUtils.LogFields, a: unknown[]) => void; + + constructor(log: loggingUtils.AdhocDebugLogFunction) { + this.log = log; + this.listener = (lf: loggingUtils.LogFields, a: unknown[]) => { + this.fields = lf; + this.args = a; + this.called = true; + }; + this.log.on('log', this.listener); + } + + remove() { + // This really ought to be properly exposed, but since it's not, we'll + // do this for now to keep the tests from being leaky. + const instance = (this.log as loggingUtils.AdhocDebugLogFunction).instance; + instance.off('log', this.listener); + } +} diff --git a/handwritten/pubsub/test/testResources.test.ts b/handwritten/pubsub/test/testResources.test.ts new file mode 100644 index 00000000000..b1cf3a67371 --- /dev/null +++ b/handwritten/pubsub/test/testResources.test.ts @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {describe, it, beforeEach} from 'mocha'; +import {TestResources} from './testResources'; +import * as assert from 'assert'; + +describe('testResources (unit)', () => { + const fixedId = 'fixed'; + const fixedTime = Date.now(); + const fakeTokenMaker = { + uuid: () => fixedId, + timestamp: () => fixedTime, + }; + + const suiteId = 'someSuite'; + let testResources!: TestResources; + + beforeEach(() => { + testResources = new TestResources(suiteId, fakeTokenMaker); + }); + + it('has predictable prefixes', () => { + const prefix = testResources.getPrefix('testId'); + assert.strictEqual(prefix, `${suiteId}-${fixedTime}-testId`); + + const normalizedPrefix = testResources.getPrefix('test-id-dashes'); + assert.strictEqual( + normalizedPrefix, + `${suiteId}-${fixedTime}-test_id_dashes`, + ); + + const suitePrefix = testResources.getPrefix(); + assert.strictEqual(suitePrefix, `${suiteId}-${fixedTime}`); + }); + + it('generates names', () => { + const prefix = testResources.getPrefix('testId'); + const name = testResources.generateName('testId'); + assert.strictEqual(name, `${prefix}-${fixedId}`); + }); + + it('filters for cleanup', () => { + const resources = [ + { + // Not related + name: 'ooga', + }, + { + // For current test run + name: `${suiteId}-${fixedTime}-bob-98719284791`, + }, + { + // For previous test run, but not very old + name: `${suiteId}-${fixedTime - 100}-bob-124897912`, + }, + { + // For previous test run, but old + name: `${suiteId}-${fixedTime - 3000 * 60 * 60}-bob-57823975`, + }, + ]; + const filtered = testResources.filterForCleanup(resources); + assert.strictEqual(filtered.length, 2); + assert.strictEqual( + 1, + filtered.filter(r => r.name?.includes('bob-9871')).length, + ); + assert.strictEqual( + 1, + filtered.filter(r => r.name?.includes('bob-5782')).length, + ); + }); +}); diff --git a/handwritten/pubsub/test/testResources.ts b/handwritten/pubsub/test/testResources.ts new file mode 100644 index 00000000000..05550606d76 --- /dev/null +++ b/handwritten/pubsub/test/testResources.ts @@ -0,0 +1,182 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// I don't like that these two files (this plus ".test") are duplicated +// across the two test structures, but because of the tangle of rootDirs +// and package.json "files", it's hard to avoid it. + +import * as uuid from 'uuid'; + +// Returns a shortened UUID that can be used to identify a +// specific run of a specific test. +function shortUUID() { + return uuid.v4().split('-').shift()!; +} + +export interface TokenMaker { + uuid(): string; + timestamp(): number; +} + +export const defaultMaker = { + uuid: shortUUID, + timestamp: () => Date.now(), +}; + +export interface Resource { + name?: string | null | undefined; + delete?(): Promise; +} + +function normalizeId(id: string): string { + return id.replace(/-/g, '_'); +} + +/** + * Manages the names of testing resources during a test run. It's + * easily to accidentally leak resources, and it's easy to accidentally + * have conflicts with tests running concurrently, so this class helps + * you manage them. + * + * Used nomenclature: + * Test - a single test for a single aspect of code; for example, + * "create a topic in pub/sub" + * Test Suite - a collection of tests that are generally run together; + * for example, "test topic operations in pub/sub" + * Test Run - a single run of a test suite (or single test within a suite); + * for example, "run the tests for PR #1234, 5th attempt" + */ +export class TestResources { + testSuiteId: string; + currentTime: string; + tokenMaker: TokenMaker; + + /** + * @param testSuiteId [string] A unique ID for a test suite (e.g. + * pubsub-topics). + */ + constructor(testSuiteId: string, tokenMaker: TokenMaker = defaultMaker) { + this.testSuiteId = normalizeId(testSuiteId); + this.currentTime = `${tokenMaker.timestamp()}`; + this.tokenMaker = tokenMaker; + } + + /** + * Returns the resource prefix for the current run of the test suite. + * Optionally, testId may specify the specific ID of a test in the + * suite. + */ + getPrefix(testId?: string): string { + if (testId) { + return [this.testSuiteId, this.currentTime, normalizeId(testId)].join( + '-', + ); + } else { + return [this.testSuiteId, this.currentTime].join('-'); + } + } + + /** + * Generates a unique resource name for one run of a test within + * a test suite. + */ + generateName(testId: string): string { + return [this.getPrefix(testId), this.tokenMaker.uuid()].join('-'); + } + + /** + * Generates a unique resource name for one run of a test within + * a test suite for BigQuery resources. + */ + generateBigQueryName(testId: string): string { + return [normalizeId(this.getPrefix(testId)), this.tokenMaker.uuid()].join( + '_', + ); + } + + /** + * Generates a unique resource name for one run of a test within + * a test suite for Cloud Storage resources. + */ + generateStorageName(testId: string): string { + return [normalizeId(this.getPrefix(testId)), this.tokenMaker.uuid()].join( + '_', + ); + } + + /** + * Given a list of resource names (and a test ID), this will return + * a list of all resources that should be deleted to clean up for + * the current run of that particular test. + */ + filterForTest(testId: string, allResources: Resource[]): Resource[] { + const prefix = this.getPrefix(testId); + return allResources.filter(n => n.name?.includes(prefix)); + } + + /** + * Given a list of resource names, this will return a list of all + * resources that should be deleted to clean up after the current + * run of a test suite. + */ + filterForCurrentRun(allResources: Resource[]): Resource[] { + const prefix = this.getPrefix(); + return allResources.filter(n => n.name?.includes(prefix)); + } + + /** + * Given a list of resource names, this will return a list of all + * resources that should be deleted to clean up after any run + * of the current test suite. Note that some of the names may + * still be in use. + */ + filterForSuite(allResources: Resource[]): Resource[] { + return allResources.filter(n => n.name?.includes(this.testSuiteId)); + } + + /** + * Given a list of resource names, this will return a list of all + * resources that should be deleted to generally clean up after any + * run of the current test suite. This is much like filterForSuite(), + * but it also filters by age - items that are less than 2 hours + * old will not be cleaned. + */ + filterForCleanup(allResources: Resource[]): Resource[] { + const currentRunPrefix = this.getPrefix(); + return allResources.filter(n => { + let name = n.name || undefined; + if (name === undefined) { + return false; + } + + // We'll always get at least one thing. + name = name.split('/').pop()!; + + if (name.startsWith(currentRunPrefix)) { + return true; + } + + if (name.startsWith(this.testSuiteId)) { + const parts = name.split('-'); + const createdAt = Number(parts[1]); + const timeDiff = (Date.now() - createdAt) / (1000 * 60 * 60); + if (timeDiff >= 2) { + return true; + } + } + + return false; + }); + } +} diff --git a/handwritten/pubsub/test/topic.ts b/handwritten/pubsub/test/topic.ts new file mode 100644 index 00000000000..c918b21c64e --- /dev/null +++ b/handwritten/pubsub/test/topic.ts @@ -0,0 +1,780 @@ +// Copyright 2014 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 * as assert from 'assert'; +import {describe, it, before, beforeEach, afterEach} from 'mocha'; +import {CallOptions, ServiceError} from 'google-gax'; +import * as proxyquire from 'proxyquire'; +import * as sinon from 'sinon'; + +import {google} from '../protos/protos'; +import {ExistsCallback, RequestCallback, RequestConfig} from '../src/pubsub'; +import { + CreateSubscriptionOptions, + Subscription, + SubscriptionOptions, +} from '../src/subscription'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import {GetTopicMetadataCallback, Topic} from '../src/topic'; +import * as util from '../src/util'; + +let promisified = false; +const fakeUtil = Object.assign({}, util, { + promisifySome( + class_: Function, + classProtos: object, + methods: string[], + ): void { + if (class_.name === 'Topic') { + promisified = true; + assert.deepStrictEqual(methods, [ + 'flush', + 'create', + 'createSubscription', + 'delete', + 'exists', + 'get', + 'getMetadata', + 'getSubscriptions', + 'setMetadata', + ]); + // Defeats the method name type check. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + util.promisifySome(class_, classProtos, methods as any); + } + }, +}); + +class FakeIAM { + calledWith_: Array<{}>; + constructor(...args: Array<{}>) { + this.calledWith_ = args; + } +} + +class FakePublisher { + calledWith_: Array<{}>; + published_!: Array<{}>; + options_!: object; + constructor(...args: Array<{}>) { + this.calledWith_ = args; + } + publishMessage(...args: Array<{}>) { + this.published_ = args; + } + publishWhenReady(...args: Array<{}>) { + this.published_ = args; + } + setOptions(options: object) { + this.options_ = options; + } + getOptionDefaults() { + return this.options_; + } +} + +let extended = false; +const fakePaginator = { + extend(klass: Function, methods: string[]) { + if (klass.name !== 'Topic') { + return; + } + assert.deepStrictEqual(methods, ['getSubscriptions']); + extended = true; + }, + streamify(methodName: string) { + return methodName; + }, +}; + +describe('Topic', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Topic: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let topic: typeof Topic; + + const PROJECT_ID = 'test-project'; + const TOPIC_NAME = 'projects/' + PROJECT_ID + '/topics/test-topic'; + const TOPIC_UNFORMATTED_NAME = TOPIC_NAME.split('/').pop(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const PUBSUB: any = { + projectId: PROJECT_ID, + createTopic: util.noop, + request: util.noop, + }; + + before(() => { + Topic = proxyquire('../src/topic.js', { + './util': fakeUtil, + '@google-cloud/paginator': { + paginator: fakePaginator, + }, + './iam': {IAM: FakeIAM}, + './publisher': {Publisher: FakePublisher}, + }).Topic; + }); + + const sandbox = sinon.createSandbox(); + beforeEach(() => { + topic = new Topic(PUBSUB, TOPIC_NAME); + topic.parent = PUBSUB; + }); + afterEach(() => sandbox.restore()); + + describe('initialization', () => { + it('should extend the correct methods', () => { + assert(extended); // See `fakePaginator.extend` + }); + + it('should streamify the correct methods', () => { + assert.strictEqual(topic.getSubscriptionsStream, 'getSubscriptions'); + }); + + it('should promisify some of the things', () => { + assert(promisified); + }); + + it('should format the name', () => { + const formattedName = 'a/b/c/d'; + + const formatName_ = Topic.formatName_; + Topic.formatName_ = (projectId: string, name: string) => { + assert.strictEqual(projectId, PROJECT_ID); + assert.strictEqual(name, TOPIC_NAME); + + Topic.formatName_ = formatName_; + + return formattedName; + }; + + const topic = new Topic(PUBSUB, TOPIC_NAME); + assert.strictEqual(topic.name, formattedName); + }); + + it('should create a publisher', () => { + const fakeOptions = {}; + const topic = new Topic(PUBSUB, TOPIC_NAME, fakeOptions); + + const [t, options] = topic.publisher.calledWith_; + + assert.strictEqual(t, topic); + assert.strictEqual(options, fakeOptions); + }); + + it('should localize the parent object', () => { + assert.strictEqual(topic.parent, PUBSUB); + assert.strictEqual(topic.pubsub, PUBSUB); + }); + + it('should localize the request function', done => { + PUBSUB.request = () => { + done(); + }; + + const topic = new Topic(PUBSUB, TOPIC_NAME); + topic.request(assert.ifError); + }); + + it('should create an iam object', () => { + assert.deepStrictEqual(topic.iam.calledWith_, [PUBSUB, topic]); + }); + }); + + describe('formatName_', () => { + it('should format name', () => { + const formattedName = Topic.formatName_( + PROJECT_ID, + TOPIC_UNFORMATTED_NAME, + ); + assert.strictEqual(formattedName, TOPIC_NAME); + }); + + it('should format name when given a complete name', () => { + const formattedName = Topic.formatName_(PROJECT_ID, TOPIC_NAME); + assert.strictEqual(formattedName, TOPIC_NAME); + }); + }); + + describe('create', () => { + it('should call the parent createTopic method', done => { + const options_ = {}; + + PUBSUB.createTopic = (name: string, options: CallOptions) => { + assert.strictEqual(name, topic.name); + assert.strictEqual(options, options_); + done(); + }; + + topic.create(options_, assert.ifError); + }); + }); + + describe('createSubscription', () => { + it('should call the parent createSubscription method', done => { + const NAME = 'sub-name'; + const OPTIONS = {a: 'a'}; + + PUBSUB.createSubscription = ( + topic_: Topic, + name: string, + options: CreateSubscriptionOptions, + ) => { + assert.strictEqual(topic_, topic); + assert.strictEqual(name, NAME); + assert.strictEqual(options, OPTIONS); + done(); + }; + + topic.createSubscription(NAME, OPTIONS, assert.ifError); + }); + }); + + describe('delete', () => { + it('should make the proper request', done => { + topic.request = (config: RequestConfig) => { + assert.strictEqual(config.client, 'PublisherClient'); + assert.strictEqual(config.method, 'deleteTopic'); + assert.deepStrictEqual(config.reqOpts, {topic: topic.name}); + done(); + }; + + topic.delete(assert.ifError); + }); + + it('should optionally accept gax options', done => { + const options = {}; + + topic.request = (config: RequestConfig) => { + assert.strictEqual(config.gaxOpts, options); + done(); + }; + + topic.delete(options, assert.ifError); + }); + }); + + describe('get', () => { + it('should delete the autoCreate option', done => { + const options = { + autoCreate: true, + a: 'a', + }; + + topic.getMetadata = (gaxOpts: CallOptions) => { + assert.strictEqual(gaxOpts, options); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + assert.strictEqual((gaxOpts as any).autoCreate, undefined); + done(); + }; + + topic.get(options, assert.ifError); + }); + + describe('success', () => { + const fakeMetadata = {}; + + beforeEach(() => { + topic.getMetadata = ( + gaxOpts: CallOptions, + callback: RequestCallback, + ) => { + callback(null, fakeMetadata); + }; + }); + + it('should call through to getMetadata', done => { + topic.get( + (err: Error, _topic: Topic, resp: google.pubsub.v1.ITopic) => { + assert.ifError(err); + assert.strictEqual(_topic, topic); + assert.strictEqual(resp, fakeMetadata); + done(); + }, + ); + }); + + it('should optionally accept options', done => { + const options = {}; + + topic.getMetadata = (gaxOpts: CallOptions) => { + assert.strictEqual(gaxOpts, options); + done(); + }; + + topic.get(options, assert.ifError); + }); + }); + + describe('error', () => { + it('should pass back errors when not auto-creating', done => { + const error = {code: 4} as ServiceError; + const apiResponse = {} as Topic; + + topic.getMetadata = ( + gaxOpts: CallOptions, + callback: GetTopicMetadataCallback, + ) => { + callback(error, apiResponse); + }; + + topic.get( + (err: Error, _topic: Topic, resp: google.pubsub.v1.ITopic) => { + assert.strictEqual(err, error); + assert.strictEqual(_topic, null); + assert.strictEqual(resp, apiResponse); + done(); + }, + ); + }); + + it('should pass back 404 errors if autoCreate is false', done => { + const error = {code: 5} as ServiceError; + const apiResponse = {} as Topic; + + topic.getMetadata = ( + gaxOpts: CallOptions, + callback: GetTopicMetadataCallback, + ) => { + callback(error, apiResponse); + }; + + topic.get( + (err: Error, _topic: Topic, resp: google.pubsub.v1.ITopic) => { + assert.strictEqual(err, error); + assert.strictEqual(_topic, null); + assert.strictEqual(resp, apiResponse); + done(); + }, + ); + }); + + it('should create the topic if 404 + autoCreate is true', done => { + const error = {code: 5} as ServiceError; + const apiResponse = {} as Topic; + + const fakeOptions = { + autoCreate: true, + }; + + topic.getMetadata = ( + gaxOpts: CallOptions, + callback: GetTopicMetadataCallback, + ) => { + callback(error, apiResponse); + }; + + topic.create = (options: CallOptions) => { + assert.strictEqual(options, fakeOptions); + done(); + }; + + topic.get(fakeOptions, assert.ifError); + }); + }); + }); + + describe('exists', () => { + it('should return true if it finds metadata', done => { + topic.getMetadata = (callback: GetTopicMetadataCallback) => { + callback(null, {}); + }; + + topic.exists((err: Error, exists: ExistsCallback) => { + assert.ifError(err); + assert(exists); + done(); + }); + }); + + it('should return false if a not found error occurs', done => { + const error = {code: 5} as ServiceError; + topic.getMetadata = (callback: GetTopicMetadataCallback) => { + callback(error); + }; + + topic.exists((err: Error, exists: ExistsCallback) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + }); + }); + + it('should pass back any other type of error', done => { + const error = {code: 4} as ServiceError; + + topic.getMetadata = (callback: GetTopicMetadataCallback) => { + callback(error); + }; + + topic.exists((err: Error, exists: ExistsCallback) => { + assert.strictEqual(err, error); + assert.strictEqual(exists, undefined); + done(); + }); + }); + }); + + describe('getMetadata', () => { + it('should make the proper request', done => { + topic.request = (config: RequestConfig) => { + assert.strictEqual(config.client, 'PublisherClient'); + assert.strictEqual(config.method, 'getTopic'); + assert.deepStrictEqual(config.reqOpts, {topic: topic.name}); + done(); + }; + + topic.getMetadata(assert.ifError); + }); + + it('should optionally accept gax options', done => { + const options = {}; + + topic.request = (config: RequestConfig) => { + assert.strictEqual(config.gaxOpts, options); + done(); + }; + + topic.getMetadata(options, assert.ifError); + }); + + it('should pass back any errors that occur', done => { + const error = new Error('err') as ServiceError; + const apiResponse = {}; + + topic.request = ( + config: RequestConfig, + callback: GetTopicMetadataCallback, + ) => { + callback(error, apiResponse); + }; + + topic.getMetadata((err: Error, metadata: google.pubsub.v1.ITopic) => { + assert.strictEqual(err, error); + assert.strictEqual(metadata, apiResponse); + done(); + }); + }); + + it('should set the metadata if no error occurs', done => { + const apiResponse = {}; + + topic.request = ( + config: RequestConfig, + callback: GetTopicMetadataCallback, + ) => { + callback(null, apiResponse); + }; + + topic.getMetadata((err: Error, metadata: google.pubsub.v1.ITopic) => { + assert.ifError(err); + assert.strictEqual(metadata, apiResponse); + assert.strictEqual(topic.metadata, apiResponse); + done(); + }); + }); + }); + + describe('getSubscriptions', () => { + it('should make the correct request', done => { + interface testOptions { + a: string; + b: string; + gaxOpts?: { + e: string; + }; + autoPaginate?: boolean; + } + const options: testOptions = { + a: 'a', + b: 'b', + gaxOpts: { + e: 'f', + }, + autoPaginate: false, + }; + + const expectedOptions = Object.assign( + { + topic: topic.name, + }, + options, + ); + + const expectedGaxOpts = Object.assign( + { + autoPaginate: options.autoPaginate, + }, + options.gaxOpts, + ); + + delete expectedOptions.gaxOpts; + delete expectedOptions.autoPaginate; + + topic.request = (config: RequestConfig) => { + assert.strictEqual(config.client, 'PublisherClient'); + assert.strictEqual(config.method, 'listTopicSubscriptions'); + assert.deepStrictEqual(config.reqOpts, expectedOptions); + assert.deepStrictEqual(config.gaxOpts, expectedGaxOpts); + done(); + }; + + topic.getSubscriptions(options, assert.ifError); + }); + + it('should accept only a callback', done => { + topic.request = (config: RequestConfig) => { + assert.deepStrictEqual(config.reqOpts, {topic: topic.name}); + assert.deepStrictEqual(config.gaxOpts, {autoPaginate: undefined}); + done(); + }; + + topic.getSubscriptions(assert.ifError); + }); + + it('should create subscription objects', done => { + const fakeSubs = ['a', 'b', 'c']; + + topic.subscription = (name: string) => { + return { + name, + }; + }; + + topic.request = ( + config: RequestConfig, + callback: RequestCallback, + ) => { + callback(null, fakeSubs); + }; + + topic.getSubscriptions((err: Error, subscriptions: Subscription[]) => { + assert.ifError(err); + assert.deepStrictEqual(subscriptions, [ + {name: 'a'}, + {name: 'b'}, + {name: 'c'}, + ]); + done(); + }); + }); + + it('should pass all params to the callback', done => { + const err_ = new Error('err'); + const subs_ = undefined; + const nextQuery_ = {}; + const apiResponse_ = {}; + + topic.request = + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (config: RequestConfig, callback: (...args: any[]) => void) => { + callback(err_, subs_, nextQuery_, apiResponse_); + }; + + topic.getSubscriptions( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (err: Error, subs: boolean, nextQuery: any, apiResponse: any) => { + assert.strictEqual(err, err_); + assert.deepStrictEqual(subs, subs_); + assert.strictEqual(nextQuery, nextQuery_); + assert.strictEqual(apiResponse, apiResponse_); + done(); + }, + ); + }); + }); + + describe('publish', () => { + it('should call through to Topic#publishMessage', () => { + const fdata = Buffer.from('Hello, world!'); + const fattributes = {}; + const fcallback = () => {}; + + const stub = sandbox.stub(topic, 'publishMessage'); + + topic.publish(fdata, fattributes, fcallback); + + const [{data, attributes}, callback] = stub.lastCall.args; + assert.strictEqual(data, fdata); + assert.strictEqual(attributes, fattributes); + assert.strictEqual(callback, fcallback); + }); + }); + + describe('publishJSON', () => { + it('should throw an error for non-object types', () => { + const expectedError = /First parameter should be an object\./; + + assert.throws(() => topic.publishJSON('hi'), expectedError); + }); + + it('should pass along the attributes and callback', () => { + const stub = sandbox.stub(topic, 'publishMessage'); + const fakeAttributes = {}; + const fakeCallback = () => {}; + + topic.publishJSON({}, fakeAttributes, fakeCallback); + + const [{attributes}, callback] = stub.lastCall.args; + assert.strictEqual(attributes, fakeAttributes); + assert.strictEqual(callback, fakeCallback); + }); + }); + + describe('publishMessage', () => { + it('should call through to Publisher#publishMessage', () => { + const stub = sandbox.stub(topic.publisher, 'publishMessage'); + + const fdata = Buffer.from('Hello, world!'); + const fattributes = {}; + const fcallback = () => {}; + + topic.publish(fdata, fattributes, fcallback); + + const [{data, attributes}, callback] = stub.lastCall.args; + assert.strictEqual(data, fdata); + assert.strictEqual(attributes, fattributes); + assert.strictEqual(callback, fcallback); + }); + + it('should transform JSON into a Buffer', () => { + const json = {foo: 'bar'}; + const expectedBuffer = Buffer.from(JSON.stringify(json)); + const stub = sandbox.stub(topic.publisher, 'publishMessage'); + + topic.publishMessage({json}); + + const [{data}] = stub.lastCall.args; + assert.deepStrictEqual(data, expectedBuffer); + }); + + it('should return the return value of Publisher#publishMessage', () => { + const fakePromise = Promise.resolve(); + sandbox.stub(topic.publisher, 'publishMessage').resolves(fakePromise); + + const promise = topic.publishMessage({data: Buffer.from('hi')}); + assert.strictEqual(promise, fakePromise); + }); + }); + + describe('setMetadata', () => { + const METADATA = { + labels: {yee: 'haw'}, + messageRetentionDuration: {moo: 'cows'}, + }; + + let requestStub: sinon.SinonStub; + + beforeEach(() => { + requestStub = sandbox.stub(topic, 'request'); + }); + + it('should call the correct rpc', () => { + topic.setMetadata(METADATA, assert.ifError); + + const [{client, method}] = requestStub.lastCall.args; + assert.strictEqual(client, 'PublisherClient'); + assert.strictEqual(method, 'updateTopic'); + }); + + it('should send the correct request options', () => { + topic.setMetadata(METADATA, assert.ifError); + + const expectedTopic = Object.assign({name: topic.name}, METADATA); + const expectedUpdateMask = { + paths: ['labels', 'message_retention_duration'], + }; + + const [{reqOpts}] = requestStub.lastCall.args; + assert.deepStrictEqual(reqOpts.topic, expectedTopic); + assert.deepStrictEqual(reqOpts.updateMask, expectedUpdateMask); + }); + + it('should accept call options', () => { + const callOptions = {}; + + topic.setMetadata(METADATA, callOptions, assert.ifError); + + const [{gaxOpts}] = requestStub.lastCall.args; + assert.strictEqual(gaxOpts, callOptions); + }); + + it('should pass the user callback to request', () => { + const spy = sandbox.spy(); + + topic.setMetadata(METADATA, spy); + + const [, callback] = requestStub.lastCall.args; + assert.strictEqual(callback, spy); + }); + }); + + describe('setPublishOptions', () => { + it('should call through to Publisher#setOptions', () => { + const fakeOptions = {}; + const stub = sandbox + .stub(topic.publisher, 'setOptions') + .withArgs(fakeOptions); + + topic.setPublishOptions(fakeOptions); + + assert.strictEqual(stub.callCount, 1); + }); + + it('should call through to Publisher#getOptionDefaults', () => { + topic.publisher.options_ = {}; + const defaults = topic.getPublishOptionDefaults(); + assert.strictEqual(defaults, topic.publisher.options_); + }); + }); + + describe('subscription', () => { + it('should pass correct arguments to pubsub#subscription', done => { + const subscriptionName = 'subName'; + const opts = {}; + + topic.parent.subscription = ( + name: string, + options: SubscriptionOptions, + ) => { + assert.strictEqual(name, subscriptionName); + assert.deepStrictEqual(options, opts); + done(); + }; + + topic.subscription(subscriptionName, opts); + }); + + it('should attach the topic instance to the options', done => { + topic.parent.subscription = ( + name: string, + options: SubscriptionOptions, + ) => { + assert.strictEqual(options.topic, topic); + done(); + }; + + topic.subscription(); + }); + + it('should return the result', done => { + topic.parent.subscription = () => { + return done; + }; + + const doneFn = topic.subscription(); + doneFn(); + }); + }); +}); diff --git a/handwritten/pubsub/test/tracing.ts b/handwritten/pubsub/test/tracing.ts new file mode 100644 index 00000000000..7689253ad43 --- /dev/null +++ b/handwritten/pubsub/test/tracing.ts @@ -0,0 +1,41 @@ +/*! + * Copyright 2021 Google LLC. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 { + BasicTracerProvider, + InMemorySpanExporter, + SimpleSpanProcessor, +} from '@opentelemetry/sdk-trace-base'; + +/** + * This file is used to initialise a global tracing provider and span exporter + * for our tests used in our project. This was the only way I was able to get + * the tracing tests to work. + * + * Now before each test related or touches Opentelemetry + * we are resetting the exporter defined below to ensure there are no spans + * from previous tests still in memory. This is achived by calling `reset` + * on the exporter in the unit tests while keeping one instance of + * the trace provider and exporter. + * + * The tracing provider is being registered as a global trace provider before + * we are importing our actual code which uses the Opentelemetry API to ensure + * its defined beforehand. + */ +export const exporter: InMemorySpanExporter = new InMemorySpanExporter(); +export const provider: BasicTracerProvider = new BasicTracerProvider(); +provider.addSpanProcessor(new SimpleSpanProcessor(exporter)); +provider.register(); diff --git a/handwritten/pubsub/test/util.ts b/handwritten/pubsub/test/util.ts new file mode 100644 index 00000000000..ba8d0e63df6 --- /dev/null +++ b/handwritten/pubsub/test/util.ts @@ -0,0 +1,144 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {describe, it} from 'mocha'; +import {addToBucket, Throttler, awaitWithTimeout} from '../src/util'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {Duration} from '../src'; + +describe('utils', () => { + describe('Throttler', () => { + it('does not allow too many calls through at once', () => { + const throttler = new Throttler(300); + let totalCalls = ''; + + // This one should succeed. + throttler.doMaybe(() => { + totalCalls += 'FIRST'; + }); + + // This one should fail. + throttler.doMaybe(() => { + totalCalls += 'SECOND'; + }); + + // Simulate time passing. + throttler.lastTime! -= 1000; + + // This one should succeed. + throttler.doMaybe(() => { + totalCalls += 'THIRD'; + }); + + assert.strictEqual(totalCalls, 'FIRSTTHIRD'); + }); + }); + + describe('addToBucket', () => { + it('adds to a non-existent bucket', () => { + const map = new Map(); + addToBucket(map, 'a', 'b'); + assert.deepStrictEqual(map.get('a'), ['b']); + }); + + it('adds to an existent bucket', () => { + const map = new Map(); + map.set('a', ['c']); + addToBucket(map, 'a', 'b'); + assert.deepStrictEqual(map.get('a'), ['c', 'b']); + }); + }); + + describe('awaitWithTimeout', () => { + let sandbox: sinon.SinonSandbox; + beforeEach(() => { + sandbox = sinon.createSandbox(); + }); + afterEach(() => { + sandbox.restore(); + }); + + it('handles non-timeout properly', async () => { + const fakeTimers = sandbox.useFakeTimers(0); + let resolve = () => {}; + const testString = 'fooby'; + const testPromise = new Promise(r => { + resolve = () => r(testString); + }); + fakeTimers.setTimeout(resolve, 500); + const awaitPromise = awaitWithTimeout( + testPromise, + Duration.from({seconds: 1}), + ); + fakeTimers.tick(500); + + const result = await awaitPromise; + assert.strictEqual(result.returnedValue, testString); + assert.strictEqual(result.exception, undefined); + assert.strictEqual( + result.timedOut, + false, + 'timeout was triggered, improperly', + ); + }); + + it('handles non-timeout errors properly', async () => { + const fakeTimers = sandbox.useFakeTimers(0); + let reject = () => {}; + const testString = 'fooby'; + const testPromise = new Promise((res, rej) => { + reject = () => rej(testString); + }); + fakeTimers.setTimeout(reject, 500); + const awaitPromise = awaitWithTimeout( + testPromise, + Duration.from({seconds: 1}), + ); + fakeTimers.tick(500); + + const result = await awaitPromise; + assert.strictEqual( + result.exception, + testString, + 'non-error was triggered, improperly', + ); + assert.strictEqual(result.timedOut, false); + }); + + it('handles timeout properly', async () => { + const fakeTimers = sandbox.useFakeTimers(0); + let resolve = () => {}; + const testString = 'fooby'; + const testPromise = new Promise(r => { + resolve = () => r(testString); + }); + fakeTimers.setTimeout(resolve, 1500); + const awaitPromise = awaitWithTimeout( + testPromise, + Duration.from({seconds: 1}), + ); + fakeTimers.tick(1500); + + const result = await awaitPromise; + assert.strictEqual( + result.timedOut, + true, + 'timeout was not triggered, improperly', + ); + + assert.strictEqual(result.timedOut, true); + }); + }); +}); diff --git a/handwritten/pubsub/tsconfig.json b/handwritten/pubsub/tsconfig.json new file mode 100644 index 00000000000..860d6bf027b --- /dev/null +++ b/handwritten/pubsub/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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", + "src/**/*.json", + "protos/protos.json" + ] +} diff --git a/handwritten/pubsub/webpack.config.js b/handwritten/pubsub/webpack.config.js new file mode 100644 index 00000000000..6336ba02165 --- /dev/null +++ b/handwritten/pubsub/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: 'pubsub', + filename: './pubsub.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-submodules.json b/release-please-submodules.json index 9bee5a45b8e..eb0a3459d8e 100644 --- a/release-please-submodules.json +++ b/release-please-submodules.json @@ -35,6 +35,9 @@ "handwritten/logging-winston": { "component": "logging-winston" }, + "handwritten/pubsub": { + "component": "pubsub" + }, "handwritten/spanner": { "component": "spanner" },